Class: Retab::ApiCallAttempt
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Retab::ApiCallAttempt
- Defined in:
- lib/retab/workflow_artifacts/api_call_attempt.rb
Constant Summary collapse
- HASH_ATTRS =
{ attempt_number: :attempt_number, request_method: :request_method, request_url: :request_url, request_headers: :request_headers, request_body: :request_body, response_status: :response_status, response_headers: :response_headers, response_body: :response_body, duration_ms: :duration_ms, error: :error, started_at: :started_at, completed_at: :completed_at }.freeze
Instance Attribute Summary collapse
-
#attempt_number ⇒ Object
Returns the value of attribute attempt_number.
-
#completed_at ⇒ Object
Returns the value of attribute completed_at.
-
#duration_ms ⇒ Object
Returns the value of attribute duration_ms.
-
#error ⇒ Object
Returns the value of attribute error.
-
#request_body ⇒ Object
Returns the value of attribute request_body.
-
#request_headers ⇒ Object
Returns the value of attribute request_headers.
-
#request_method ⇒ Object
Returns the value of attribute request_method.
-
#request_url ⇒ Object
Returns the value of attribute request_url.
-
#response_body ⇒ Object
Returns the value of attribute response_body.
-
#response_headers ⇒ Object
Returns the value of attribute response_headers.
-
#response_status ⇒ Object
Returns the value of attribute response_status.
-
#started_at ⇒ Object
Returns the value of attribute started_at.
Attributes inherited from Types::BaseModel
Instance Method Summary collapse
-
#initialize(json) ⇒ ApiCallAttempt
constructor
A new instance of ApiCallAttempt.
Methods inherited from Types::BaseModel
#inspect, normalize, #to_h, #to_json
Constructor Details
#initialize(json) ⇒ ApiCallAttempt
Returns a new instance of ApiCallAttempt.
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/retab/workflow_artifacts/api_call_attempt.rb', line 37 def initialize(json) hash = self.class.normalize(json) @attempt_number = hash[:attempt_number] @request_method = hash[:request_method] @request_url = hash[:request_url] @request_headers = hash[:request_headers] || {} @request_body = hash[:request_body] @response_status = hash[:response_status] @response_headers = hash[:response_headers] || {} @response_body = hash[:response_body] @duration_ms = hash[:duration_ms] @error = hash[:error] ? Retab::ErrorDetails.new(hash[:error]) : nil @started_at = hash[:started_at] @completed_at = hash[:completed_at] end |
Instance Attribute Details
#attempt_number ⇒ Object
Returns the value of attribute attempt_number.
23 24 25 |
# File 'lib/retab/workflow_artifacts/api_call_attempt.rb', line 23 def attempt_number @attempt_number end |
#completed_at ⇒ Object
Returns the value of attribute completed_at.
23 24 25 |
# File 'lib/retab/workflow_artifacts/api_call_attempt.rb', line 23 def completed_at @completed_at end |
#duration_ms ⇒ Object
Returns the value of attribute duration_ms.
23 24 25 |
# File 'lib/retab/workflow_artifacts/api_call_attempt.rb', line 23 def duration_ms @duration_ms end |
#error ⇒ Object
Returns the value of attribute error.
23 24 25 |
# File 'lib/retab/workflow_artifacts/api_call_attempt.rb', line 23 def error @error end |
#request_body ⇒ Object
Returns the value of attribute request_body.
23 24 25 |
# File 'lib/retab/workflow_artifacts/api_call_attempt.rb', line 23 def request_body @request_body end |
#request_headers ⇒ Object
Returns the value of attribute request_headers.
23 24 25 |
# File 'lib/retab/workflow_artifacts/api_call_attempt.rb', line 23 def request_headers @request_headers end |
#request_method ⇒ Object
Returns the value of attribute request_method.
23 24 25 |
# File 'lib/retab/workflow_artifacts/api_call_attempt.rb', line 23 def request_method @request_method end |
#request_url ⇒ Object
Returns the value of attribute request_url.
23 24 25 |
# File 'lib/retab/workflow_artifacts/api_call_attempt.rb', line 23 def request_url @request_url end |
#response_body ⇒ Object
Returns the value of attribute response_body.
23 24 25 |
# File 'lib/retab/workflow_artifacts/api_call_attempt.rb', line 23 def response_body @response_body end |
#response_headers ⇒ Object
Returns the value of attribute response_headers.
23 24 25 |
# File 'lib/retab/workflow_artifacts/api_call_attempt.rb', line 23 def response_headers @response_headers end |
#response_status ⇒ Object
Returns the value of attribute response_status.
23 24 25 |
# File 'lib/retab/workflow_artifacts/api_call_attempt.rb', line 23 def response_status @response_status end |
#started_at ⇒ Object
Returns the value of attribute started_at.
23 24 25 |
# File 'lib/retab/workflow_artifacts/api_call_attempt.rb', line 23 def started_at @started_at end |