Class: Verizon::GetTriggerResponse

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/verizon/models/get_trigger_response.rb

Overview

GetTriggerResponse Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(account_name = SKIP, comparator = SKIP, created_at = SKIP, group_name = SKIP, modified_at = SKIP, notification_group_name = SKIP, organization_name = SKIP, sms_type = SKIP, threshold = SKIP, threshold_unit = SKIP, trigger_category = SKIP, trigger_cycle = SKIP, trigger_id = SKIP, trigger_name = SKIP) ⇒ GetTriggerResponse

Returns a new instance of GetTriggerResponse.



114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# File 'lib/verizon/models/get_trigger_response.rb', line 114

def initialize( = SKIP, comparator = SKIP, created_at = SKIP,
               group_name = SKIP, modified_at = SKIP,
               notification_group_name = SKIP, organization_name = SKIP,
               sms_type = SKIP, threshold = SKIP, threshold_unit = SKIP,
               trigger_category = SKIP, trigger_cycle = SKIP,
               trigger_id = SKIP, trigger_name = SKIP)
  @account_name =  unless  == SKIP
  @comparator = comparator unless comparator == SKIP
  @created_at = created_at unless created_at == SKIP
  @group_name = group_name unless group_name == SKIP
  @modified_at = modified_at unless modified_at == SKIP
  @notification_group_name = notification_group_name unless notification_group_name == SKIP
  @organization_name = organization_name unless organization_name == SKIP
  @sms_type = sms_type unless sms_type == SKIP
  @threshold = threshold unless threshold == SKIP
  @threshold_unit = threshold_unit unless threshold_unit == SKIP
  @trigger_category = trigger_category unless trigger_category == SKIP
  @trigger_cycle = trigger_cycle unless trigger_cycle == SKIP
  @trigger_id = trigger_id unless trigger_id == SKIP
  @trigger_name = trigger_name unless trigger_name == SKIP
end

Instance Attribute Details

#account_nameString

TODO: Write general description for this method

Returns:

  • (String)


15
16
17
# File 'lib/verizon/models/get_trigger_response.rb', line 15

def 
  @account_name
end

#comparatorString

TODO: Write general description for this method

Returns:

  • (String)


19
20
21
# File 'lib/verizon/models/get_trigger_response.rb', line 19

def comparator
  @comparator
end

#created_atDateTime

TODO: Write general description for this method

Returns:

  • (DateTime)


23
24
25
# File 'lib/verizon/models/get_trigger_response.rb', line 23

def created_at
  @created_at
end

#group_nameString

TODO: Write general description for this method

Returns:

  • (String)


27
28
29
# File 'lib/verizon/models/get_trigger_response.rb', line 27

def group_name
  @group_name
end

#modified_atDateTime

TODO: Write general description for this method

Returns:

  • (DateTime)


31
32
33
# File 'lib/verizon/models/get_trigger_response.rb', line 31

def modified_at
  @modified_at
end

#notification_group_nameString

TODO: Write general description for this method

Returns:

  • (String)


35
36
37
# File 'lib/verizon/models/get_trigger_response.rb', line 35

def notification_group_name
  @notification_group_name
end

#organization_nameString

TODO: Write general description for this method

Returns:

  • (String)


39
40
41
# File 'lib/verizon/models/get_trigger_response.rb', line 39

def organization_name
  @organization_name
end

#sms_typeString

TODO: Write general description for this method

Returns:

  • (String)


43
44
45
# File 'lib/verizon/models/get_trigger_response.rb', line 43

def sms_type
  @sms_type
end

#thresholdString

TODO: Write general description for this method

Returns:

  • (String)


47
48
49
# File 'lib/verizon/models/get_trigger_response.rb', line 47

def threshold
  @threshold
end

#threshold_unitString

TODO: Write general description for this method

Returns:

  • (String)


51
52
53
# File 'lib/verizon/models/get_trigger_response.rb', line 51

def threshold_unit
  @threshold_unit
end

#trigger_categoryString

TODO: Write general description for this method

Returns:

  • (String)


55
56
57
# File 'lib/verizon/models/get_trigger_response.rb', line 55

def trigger_category
  @trigger_category
end

#trigger_cycleString

TODO: Write general description for this method

Returns:

  • (String)


59
60
61
# File 'lib/verizon/models/get_trigger_response.rb', line 59

def trigger_cycle
  @trigger_cycle
end

#trigger_idString

TODO: Write general description for this method

Returns:

  • (String)


63
64
65
# File 'lib/verizon/models/get_trigger_response.rb', line 63

def trigger_id
  @trigger_id
end

#trigger_nameString

TODO: Write general description for this method

Returns:

  • (String)


67
68
69
# File 'lib/verizon/models/get_trigger_response.rb', line 67

def trigger_name
  @trigger_name
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# File 'lib/verizon/models/get_trigger_response.rb', line 137

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
   = hash.key?('accountName') ? hash['accountName'] : SKIP
  comparator = hash.key?('comparator') ? hash['comparator'] : SKIP
  created_at = if hash.key?('createdAt')
                 (DateTimeHelper.from_rfc3339(hash['createdAt']) if hash['createdAt'])
               else
                 SKIP
               end
  group_name = hash.key?('groupName') ? hash['groupName'] : SKIP
  modified_at = if hash.key?('modifiedAt')
                  (DateTimeHelper.from_rfc3339(hash['modifiedAt']) if hash['modifiedAt'])
                else
                  SKIP
                end
  notification_group_name =
    hash.key?('notificationGroupName') ? hash['notificationGroupName'] : SKIP
  organization_name =
    hash.key?('organizationName') ? hash['organizationName'] : SKIP
  sms_type = hash.key?('smsType') ? hash['smsType'] : SKIP
  threshold = hash.key?('threshold') ? hash['threshold'] : SKIP
  threshold_unit = hash.key?('thresholdUnit') ? hash['thresholdUnit'] : SKIP
  trigger_category =
    hash.key?('triggerCategory') ? hash['triggerCategory'] : SKIP
  trigger_cycle = hash.key?('triggerCycle') ? hash['triggerCycle'] : SKIP
  trigger_id = hash.key?('triggerId') ? hash['triggerId'] : SKIP
  trigger_name = hash.key?('triggerName') ? hash['triggerName'] : SKIP

  # Create object from extracted values.
  GetTriggerResponse.new(,
                         comparator,
                         created_at,
                         group_name,
                         modified_at,
                         notification_group_name,
                         organization_name,
                         sms_type,
                         threshold,
                         threshold_unit,
                         trigger_category,
                         trigger_cycle,
                         trigger_id,
                         trigger_name)
end

.namesObject

A mapping from model property names to API property names.



70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/verizon/models/get_trigger_response.rb', line 70

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['account_name'] = 'accountName'
  @_hash['comparator'] = 'comparator'
  @_hash['created_at'] = 'createdAt'
  @_hash['group_name'] = 'groupName'
  @_hash['modified_at'] = 'modifiedAt'
  @_hash['notification_group_name'] = 'notificationGroupName'
  @_hash['organization_name'] = 'organizationName'
  @_hash['sms_type'] = 'smsType'
  @_hash['threshold'] = 'threshold'
  @_hash['threshold_unit'] = 'thresholdUnit'
  @_hash['trigger_category'] = 'triggerCategory'
  @_hash['trigger_cycle'] = 'triggerCycle'
  @_hash['trigger_id'] = 'triggerId'
  @_hash['trigger_name'] = 'triggerName'
  @_hash
end

.nullablesObject

An array for nullable fields



110
111
112
# File 'lib/verizon/models/get_trigger_response.rb', line 110

def self.nullables
  []
end

.optionalsObject

An array for optional fields



90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/verizon/models/get_trigger_response.rb', line 90

def self.optionals
  %w[
    account_name
    comparator
    created_at
    group_name
    modified_at
    notification_group_name
    organization_name
    sms_type
    threshold
    threshold_unit
    trigger_category
    trigger_cycle
    trigger_id
    trigger_name
  ]
end

Instance Method Details

#to_custom_created_atObject



184
185
186
# File 'lib/verizon/models/get_trigger_response.rb', line 184

def to_custom_created_at
  DateTimeHelper.to_rfc3339(created_at)
end

#to_custom_modified_atObject



188
189
190
# File 'lib/verizon/models/get_trigger_response.rb', line 188

def to_custom_modified_at
  DateTimeHelper.to_rfc3339(modified_at)
end