Class: Retab::DeclarativeApplyResponse

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

Constant Summary collapse

HASH_ATTRS =
{
  workflow_id: :workflow_id,
  action: :action,
  created: :created,
  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) ⇒ DeclarativeApplyResponse

Returns a new instance of DeclarativeApplyResponse.



33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/retab/workflow_specs/declarative_apply_response.rb', line 33

def initialize(json)
  hash = self.class.normalize(json)
  @workflow_id = hash[:workflow_id]
  @action = hash[:action]
  @created = hash[:created]
  @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.



21
22
23
# File 'lib/retab/workflow_specs/declarative_apply_response.rb', line 21

def action
  @action
end

#block_countObject

Returns the value of attribute block_count.



21
22
23
# File 'lib/retab/workflow_specs/declarative_apply_response.rb', line 21

def block_count
  @block_count
end

#createdObject

Returns the value of attribute created.



21
22
23
# File 'lib/retab/workflow_specs/declarative_apply_response.rb', line 21

def created
  @created
end

#diagnosticsObject

Returns the value of attribute diagnostics.



21
22
23
# File 'lib/retab/workflow_specs/declarative_apply_response.rb', line 21

def diagnostics
  @diagnostics
end

#edge_countObject

Returns the value of attribute edge_count.



21
22
23
# File 'lib/retab/workflow_specs/declarative_apply_response.rb', line 21

def edge_count
  @edge_count
end

#format_versionObject

Returns the value of attribute format_version.



21
22
23
# File 'lib/retab/workflow_specs/declarative_apply_response.rb', line 21

def format_version
  @format_version
end

#rendered_planObject

Returns the value of attribute rendered_plan.



21
22
23
# File 'lib/retab/workflow_specs/declarative_apply_response.rb', line 21

def rendered_plan
  @rendered_plan
end

#resource_changesObject

Returns the value of attribute resource_changes.



21
22
23
# File 'lib/retab/workflow_specs/declarative_apply_response.rb', line 21

def resource_changes
  @resource_changes
end

#summaryObject

Returns the value of attribute summary.



21
22
23
# File 'lib/retab/workflow_specs/declarative_apply_response.rb', line 21

def summary
  @summary
end

#workflow_idObject

Returns the value of attribute workflow_id.



21
22
23
# File 'lib/retab/workflow_specs/declarative_apply_response.rb', line 21

def workflow_id
  @workflow_id
end