class GdsApi::LinkCheckerApi

def check(uri, synchronous: nil, checked_within: nil)

Raises:
  • (HTTPErrorResponse) - if the request returns an error

Returns:
  • (LinkReport) - A +SimpleDelegator+ of the +GdsApi::Response+ which

Parameters:
  • checked_within (Fixnum) -- The number of seconds the last check should
  • synchronous (Boolean) -- Whether the check should happen immediately. (optional)
  • uri (String) -- The URI to check.
def check(uri, synchronous: nil, checked_within: nil)
  params = {
    uri: uri,
    synchronous: synchronous,
    checked_within: checked_within
  }
  response = get_json(
    "#{endpoint}/check" + query_string(params.delete_if { |_, v| v.nil? })
  )
  LinkReport.new(response.to_hash)
end

def create_batch(uris, checked_within: nil, webhook_uri: nil, webhook_secret_token: nil)

Raises:
  • (HTTPErrorResponse) - if the request returns an error

Returns:
  • (BatchReport) - A +SimpleDelegator+ of the +GdsApi::Response+ which

Parameters:
  • webhook_secret_token (String) -- A secret token that the API will use to generate a signature of the request. (optional)
  • webhook_uri (String) -- The URI to be called when the batch finishes. (optional)
  • checked_within (Fixnum) -- The number of seconds the last check should
  • uris (Array) -- A list of URIs to check.
def create_batch(uris, checked_within: nil, webhook_uri: nil, webhook_secret_token: nil)
  payload = {
    uris: uris,
    checked_within: checked_within,
    webhook_uri: webhook_uri,
    webhook_secret_token: webhook_secret_token,
  }
  response = post_json(
    "#{endpoint}/batch", payload.delete_if { |_, v| v.nil? }
  )
  BatchReport.new(response.to_hash)
end

def get_batch(id)

Raises:
  • (HTTPErrorResponse) - if the request returns an error

Returns:
  • (BatchReport) - A +SimpleDelegator+ of the +GdsApi::Response+ which

Parameters:
  • id (Fixnum) -- The batch ID to get information about.
def get_batch(id)
  BatchReport.new(
    get_json(
      "#{endpoint}/batch/#{id}"
    ).to_hash
  )
end

def upsert_resource_monitor(links, app, reference)

def upsert_resource_monitor(links, app, reference)
  payload = {
    links: links,
    app: app,
    reference: reference
  }
  response = post_json("#{endpoint}/monitor", payload)
  MonitorReport.new(response.to_hash)
end