Class: Hook0::Generated::ResponseApi

Inherits:
Object
  • Object
show all
Defined in:
lib/hook0/generated/api.rb

Overview

What the API declares under response, issued through the transport it is handed.

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ ResponseApi

Returns a new instance of ResponseApi.

Parameters:

  • transport (Object)

    what one request is issued through



786
787
788
# File 'lib/hook0/generated/api.rb', line 786

def initialize(transport)
  @transport = transport
end

Instance Method Details

#get(response_id, application_id) ⇒ Response

Get a response by its ID

Parameters:

  • response_id (String)

    carries response_id.

  • application_id (String)

    carries application_id.

Returns:



795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
# File 'lib/hook0/generated/api.rb', line 795

def get(response_id, application_id)
  read_answer(
    @transport.request(
      "GET",
      Runtime.path(
        "/api/v1/responses/{response_id}",
        "response_id" => response_id
      ),
      Runtime.query(
        [
          ["application_id", application_id]
        ],
        []
      ),
      nil
    ),
    Response.method(:from_json)
  )
end