class NgrokAPI::Services::AbuseReportsClient

Abuse Reports allow you to submit take-down requests for URLs hosted by

ngrok that violate ngrok's terms of service.

ngrok.com/docs/api#api-abuse-reports

Constants

PATH

The API path for the requests

Attributes

client[R]

Public Class Methods

new(client:) click to toggle source
# File lib/ngrokapi/services/abuse_reports_client.rb, line 16
def initialize(client:)
  @client = client
end

Public Instance Methods

create(urls:, metadata: "") click to toggle source

Creates a new abuse report which will be reviewed by our system and abuse response team. This API is only available to authorized accounts. Contact abuse@ngrok.com to request access

@param [List<uri (string)>] urls a list of URLs containing suspected abusive content @param [string] metadata arbitrary user-defined data about this abuse report. Optional, max 4096 bytes. @return [NgrokAPI::Models::AbuseReport] result from the API request

ngrok.com/docs/api#api-abuse-reports-create

# File lib/ngrokapi/services/abuse_reports_client.rb, line 30
def create(urls:, metadata: "")
  path = '/abuse_reports'
  replacements = {
  }
  data = {}
  data[:urls] = urls if urls
  data[:metadata] = metadata if metadata
  result = @client.post(path % replacements, data: data)
  NgrokAPI::Models::AbuseReport.new(client: self, attrs: result)
end
create!(urls:, metadata: "") click to toggle source

Creates a new abuse report which will be reviewed by our system and abuse response team. This API is only available to authorized accounts. Contact abuse@ngrok.com to request access Throws an exception if API error.

@param [List<uri (string)>] urls a list of URLs containing suspected abusive content @param [string] metadata arbitrary user-defined data about this abuse report. Optional, max 4096 bytes. @return [NgrokAPI::Models::AbuseReport] result from the API request

ngrok.com/docs/api#api-abuse-reports-create

# File lib/ngrokapi/services/abuse_reports_client.rb, line 52
def create!(urls:, metadata: "")
  path = '/abuse_reports'
  replacements = {
  }
  data = {}
  data[:urls] = urls if urls
  data[:metadata] = metadata if metadata
  result = @client.post(path % replacements, data: data, danger: true)
  NgrokAPI::Models::AbuseReport.new(client: self, attrs: result)
end
get(id: "") click to toggle source

Get the detailed status of abuse report by ID.

@param [string] id a resource identifier @return [NgrokAPI::Models::AbuseReport] result from the API request

ngrok.com/docs/api#api-abuse-reports-get

# File lib/ngrokapi/services/abuse_reports_client.rb, line 70
def get(id: "")
  path = '/abuse_reports/%{id}'
  replacements = {
    id: id,
  }
  data = {}
  result = @client.get(path % replacements, data: data)
  NgrokAPI::Models::AbuseReport.new(client: self, attrs: result)
end
get!(id: "") click to toggle source

Get the detailed status of abuse report by ID. Throws an exception if API error.

@param [string] id a resource identifier @return [NgrokAPI::Models::AbuseReport] result from the API request

ngrok.com/docs/api#api-abuse-reports-get

# File lib/ngrokapi/services/abuse_reports_client.rb, line 88
def get!(id: "")
  path = '/abuse_reports/%{id}'
  replacements = {
    id: id,
  }
  data = {}
  result = @client.get(path % replacements, data: data, danger: true)
  NgrokAPI::Models::AbuseReport.new(client: self, attrs: result)
end