Class: Hawkular::Alerts::Trigger::Action

Inherits:
Object
  • Object
show all
Defined in:
lib/hawkular/alerts/alerts_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(action_hash) ⇒ Action

Returns a new instance of Action



558
559
560
561
562
563
564
565
# File 'lib/hawkular/alerts/alerts_api.rb', line 558

def initialize(action_hash)
  return if action_hash.nil?

  @action_plugin = action_hash['actionPlugin']
  @action_id = action_hash['actionId']
  @tenant_id = action_hash['tenantId']
  @states = action_hash['states']
end

Instance Attribute Details

#action_idObject

Returns the value of attribute action_id



556
557
558
# File 'lib/hawkular/alerts/alerts_api.rb', line 556

def action_id
  @action_id
end

#action_pluginObject

Returns the value of attribute action_plugin



556
557
558
# File 'lib/hawkular/alerts/alerts_api.rb', line 556

def action_plugin
  @action_plugin
end

#statesObject

Returns the value of attribute states



556
557
558
# File 'lib/hawkular/alerts/alerts_api.rb', line 556

def states
  @states
end

#tenant_idObject

Returns the value of attribute tenant_id



556
557
558
# File 'lib/hawkular/alerts/alerts_api.rb', line 556

def tenant_id
  @tenant_id
end

Instance Method Details

#to_hObject



567
568
569
570
571
572
573
574
# File 'lib/hawkular/alerts/alerts_api.rb', line 567

def to_h
  action_hash = {}
  action_hash['actionPlugin'] = @action_plugin
  action_hash['actionId'] = @action_id
  action_hash['tenantId'] = @tenant_id
  action_hash['states'] = @states
  action_hash
end