Class: Verizon::UserSmartAlert
- Defined in:
- lib/verizon/models/user_smart_alert.rb
Overview
UserSmartAlert Model.
Instance Attribute Summary collapse
-
#accountclientid ⇒ String
Not used in this release, future functionality.
-
#billingaccountid ⇒ String
The billing account ID.
-
#category ⇒ String
The type of alert and will be either ‘telemetry` or `infrastructure`.
-
#condition ⇒ Integer
The condition or threshold for an alert.
-
#createdon ⇒ DateTime
Timestamp of the record.
-
#description ⇒ String
a short description.
-
#deviceid ⇒ String
This is a UUID value of the device created when the device is onboarded.
-
#foreignid ⇒ String
UUID of the ECPD account the user belongs to.
-
#id ⇒ String
UUID of the user record, assigned at creation.
-
#isacknowledged ⇒ TrueClass | FalseClass
A flag that indicates if the alarm has been acknowledged.
-
#iscleared ⇒ TrueClass | FalseClass
A flag that indicates if the alarm has been cleared.
-
#isdisabled ⇒ TrueClass | FalseClass
A flag that indicates if the alarm has been disabled.
-
#lastupdated ⇒ DateTime
Timestamp of the record.
-
#name ⇒ String
User defined name of the record.
-
#ruleid ⇒ String
The UUID of a rule for alerts.
-
#severity ⇒ String
The threshold value to trigger an alert and will be Critical, Major or Minor.
-
#state ⇒ String
The current status of the device or transaction and will be ‘success` or `failed`.
-
#template ⇒ String
template of the rule which triggered a given alert.
-
#version ⇒ String
The resource version.
-
#versionid ⇒ String
The UUID of the resource version.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(createdon:, lastupdated:, versionid:, accountclientid: SKIP, billingaccountid: SKIP, category: SKIP, condition: SKIP, description: SKIP, deviceid: SKIP, foreignid: SKIP, id: SKIP, isacknowledged: SKIP, iscleared: SKIP, isdisabled: SKIP, name: SKIP, ruleid: SKIP, severity: SKIP, state: SKIP, template: SKIP, version: SKIP) ⇒ UserSmartAlert
constructor
A new instance of UserSmartAlert.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_createdon ⇒ Object
- #to_custom_lastupdated ⇒ Object
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(createdon:, lastupdated:, versionid:, accountclientid: SKIP, billingaccountid: SKIP, category: SKIP, condition: SKIP, description: SKIP, deviceid: SKIP, foreignid: SKIP, id: SKIP, isacknowledged: SKIP, iscleared: SKIP, isdisabled: SKIP, name: SKIP, ruleid: SKIP, severity: SKIP, state: SKIP, template: SKIP, version: SKIP) ⇒ UserSmartAlert
Returns a new instance of UserSmartAlert.
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 |
# File 'lib/verizon/models/user_smart_alert.rb', line 149 def initialize(createdon:, lastupdated:, versionid:, accountclientid: SKIP, billingaccountid: SKIP, category: SKIP, condition: SKIP, description: SKIP, deviceid: SKIP, foreignid: SKIP, id: SKIP, isacknowledged: SKIP, iscleared: SKIP, isdisabled: SKIP, name: SKIP, ruleid: SKIP, severity: SKIP, state: SKIP, template: SKIP, version: SKIP) @accountclientid = accountclientid unless accountclientid == SKIP @billingaccountid = billingaccountid unless billingaccountid == SKIP @category = category unless category == SKIP @condition = condition unless condition == SKIP @createdon = createdon @description = description unless description == SKIP @deviceid = deviceid unless deviceid == SKIP @foreignid = foreignid unless foreignid == SKIP @id = id unless id == SKIP @isacknowledged = isacknowledged unless isacknowledged == SKIP @iscleared = iscleared unless iscleared == SKIP @isdisabled = isdisabled unless isdisabled == SKIP @lastupdated = lastupdated @name = name unless name == SKIP @ruleid = ruleid unless ruleid == SKIP @severity = severity unless severity == SKIP @state = state unless state == SKIP @template = template unless template == SKIP @version = version unless version == SKIP @versionid = versionid end |
Instance Attribute Details
#accountclientid ⇒ String
Not used in this release, future functionality
15 16 17 |
# File 'lib/verizon/models/user_smart_alert.rb', line 15 def accountclientid @accountclientid end |
#billingaccountid ⇒ String
The billing account ID. This is the same value as the Account ID
19 20 21 |
# File 'lib/verizon/models/user_smart_alert.rb', line 19 def billingaccountid @billingaccountid end |
#category ⇒ String
The type of alert and will be either ‘telemetry` or `infrastructure`
23 24 25 |
# File 'lib/verizon/models/user_smart_alert.rb', line 23 def category @category end |
#condition ⇒ Integer
The condition or threshold for an alert
27 28 29 |
# File 'lib/verizon/models/user_smart_alert.rb', line 27 def condition @condition end |
#createdon ⇒ DateTime
Timestamp of the record
31 32 33 |
# File 'lib/verizon/models/user_smart_alert.rb', line 31 def createdon @createdon end |
#description ⇒ String
a short description
35 36 37 |
# File 'lib/verizon/models/user_smart_alert.rb', line 35 def description @description end |
#deviceid ⇒ String
This is a UUID value of the device created when the device is onboarded
39 40 41 |
# File 'lib/verizon/models/user_smart_alert.rb', line 39 def deviceid @deviceid end |
#foreignid ⇒ String
UUID of the ECPD account the user belongs to
43 44 45 |
# File 'lib/verizon/models/user_smart_alert.rb', line 43 def foreignid @foreignid end |
#id ⇒ String
UUID of the user record, assigned at creation
47 48 49 |
# File 'lib/verizon/models/user_smart_alert.rb', line 47 def id @id end |
#isacknowledged ⇒ TrueClass | FalseClass
A flag that indicates if the alarm has been acknowledged
51 52 53 |
# File 'lib/verizon/models/user_smart_alert.rb', line 51 def isacknowledged @isacknowledged end |
#iscleared ⇒ TrueClass | FalseClass
A flag that indicates if the alarm has been cleared
55 56 57 |
# File 'lib/verizon/models/user_smart_alert.rb', line 55 def iscleared @iscleared end |
#isdisabled ⇒ TrueClass | FalseClass
A flag that indicates if the alarm has been disabled
59 60 61 |
# File 'lib/verizon/models/user_smart_alert.rb', line 59 def isdisabled @isdisabled end |
#lastupdated ⇒ DateTime
Timestamp of the record
63 64 65 |
# File 'lib/verizon/models/user_smart_alert.rb', line 63 def lastupdated @lastupdated end |
#name ⇒ String
User defined name of the record
67 68 69 |
# File 'lib/verizon/models/user_smart_alert.rb', line 67 def name @name end |
#ruleid ⇒ String
The UUID of a rule for alerts
71 72 73 |
# File 'lib/verizon/models/user_smart_alert.rb', line 71 def ruleid @ruleid end |
#severity ⇒ String
The threshold value to trigger an alert and will be Critical, Major or Minor
76 77 78 |
# File 'lib/verizon/models/user_smart_alert.rb', line 76 def severity @severity end |
#state ⇒ String
The current status of the device or transaction and will be ‘success` or `failed`
81 82 83 |
# File 'lib/verizon/models/user_smart_alert.rb', line 81 def state @state end |
#template ⇒ String
template of the rule which triggered a given alert
85 86 87 |
# File 'lib/verizon/models/user_smart_alert.rb', line 85 def template @template end |
#version ⇒ String
The resource version
89 90 91 |
# File 'lib/verizon/models/user_smart_alert.rb', line 89 def version @version end |
#versionid ⇒ String
The UUID of the resource version
93 94 95 |
# File 'lib/verizon/models/user_smart_alert.rb', line 93 def versionid @versionid end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 |
# File 'lib/verizon/models/user_smart_alert.rb', line 178 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. createdon = if hash.key?('createdon') (DateTimeHelper.from_rfc3339(hash['createdon']) if hash['createdon']) end lastupdated = if hash.key?('lastupdated') (DateTimeHelper.from_rfc3339(hash['lastupdated']) if hash['lastupdated']) end versionid = hash.key?('versionid') ? hash['versionid'] : nil accountclientid = hash.key?('accountclientid') ? hash['accountclientid'] : SKIP billingaccountid = hash.key?('billingaccountid') ? hash['billingaccountid'] : SKIP category = hash.key?('category') ? hash['category'] : SKIP condition = hash.key?('condition') ? hash['condition'] : SKIP description = hash.key?('description') ? hash['description'] : SKIP deviceid = hash.key?('deviceid') ? hash['deviceid'] : SKIP foreignid = hash.key?('foreignid') ? hash['foreignid'] : SKIP id = hash.key?('id') ? hash['id'] : SKIP isacknowledged = hash.key?('isacknowledged') ? hash['isacknowledged'] : SKIP iscleared = hash.key?('iscleared') ? hash['iscleared'] : SKIP isdisabled = hash.key?('isdisabled') ? hash['isdisabled'] : SKIP name = hash.key?('name') ? hash['name'] : SKIP ruleid = hash.key?('ruleid') ? hash['ruleid'] : SKIP severity = hash.key?('severity') ? hash['severity'] : SKIP state = hash.key?('state') ? hash['state'] : SKIP template = hash.key?('template') ? hash['template'] : SKIP version = hash.key?('version') ? hash['version'] : SKIP # Create object from extracted values. UserSmartAlert.new(createdon: createdon, lastupdated: lastupdated, versionid: versionid, accountclientid: accountclientid, billingaccountid: billingaccountid, category: category, condition: condition, description: description, deviceid: deviceid, foreignid: foreignid, id: id, isacknowledged: isacknowledged, iscleared: iscleared, isdisabled: isdisabled, name: name, ruleid: ruleid, severity: severity, state: state, template: template, version: version) end |
.names ⇒ Object
A mapping from model property names to API property names.
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/verizon/models/user_smart_alert.rb', line 96 def self.names @_hash = {} if @_hash.nil? @_hash['accountclientid'] = 'accountclientid' @_hash['billingaccountid'] = 'billingaccountid' @_hash['category'] = 'category' @_hash['condition'] = 'condition' @_hash['createdon'] = 'createdon' @_hash['description'] = 'description' @_hash['deviceid'] = 'deviceid' @_hash['foreignid'] = 'foreignid' @_hash['id'] = 'id' @_hash['isacknowledged'] = 'isacknowledged' @_hash['iscleared'] = 'iscleared' @_hash['isdisabled'] = 'isdisabled' @_hash['lastupdated'] = 'lastupdated' @_hash['name'] = 'name' @_hash['ruleid'] = 'ruleid' @_hash['severity'] = 'severity' @_hash['state'] = 'state' @_hash['template'] = 'template' @_hash['version'] = 'version' @_hash['versionid'] = 'versionid' @_hash end |
.nullables ⇒ Object
An array for nullable fields
145 146 147 |
# File 'lib/verizon/models/user_smart_alert.rb', line 145 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 |
# File 'lib/verizon/models/user_smart_alert.rb', line 122 def self.optionals %w[ accountclientid billingaccountid category condition description deviceid foreignid id isacknowledged iscleared isdisabled name ruleid severity state template version ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
254 255 256 257 258 259 260 261 262 263 264 265 |
# File 'lib/verizon/models/user_smart_alert.rb', line 254 def inspect class_name = self.class.name.split('::').last "<#{class_name} accountclientid: #{@accountclientid.inspect}, billingaccountid:"\ " #{@billingaccountid.inspect}, category: #{@category.inspect}, condition:"\ " #{@condition.inspect}, createdon: #{@createdon.inspect}, description:"\ " #{@description.inspect}, deviceid: #{@deviceid.inspect}, foreignid: #{@foreignid.inspect},"\ " id: #{@id.inspect}, isacknowledged: #{@isacknowledged.inspect}, iscleared:"\ " #{@iscleared.inspect}, isdisabled: #{@isdisabled.inspect}, lastupdated:"\ " #{@lastupdated.inspect}, name: #{@name.inspect}, ruleid: #{@ruleid.inspect}, severity:"\ " #{@severity.inspect}, state: #{@state.inspect}, template: #{@template.inspect}, version:"\ " #{@version.inspect}, versionid: #{@versionid.inspect}>" end |
#to_custom_createdon ⇒ Object
233 234 235 |
# File 'lib/verizon/models/user_smart_alert.rb', line 233 def to_custom_createdon DateTimeHelper.to_rfc3339(createdon) end |
#to_custom_lastupdated ⇒ Object
237 238 239 |
# File 'lib/verizon/models/user_smart_alert.rb', line 237 def to_custom_lastupdated DateTimeHelper.to_rfc3339(lastupdated) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
242 243 244 245 246 247 248 249 250 251 |
# File 'lib/verizon/models/user_smart_alert.rb', line 242 def to_s class_name = self.class.name.split('::').last "<#{class_name} accountclientid: #{@accountclientid}, billingaccountid:"\ " #{@billingaccountid}, category: #{@category}, condition: #{@condition}, createdon:"\ " #{@createdon}, description: #{@description}, deviceid: #{@deviceid}, foreignid:"\ " #{@foreignid}, id: #{@id}, isacknowledged: #{@isacknowledged}, iscleared: #{@iscleared},"\ " isdisabled: #{@isdisabled}, lastupdated: #{@lastupdated}, name: #{@name}, ruleid:"\ " #{@ruleid}, severity: #{@severity}, state: #{@state}, template: #{@template}, version:"\ " #{@version}, versionid: #{@versionid}>" end |