Class: Retab::DeclarativePlanResponse

Inherits:
Types::BaseModel show all
Defined in:
lib/retab/workflow_specs/declarative_plan_response.rb

Constant Summary collapse

HASH_ATTRS =
{
  workflow_id: :workflow_id,
  action: :action,
  block_count: :block_count,
  edge_count: :edge_count,
  diagnostics: :diagnostics,
  format_version: :format_version,
  summary: :summary,
  resource_changes: :resource_changes,
  rendered_plan: :rendered_plan
}.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) ⇒ DeclarativePlanResponse

Returns a new instance of DeclarativePlanResponse.



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

def initialize(json)
  hash = self.class.normalize(json)
  @workflow_id = hash[:workflow_id]
  @action = hash[:action]
  @block_count = hash[:block_count]
  @edge_count = hash[:edge_count]
  @diagnostics = hash[:diagnostics] || {}
  @format_version = hash[:format_version]
  @summary = hash[:summary] ? Retab::DeclarativePlanSummary.new(hash[:summary]) : nil
  @resource_changes = (hash[:resource_changes] || []).map { |item| item ? Retab::DeclarativePlanResourceChange.new(item) : nil }
  @rendered_plan = hash[:rendered_plan]
end

Instance Attribute Details

#actionObject

Returns the value of attribute action.



20
21
22
# File 'lib/retab/workflow_specs/declarative_plan_response.rb', line 20

def action
  @action
end

#block_countObject

Returns the value of attribute block_count.



20
21
22
# File 'lib/retab/workflow_specs/declarative_plan_response.rb', line 20

def block_count
  @block_count
end

#diagnosticsObject

Returns the value of attribute diagnostics.



20
21
22
# File 'lib/retab/workflow_specs/declarative_plan_response.rb', line 20

def diagnostics
  @diagnostics
end

#edge_countObject

Returns the value of attribute edge_count.



20
21
22
# File 'lib/retab/workflow_specs/declarative_plan_response.rb', line 20

def edge_count
  @edge_count
end

#format_versionObject

Returns the value of attribute format_version.



20
21
22
# File 'lib/retab/workflow_specs/declarative_plan_response.rb', line 20

def format_version
  @format_version
end

#rendered_planObject

Returns the value of attribute rendered_plan.



20
21
22
# File 'lib/retab/workflow_specs/declarative_plan_response.rb', line 20

def rendered_plan
  @rendered_plan
end

#resource_changesObject

Returns the value of attribute resource_changes.



20
21
22
# File 'lib/retab/workflow_specs/declarative_plan_response.rb', line 20

def resource_changes
  @resource_changes
end

#summaryObject

Returns the value of attribute summary.



20
21
22
# File 'lib/retab/workflow_specs/declarative_plan_response.rb', line 20

def summary
  @summary
end

#workflow_idObject

Returns the value of attribute workflow_id.



20
21
22
# File 'lib/retab/workflow_specs/declarative_plan_response.rb', line 20

def workflow_id
  @workflow_id
end