Class: Retab::FunctionInvocation

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

Constant Summary collapse

HASH_ATTRS =
{
  operation: :operation,
  id: :id,
  workflow_run_id: :workflow_run_id,
  step_id: :step_id,
  inputs: :inputs,
  output: :output,
  duration_ms: :duration_ms,
  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) ⇒ FunctionInvocation

Returns a new instance of FunctionInvocation.



31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/retab/workflow_artifacts/function_invocation.rb', line 31

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]
  @inputs = hash[:inputs] || {}
  @output = hash[:output]
  @duration_ms = hash[:duration_ms]
  @error = hash[:error] ? Retab::ErrorDetails.new(hash[:error]) : nil
  @created_at = hash[:created_at]
end

Instance Attribute Details

#created_atObject

Returns the value of attribute created_at.



20
21
22
# File 'lib/retab/workflow_artifacts/function_invocation.rb', line 20

def created_at
  @created_at
end

#duration_msObject

Returns the value of attribute duration_ms.



20
21
22
# File 'lib/retab/workflow_artifacts/function_invocation.rb', line 20

def duration_ms
  @duration_ms
end

#errorObject

Returns the value of attribute error.



20
21
22
# File 'lib/retab/workflow_artifacts/function_invocation.rb', line 20

def error
  @error
end

#idObject

Returns the value of attribute id.



20
21
22
# File 'lib/retab/workflow_artifacts/function_invocation.rb', line 20

def id
  @id
end

#inputsObject

Returns the value of attribute inputs.



20
21
22
# File 'lib/retab/workflow_artifacts/function_invocation.rb', line 20

def inputs
  @inputs
end

#operationObject

Returns the value of attribute operation.



20
21
22
# File 'lib/retab/workflow_artifacts/function_invocation.rb', line 20

def operation
  @operation
end

#outputObject

Returns the value of attribute output.



20
21
22
# File 'lib/retab/workflow_artifacts/function_invocation.rb', line 20

def output
  @output
end

#step_idObject

Returns the value of attribute step_id.



20
21
22
# File 'lib/retab/workflow_artifacts/function_invocation.rb', line 20

def step_id
  @step_id
end

#workflow_run_idObject

Returns the value of attribute workflow_run_id.



20
21
22
# File 'lib/retab/workflow_artifacts/function_invocation.rb', line 20

def workflow_run_id
  @workflow_run_id
end