Class: Retab::CancelWorkflowExperimentRunResponse

Inherits:
Types::BaseModel show all
Defined in:
lib/retab/experiment_runs/cancel_workflow_experiment_run_response.rb

Constant Summary collapse

HASH_ATTRS =
{
  id: :id,
  lifecycle: :lifecycle
}.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) ⇒ CancelWorkflowExperimentRunResponse

Returns a new instance of CancelWorkflowExperimentRunResponse.



17
18
19
20
21
# File 'lib/retab/experiment_runs/cancel_workflow_experiment_run_response.rb', line 17

def initialize(json)
  hash = self.class.normalize(json)
  @id = hash[:id]
  @lifecycle = hash[:lifecycle] ? (case hash[:lifecycle][:status] when "cancelled" then Retab::CancelledWorkflowExperimentRun.new(hash[:lifecycle]) when "completed" then Retab::CompletedWorkflowExperimentRun.new(hash[:lifecycle]) when "error" then Retab::ErrorWorkflowExperimentRun.new(hash[:lifecycle]) when "pending" then Retab::PendingWorkflowExperimentRun.new(hash[:lifecycle]) when "queued" then Retab::QueuedWorkflowExperimentRun.new(hash[:lifecycle]) when "running" then Retab::RunningWorkflowExperimentRun.new(hash[:lifecycle]) else hash[:lifecycle] end) : nil
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



13
14
15
# File 'lib/retab/experiment_runs/cancel_workflow_experiment_run_response.rb', line 13

def id
  @id
end

#lifecycleObject

Returns the value of attribute lifecycle.



13
14
15
# File 'lib/retab/experiment_runs/cancel_workflow_experiment_run_response.rb', line 13

def lifecycle
  @lifecycle
end