Class: Retab::ApiCallInvocation

Inherits:
Types::BaseModel show all
Defined in:
lib/retab/workflow_artifacts/api_call_invocation.rb

Constant Summary collapse

HASH_ATTRS =
{
  operation: :operation,
  id: :id,
  workflow_run_id: :workflow_run_id,
  step_id: :step_id,
  attempts: :attempts,
  error: :error,
  created_at: :created_at
}.freeze

Instance Attribute Summary collapse

Attributes inherited from Types::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Types::BaseModel

#inspect, normalize, #to_h, #to_json

Constructor Details

#initialize(json) ⇒ ApiCallInvocation

Returns a new instance of ApiCallInvocation.



27
28
29
30
31
32
33
34
35
36
# File 'lib/retab/workflow_artifacts/api_call_invocation.rb', line 27

def initialize(json)
  hash = self.class.normalize(json)
  @operation = hash[:operation]
  @id = hash[:id]
  @workflow_run_id = hash[:workflow_run_id]
  @step_id = hash[:step_id]
  @attempts = (hash[:attempts] || []).map { |item| item ? Retab::ApiCallAttempt.new(item) : nil }
  @error = hash[:error] ? Retab::ErrorDetails.new(hash[:error]) : nil
  @created_at = hash[:created_at]
end

Instance Attribute Details

#attemptsObject

Returns the value of attribute attempts.



18
19
20
# File 'lib/retab/workflow_artifacts/api_call_invocation.rb', line 18

def attempts
  @attempts
end

#created_atObject

Returns the value of attribute created_at.



18
19
20
# File 'lib/retab/workflow_artifacts/api_call_invocation.rb', line 18

def created_at
  @created_at
end

#errorObject

Returns the value of attribute error.



18
19
20
# File 'lib/retab/workflow_artifacts/api_call_invocation.rb', line 18

def error
  @error
end

#idObject

Returns the value of attribute id.



18
19
20
# File 'lib/retab/workflow_artifacts/api_call_invocation.rb', line 18

def id
  @id
end

#operationObject

Returns the value of attribute operation.



18
19
20
# File 'lib/retab/workflow_artifacts/api_call_invocation.rb', line 18

def operation
  @operation
end

#step_idObject

Returns the value of attribute step_id.



18
19
20
# File 'lib/retab/workflow_artifacts/api_call_invocation.rb', line 18

def step_id
  @step_id
end

#workflow_run_idObject

Returns the value of attribute workflow_run_id.



18
19
20
# File 'lib/retab/workflow_artifacts/api_call_invocation.rb', line 18

def workflow_run_id
  @workflow_run_id
end