Class: Pangea::Models::PangeaResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/pangea/models/pangea_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response_data:, model:) ⇒ PangeaResponse

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of PangeaResponse.

Parameters:

  • response_data (Hash{Symbol=>Object})


57
58
59
60
61
62
63
64
# File 'lib/pangea/models/pangea_response.rb', line 57

def initialize(response_data:, model:)
  @request_id = response_data[:request_id]
  @request_time = response_data[:request_time]
  @response_time = response_data[:response_time]
  @status = response_data[:status]
  @summary = response_data[:summary]
  @result = Pangea::Internal::Type::Converter.coerce(model, response_data[:result])
end

Instance Attribute Details

#request_idString

A unique identifier assigned to each request made to the API. It is used to track and identify a specific request and its associated data. The ‘request_id` can be helpful for troubleshooting, auditing, and tracing the flow of requests within the system. It allows users to reference and retrieve information related to a particular request, such as the response, parameters, and raw data associated with that specific request.

Returns:

  • (String)


16
17
18
# File 'lib/pangea/models/pangea_response.rb', line 16

def request_id
  @request_id
end

#request_timeString

The timestamp indicates the exact moment when a request is made to the API. It represents the date and time at which the request was initiated by the client. The ‘request_time` is useful for tracking and analyzing the timing of requests, measuring response times, and monitoring performance metrics. It allows users to determine the duration between the request initiation and the corresponding response, aiding in the assessment of API performance and latency.

Returns:

  • (String)


27
28
29
# File 'lib/pangea/models/pangea_response.rb', line 27

def request_time
  @request_time
end

#response_timeString

Duration it takes for the API to process a request and generate a response. It represents the elapsed time from when the request is received by the API to when the corresponding response is returned to the client.

Returns:

  • (String)


35
36
37
# File 'lib/pangea/models/pangea_response.rb', line 35

def response_time
  @response_time
end

#resultgeneric<Result> | nil

Returns:

  • (generic<Result> | nil)


52
53
54
# File 'lib/pangea/models/pangea_response.rb', line 52

def result
  @result
end

#statusString

It represents the status or outcome of the API request made for IP information. It indicates the current state or condition of the request and provides information on the success or failure of the request.

Returns:

  • (String)


42
43
44
# File 'lib/pangea/models/pangea_response.rb', line 42

def status
  @status
end

#summaryString

Provides a concise and brief overview of the purpose or primary objective of the API endpoint. It serves as a high-level summary or description of the functionality or feature offered by the endpoint.

Returns:

  • (String)


49
50
51
# File 'lib/pangea/models/pangea_response.rb', line 49

def summary
  @summary
end