Class: UpGuard::EventAction

Inherits:
BaseObject show all
Defined in:
lib/upguard/EventAction.rb

Instance Attribute Summary collapse

Attributes inherited from BaseObject

#appliance_api_key, #appliance_url, #insecure, #sec_key

Instance Method Summary collapse

Methods inherited from BaseObject

#http_delete, #http_get, #http_post, #http_put, #make_headers

Constructor Details

#initialize(appliance_url, appliance_api_key, sec_key, insecure = false) ⇒ EventAction

Returns a new instance of EventAction.



9
10
11
12
13
14
15
16
17
# File 'lib/upguard/EventAction.rb', line 9

def initialize(appliance_url, appliance_api_key, sec_key, insecure = false)
  super(appliance_url, appliance_api_key, sec_key, insecure)
  self.id = nil
  self.name = nil
  self.status = nil
  self.type = nil
  self.variables = nil
  self.view = nil
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/upguard/EventAction.rb', line 3

def id
  @id
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/upguard/EventAction.rb', line 4

def name
  @name
end

#statusObject

Returns the value of attribute status.



5
6
7
# File 'lib/upguard/EventAction.rb', line 5

def status
  @status
end

#typeObject

Returns the value of attribute type.



6
7
8
# File 'lib/upguard/EventAction.rb', line 6

def type
  @type
end

#variablesObject

Returns the value of attribute variables.



7
8
9
# File 'lib/upguard/EventAction.rb', line 7

def variables
  @variables
end

#viewObject

Returns the value of attribute view.



8
9
10
# File 'lib/upguard/EventAction.rb', line 8

def view
  @view
end

Instance Method Details

#from_hash(h) ⇒ Object



19
20
21
22
23
24
25
26
# File 'lib/upguard/EventAction.rb', line 19

def from_hash(h)
  self.id = h['id'] if h.include?('id')
  self.name = h['name'] if h.include?('name')
  self.status = h['status'] if h.include?('status')
  self.type = h['type'] if h.include?('type')
  self.variables = h['variables'] if h.include?('variables')
  self.view = h['view'] if h.include?('view')
end

#to_hashObject



27
28
29
30
31
32
33
34
35
36
# File 'lib/upguard/EventAction.rb', line 27

def to_hash
  h = {}
  h['id'] = self.id
  h['name'] = self.name
  h['status'] = self.status
  h['type'] = self.type
  h['variables'] = self.variables
  h['view'] = self.view
  return h
end

#to_json(options = nil) ⇒ Object



37
38
39
40
# File 'lib/upguard/EventAction.rb', line 37

def to_json(options = nil)
  h = to_hash
  return h.to_json(options)
end