Class: Retab::CreateWorkflowTestRunRequest

Inherits:
Types::BaseModel show all
Defined in:
lib/retab/workflow_test_runs/create_workflow_test_run_request.rb

Constant Summary collapse

HASH_ATTRS =
{
  workflow_id: :workflow_id,
  scope: :scope
}.freeze

Instance Attribute Summary collapse

Attributes inherited from Types::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Types::BaseModel

deep_symbolize, #inspect, normalize, #to_h, #to_json

Constructor Details

#initialize(json) ⇒ CreateWorkflowTestRunRequest

Returns a new instance of CreateWorkflowTestRunRequest.



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/retab/workflow_test_runs/create_workflow_test_run_request.rb', line 18

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @workflow_id = hash[:workflow_id]
  @scope = hash[:scope] ? (
    case hash[:scope][:type]
    when "block"
      Retab::WorkflowTestRunBlockScope.new(hash[:scope])
    when "single"
      Retab::WorkflowTestRunSingleScope.new(hash[:scope])
    when "workflow"
      Retab::WorkflowTestRunWorkflowScope.new(hash[:scope])
    else
      hash[:scope]
    end
  ) : nil
end

Instance Attribute Details

#scopeObject

Returns the value of attribute scope.



13
14
15
# File 'lib/retab/workflow_test_runs/create_workflow_test_run_request.rb', line 13

def scope
  @scope
end

#workflow_idObject

Returns the value of attribute workflow_id.



13
14
15
# File 'lib/retab/workflow_test_runs/create_workflow_test_run_request.rb', line 13

def workflow_id
  @workflow_id
end