class NgrokAPI::Services::HTTPResponseBackendsClient

ngrok.com/docs/api#api-http-response-backends

Constants

LIST_PROPERTY

The List Property from the resulting API for list calls

PATH

The API path for the requests

Attributes

client[R]

Public Class Methods

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

Public Instance Methods

create(description: "", metadata: "", body: "", headers: {}, status_code: nil) click to toggle source

@param [string] description human-readable description of this backend. Optional @param [string] metadata arbitrary user-defined machine-readable data of this backend. Optional @param [string] body body to return as fixed content @param [Map<string, string>] headers headers to return @param [int32] status_code status code to return @return [NgrokAPI::Models::HTTPResponseBackend] result from the API request

ngrok.com/docs/api#api-http-response-backends-create

# File lib/ngrokapi/services/http_response_backends_client.rb, line 28
def create(description: "", metadata: "", body: "", headers: {}, status_code: nil)
  path = '/backends/http_response'
  replacements = {
  }
  data = {}
  data[:description] = description if description
  data[:metadata] = metadata if metadata
  data[:body] = body if body
  data[:headers] = headers if headers
  data[:status_code] = status_code if status_code
  result = @client.post(path % replacements, data: data)
  NgrokAPI::Models::HTTPResponseBackend.new(client: self, attrs: result)
end
create!(description: "", metadata: "", body: "", headers: {}, status_code: nil) click to toggle source

@param [string] description human-readable description of this backend. Optional @param [string] metadata arbitrary user-defined machine-readable data of this backend. Optional @param [string] body body to return as fixed content @param [Map<string, string>] headers headers to return @param [int32] status_code status code to return @return [NgrokAPI::Models::HTTPResponseBackend] result from the API request

ngrok.com/docs/api#api-http-response-backends-create

# File lib/ngrokapi/services/http_response_backends_client.rb, line 51
def create!(description: "", metadata: "", body: "", headers: {}, status_code: nil)
  path = '/backends/http_response'
  replacements = {
  }
  data = {}
  data[:description] = description if description
  data[:metadata] = metadata if metadata
  data[:body] = body if body
  data[:headers] = headers if headers
  data[:status_code] = status_code if status_code
  result = @client.post(path % replacements, data: data, danger: true)
  NgrokAPI::Models::HTTPResponseBackend.new(client: self, attrs: result)
end
delete(id: "") click to toggle source

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

ngrok.com/docs/api#api-http-response-backends-delete

# File lib/ngrokapi/services/http_response_backends_client.rb, line 70
def delete(id: "")
  path = '/backends/http_response/%{id}'
  replacements = {
    id: id,
  }
  @client.delete(path % replacements)
end
delete!(id: "") click to toggle source

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

ngrok.com/docs/api#api-http-response-backends-delete

# File lib/ngrokapi/services/http_response_backends_client.rb, line 83
def delete!(id: "")
  path = '/backends/http_response/%{id}'
  replacements = {
    id: id,
  }
  @client.delete(path % replacements, danger: true)
end
get(id: "") click to toggle source

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

ngrok.com/docs/api#api-http-response-backends-get

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

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

ngrok.com/docs/api#api-http-response-backends-get

# File lib/ngrokapi/services/http_response_backends_client.rb, line 111
def get!(id: "")
  path = '/backends/http_response/%{id}'
  replacements = {
    id: id,
  }
  data = {}
  result = @client.get(path % replacements, data: data, danger: true)
  NgrokAPI::Models::HTTPResponseBackend.new(client: self, attrs: result)
end
list(before_id: nil, limit: nil, url: nil) click to toggle source

@param [string] before_id @param [string] limit @param [string] url optional and mutually exclusive from before_id and limit @return [NgrokAPI::Models::Listable] result from the API request

ngrok.com/docs/api#api-http-response-backends-list

# File lib/ngrokapi/services/http_response_backends_client.rb, line 128
def list(before_id: nil, limit: nil, url: nil)
  result = @client.list(
    before_id: before_id,
    limit: limit,
    url: url,
    path: PATH
  )

  NgrokAPI::Models::Listable.new(
    client: self,
    attrs: result,
    list_property: LIST_PROPERTY,
    klass: NgrokAPI::Models::HTTPResponseBackend
  )
end
list!(before_id: nil, limit: nil, url: nil) click to toggle source

@param [string] before_id @param [string] limit @param [string] url optional and mutually exclusive from before_id and limit @return [NgrokAPI::Models::Listable] result from the API request

ngrok.com/docs/api#api-http-response-backends-list

# File lib/ngrokapi/services/http_response_backends_client.rb, line 151
def list!(before_id: nil, limit: nil, url: nil)
  result = @client.list(
    before_id: before_id,
    limit: limit,
    danger: true,
    url: url,
    path: PATH
  )

  NgrokAPI::Models::Listable.new(
    client: self,
    attrs: result,
    list_property: LIST_PROPERTY,
    klass: NgrokAPI::Models::HTTPResponseBackend,
    danger: true
  )
end
update(id: "", description: nil, metadata: nil, body: nil, headers: nil, status_code: nil) click to toggle source

@param [string] id @param [string] description human-readable description of this backend. Optional @param [string] metadata arbitrary user-defined machine-readable data of this backend. Optional @param [string] body body to return as fixed content @param [Map<string, string>] headers headers to return @param [int32] status_code status code to return @return [NgrokAPI::Models::HTTPResponseBackend] result from the API request

ngrok.com/docs/api#api-http-response-backends-update

# File lib/ngrokapi/services/http_response_backends_client.rb, line 179
def update(id: "", description: nil, metadata: nil, body: nil, headers: nil, status_code: nil)
  path = '/backends/http_response/%{id}'
  replacements = {
    id: id,
  }
  data = {}
  data[:description] = description if description
  data[:metadata] = metadata if metadata
  data[:body] = body if body
  data[:headers] = headers if headers
  data[:status_code] = status_code if status_code
  result = @client.patch(path % replacements, data: data)
  NgrokAPI::Models::HTTPResponseBackend.new(client: self, attrs: result)
end
update!(id: "", description: nil, metadata: nil, body: nil, headers: nil, status_code: nil) click to toggle source

@param [string] id @param [string] description human-readable description of this backend. Optional @param [string] metadata arbitrary user-defined machine-readable data of this backend. Optional @param [string] body body to return as fixed content @param [Map<string, string>] headers headers to return @param [int32] status_code status code to return @return [NgrokAPI::Models::HTTPResponseBackend] result from the API request

ngrok.com/docs/api#api-http-response-backends-update

# File lib/ngrokapi/services/http_response_backends_client.rb, line 204
def update!(id: "", description: nil, metadata: nil, body: nil, headers: nil, status_code: nil)
  path = '/backends/http_response/%{id}'
  replacements = {
    id: id,
  }
  data = {}
  data[:description] = description if description
  data[:metadata] = metadata if metadata
  data[:body] = body if body
  data[:headers] = headers if headers
  data[:status_code] = status_code if status_code
  result = @client.patch(path % replacements, data: data, danger: true)
  NgrokAPI::Models::HTTPResponseBackend.new(client: self, attrs: result)
end