Class: MistApi::DeviceEvent
- Defined in:
- lib/mist_api/models/device_event.rb
Overview
DeviceEvent Model.
Instance Attribute Summary collapse
-
#ap ⇒ String
(will be deprecated soon; please use mac instead) ap mac.
-
#ap_name ⇒ String
(will be deprecated soon; please use device_name instead) ap name.
-
#apfw ⇒ String
(will be deprecated soon; please use device_name instead) ap name.
-
#audit_id ⇒ UUID | String
Unique ID of the object instance in the Mist Organization.
-
#bandwidth ⇒ Integer
Unique ID of the object instance in the Mist Organization.
-
#channel ⇒ Integer
Unique ID of the object instance in the Mist Organization.
-
#chassis_mac ⇒ String
Unique ID of the object instance in the Mist Organization.
-
#count ⇒ Integer
Unique ID of the object instance in the Mist Organization.
-
#device_name ⇒ String
Device name.
-
#device_type ⇒ DeviceTypeEnum
enum: ‘ap`, `gateway`, `switch`.
-
#ev_type ⇒ WebhookDeviceEventsEventEvTypeEnum
(optional) event advisory.
-
#ext_ip ⇒ String
(optional) event advisory.
-
#mac ⇒ String
Device mac.
-
#model ⇒ String
Device mac.
-
#node ⇒ String
Device mac.
-
#org_id ⇒ UUID | String
Device mac.
-
#port_id ⇒ String
Device mac.
-
#power ⇒ Integer
Device mac.
-
#pre_bandwidth ⇒ Integer
Device mac.
-
#pre_channel ⇒ Integer
Device mac.
-
#pre_power ⇒ Integer
Device mac.
-
#pre_usage ⇒ Integer
Device mac.
-
#reason ⇒ String
(optional) event reason.
-
#site_id ⇒ UUID | String
(optional) event reason.
-
#site_name ⇒ String
Site name.
-
#text ⇒ String
(optional) event description.
-
#timestamp ⇒ Float
Epoch (seconds).
-
#type ⇒ String
Event type.
-
#usage ⇒ Integer
Event type.
-
#version ⇒ String
Event type.
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.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(org_id = nil, timestamp = nil, type = nil, ap = SKIP, ap_name = SKIP, apfw = SKIP, audit_id = SKIP, bandwidth = SKIP, channel = SKIP, chassis_mac = SKIP, count = SKIP, device_name = SKIP, device_type = SKIP, ev_type = SKIP, ext_ip = SKIP, mac = SKIP, model = SKIP, node = SKIP, port_id = SKIP, power = SKIP, pre_bandwidth = SKIP, pre_channel = SKIP, pre_power = SKIP, pre_usage = SKIP, reason = SKIP, site_id = SKIP, site_name = SKIP, text = SKIP, usage = SKIP, version = SKIP) ⇒ DeviceEvent
constructor
A new instance of DeviceEvent.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#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(org_id = nil, timestamp = nil, type = nil, ap = SKIP, ap_name = SKIP, apfw = SKIP, audit_id = SKIP, bandwidth = SKIP, channel = SKIP, chassis_mac = SKIP, count = SKIP, device_name = SKIP, device_type = SKIP, ev_type = SKIP, ext_ip = SKIP, mac = SKIP, model = SKIP, node = SKIP, port_id = SKIP, power = SKIP, pre_bandwidth = SKIP, pre_channel = SKIP, pre_power = SKIP, pre_usage = SKIP, reason = SKIP, site_id = SKIP, site_name = SKIP, text = SKIP, usage = SKIP, version = SKIP) ⇒ DeviceEvent
Returns a new instance of DeviceEvent.
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 232 233 234 235 236 237 238 239 240 241 242 243 244 245 |
# File 'lib/mist_api/models/device_event.rb', line 206 def initialize(org_id = nil, = nil, type = nil, ap = SKIP, ap_name = SKIP, apfw = SKIP, audit_id = SKIP, bandwidth = SKIP, channel = SKIP, chassis_mac = SKIP, count = SKIP, device_name = SKIP, device_type = SKIP, ev_type = SKIP, ext_ip = SKIP, mac = SKIP, model = SKIP, node = SKIP, port_id = SKIP, power = SKIP, pre_bandwidth = SKIP, pre_channel = SKIP, pre_power = SKIP, pre_usage = SKIP, reason = SKIP, site_id = SKIP, site_name = SKIP, text = SKIP, usage = SKIP, version = SKIP) @ap = ap unless ap == SKIP @ap_name = ap_name unless ap_name == SKIP @apfw = apfw unless apfw == SKIP @audit_id = audit_id unless audit_id == SKIP @bandwidth = bandwidth unless bandwidth == SKIP @channel = channel unless channel == SKIP @chassis_mac = chassis_mac unless chassis_mac == SKIP @count = count unless count == SKIP @device_name = device_name unless device_name == SKIP @device_type = device_type unless device_type == SKIP @ev_type = ev_type unless ev_type == SKIP @ext_ip = ext_ip unless ext_ip == SKIP @mac = mac unless mac == SKIP @model = model unless model == SKIP @node = node unless node == SKIP @org_id = org_id @port_id = port_id unless port_id == SKIP @power = power unless power == SKIP @pre_bandwidth = pre_bandwidth unless pre_bandwidth == SKIP @pre_channel = pre_channel unless pre_channel == SKIP @pre_power = pre_power unless pre_power == SKIP @pre_usage = pre_usage unless pre_usage == SKIP @reason = reason unless reason == SKIP @site_id = site_id unless site_id == SKIP @site_name = site_name unless site_name == SKIP @text = text unless text == SKIP @timestamp = @type = type @usage = usage unless usage == SKIP @version = version unless version == SKIP end |
Instance Attribute Details
#ap ⇒ String
(will be deprecated soon; please use mac instead) ap mac
14 15 16 |
# File 'lib/mist_api/models/device_event.rb', line 14 def ap @ap end |
#ap_name ⇒ String
(will be deprecated soon; please use device_name instead) ap name
18 19 20 |
# File 'lib/mist_api/models/device_event.rb', line 18 def ap_name @ap_name end |
#apfw ⇒ String
(will be deprecated soon; please use device_name instead) ap name
22 23 24 |
# File 'lib/mist_api/models/device_event.rb', line 22 def apfw @apfw end |
#audit_id ⇒ UUID | String
Unique ID of the object instance in the Mist Organization
26 27 28 |
# File 'lib/mist_api/models/device_event.rb', line 26 def audit_id @audit_id end |
#bandwidth ⇒ Integer
Unique ID of the object instance in the Mist Organization
30 31 32 |
# File 'lib/mist_api/models/device_event.rb', line 30 def bandwidth @bandwidth end |
#channel ⇒ Integer
Unique ID of the object instance in the Mist Organization
34 35 36 |
# File 'lib/mist_api/models/device_event.rb', line 34 def channel @channel end |
#chassis_mac ⇒ String
Unique ID of the object instance in the Mist Organization
38 39 40 |
# File 'lib/mist_api/models/device_event.rb', line 38 def chassis_mac @chassis_mac end |
#count ⇒ Integer
Unique ID of the object instance in the Mist Organization
42 43 44 |
# File 'lib/mist_api/models/device_event.rb', line 42 def count @count end |
#device_name ⇒ String
Device name
46 47 48 |
# File 'lib/mist_api/models/device_event.rb', line 46 def device_name @device_name end |
#device_type ⇒ DeviceTypeEnum
enum: ‘ap`, `gateway`, `switch`
50 51 52 |
# File 'lib/mist_api/models/device_event.rb', line 50 def device_type @device_type end |
#ev_type ⇒ WebhookDeviceEventsEventEvTypeEnum
(optional) event advisory. enum: ‘notice`, `warn`
54 55 56 |
# File 'lib/mist_api/models/device_event.rb', line 54 def ev_type @ev_type end |
#ext_ip ⇒ String
(optional) event advisory. enum: ‘notice`, `warn`
58 59 60 |
# File 'lib/mist_api/models/device_event.rb', line 58 def ext_ip @ext_ip end |
#mac ⇒ String
Device mac
62 63 64 |
# File 'lib/mist_api/models/device_event.rb', line 62 def mac @mac end |
#model ⇒ String
Device mac
66 67 68 |
# File 'lib/mist_api/models/device_event.rb', line 66 def model @model end |
#node ⇒ String
Device mac
70 71 72 |
# File 'lib/mist_api/models/device_event.rb', line 70 def node @node end |
#org_id ⇒ UUID | String
Device mac
74 75 76 |
# File 'lib/mist_api/models/device_event.rb', line 74 def org_id @org_id end |
#port_id ⇒ String
Device mac
78 79 80 |
# File 'lib/mist_api/models/device_event.rb', line 78 def port_id @port_id end |
#power ⇒ Integer
Device mac
82 83 84 |
# File 'lib/mist_api/models/device_event.rb', line 82 def power @power end |
#pre_bandwidth ⇒ Integer
Device mac
86 87 88 |
# File 'lib/mist_api/models/device_event.rb', line 86 def pre_bandwidth @pre_bandwidth end |
#pre_channel ⇒ Integer
Device mac
90 91 92 |
# File 'lib/mist_api/models/device_event.rb', line 90 def pre_channel @pre_channel end |
#pre_power ⇒ Integer
Device mac
94 95 96 |
# File 'lib/mist_api/models/device_event.rb', line 94 def pre_power @pre_power end |
#pre_usage ⇒ Integer
Device mac
98 99 100 |
# File 'lib/mist_api/models/device_event.rb', line 98 def pre_usage @pre_usage end |
#reason ⇒ String
(optional) event reason
102 103 104 |
# File 'lib/mist_api/models/device_event.rb', line 102 def reason @reason end |
#site_id ⇒ UUID | String
(optional) event reason
106 107 108 |
# File 'lib/mist_api/models/device_event.rb', line 106 def site_id @site_id end |
#site_name ⇒ String
Site name
110 111 112 |
# File 'lib/mist_api/models/device_event.rb', line 110 def site_name @site_name end |
#text ⇒ String
(optional) event description
114 115 116 |
# File 'lib/mist_api/models/device_event.rb', line 114 def text @text end |
#timestamp ⇒ Float
Epoch (seconds)
118 119 120 |
# File 'lib/mist_api/models/device_event.rb', line 118 def @timestamp end |
#type ⇒ String
Event type
122 123 124 |
# File 'lib/mist_api/models/device_event.rb', line 122 def type @type end |
#usage ⇒ Integer
Event type
126 127 128 |
# File 'lib/mist_api/models/device_event.rb', line 126 def usage @usage end |
#version ⇒ String
Event type
130 131 132 |
# File 'lib/mist_api/models/device_event.rb', line 130 def version @version end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 |
# File 'lib/mist_api/models/device_event.rb', line 248 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. org_id = hash.key?('org_id') ? hash['org_id'] : nil = hash.key?('timestamp') ? hash['timestamp'] : nil type = hash.key?('type') ? hash['type'] : nil ap = hash.key?('ap') ? hash['ap'] : SKIP ap_name = hash.key?('ap_name') ? hash['ap_name'] : SKIP apfw = hash.key?('apfw') ? hash['apfw'] : SKIP audit_id = hash.key?('audit_id') ? hash['audit_id'] : SKIP bandwidth = hash.key?('bandwidth') ? hash['bandwidth'] : SKIP channel = hash.key?('channel') ? hash['channel'] : SKIP chassis_mac = hash.key?('chassis_mac') ? hash['chassis_mac'] : SKIP count = hash.key?('count') ? hash['count'] : SKIP device_name = hash.key?('device_name') ? hash['device_name'] : SKIP device_type = hash.key?('device_type') ? hash['device_type'] : SKIP ev_type = hash.key?('ev_type') ? hash['ev_type'] : SKIP ext_ip = hash.key?('ext_ip') ? hash['ext_ip'] : SKIP mac = hash.key?('mac') ? hash['mac'] : SKIP model = hash.key?('model') ? hash['model'] : SKIP node = hash.key?('node') ? hash['node'] : SKIP port_id = hash.key?('port_id') ? hash['port_id'] : SKIP power = hash.key?('power') ? hash['power'] : SKIP pre_bandwidth = hash.key?('pre_bandwidth') ? hash['pre_bandwidth'] : SKIP pre_channel = hash.key?('pre_channel') ? hash['pre_channel'] : SKIP pre_power = hash.key?('pre_power') ? hash['pre_power'] : SKIP pre_usage = hash.key?('pre_usage') ? hash['pre_usage'] : SKIP reason = hash.key?('reason') ? hash['reason'] : SKIP site_id = hash.key?('site_id') ? hash['site_id'] : SKIP site_name = hash.key?('site_name') ? hash['site_name'] : SKIP text = hash.key?('text') ? hash['text'] : SKIP usage = hash.key?('usage') ? hash['usage'] : SKIP version = hash.key?('version') ? hash['version'] : SKIP # Create object from extracted values. DeviceEvent.new(org_id, , type, ap, ap_name, apfw, audit_id, bandwidth, channel, chassis_mac, count, device_name, device_type, ev_type, ext_ip, mac, model, node, port_id, power, pre_bandwidth, pre_channel, pre_power, pre_usage, reason, site_id, site_name, text, usage, version) end |
.names ⇒ Object
A mapping from model property names to API property names.
133 134 135 136 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 |
# File 'lib/mist_api/models/device_event.rb', line 133 def self.names @_hash = {} if @_hash.nil? @_hash['ap'] = 'ap' @_hash['ap_name'] = 'ap_name' @_hash['apfw'] = 'apfw' @_hash['audit_id'] = 'audit_id' @_hash['bandwidth'] = 'bandwidth' @_hash['channel'] = 'channel' @_hash['chassis_mac'] = 'chassis_mac' @_hash['count'] = 'count' @_hash['device_name'] = 'device_name' @_hash['device_type'] = 'device_type' @_hash['ev_type'] = 'ev_type' @_hash['ext_ip'] = 'ext_ip' @_hash['mac'] = 'mac' @_hash['model'] = 'model' @_hash['node'] = 'node' @_hash['org_id'] = 'org_id' @_hash['port_id'] = 'port_id' @_hash['power'] = 'power' @_hash['pre_bandwidth'] = 'pre_bandwidth' @_hash['pre_channel'] = 'pre_channel' @_hash['pre_power'] = 'pre_power' @_hash['pre_usage'] = 'pre_usage' @_hash['reason'] = 'reason' @_hash['site_id'] = 'site_id' @_hash['site_name'] = 'site_name' @_hash['text'] = 'text' @_hash['timestamp'] = 'timestamp' @_hash['type'] = 'type' @_hash['usage'] = 'usage' @_hash['version'] = 'version' @_hash end |
.nullables ⇒ Object
An array for nullable fields
202 203 204 |
# File 'lib/mist_api/models/device_event.rb', line 202 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 |
# File 'lib/mist_api/models/device_event.rb', line 169 def self.optionals %w[ ap ap_name apfw audit_id bandwidth channel chassis_mac count device_name device_type ev_type ext_ip mac model node port_id power pre_bandwidth pre_channel pre_power pre_usage reason site_id site_name text usage version ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 |
# File 'lib/mist_api/models/device_event.rb', line 318 def self.validate(value) if value.instance_of? self return ( APIHelper.valid_type?(value.org_id, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value., ->(val) { val.instance_of? Float }) and APIHelper.valid_type?(value.type, ->(val) { val.instance_of? String }) ) end return false unless value.instance_of? Hash ( APIHelper.valid_type?(value['org_id'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['timestamp'], ->(val) { val.instance_of? Float }) and APIHelper.valid_type?(value['type'], ->(val) { val.instance_of? String }) ) end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 |
# File 'lib/mist_api/models/device_event.rb', line 356 def inspect class_name = self.class.name.split('::').last "<#{class_name} ap: #{@ap.inspect}, ap_name: #{@ap_name.inspect}, apfw: #{@apfw.inspect},"\ " audit_id: #{@audit_id.inspect}, bandwidth: #{@bandwidth.inspect}, channel:"\ " #{@channel.inspect}, chassis_mac: #{@chassis_mac.inspect}, count: #{@count.inspect},"\ " device_name: #{@device_name.inspect}, device_type: #{@device_type.inspect}, ev_type:"\ " #{@ev_type.inspect}, ext_ip: #{@ext_ip.inspect}, mac: #{@mac.inspect}, model:"\ " #{@model.inspect}, node: #{@node.inspect}, org_id: #{@org_id.inspect}, port_id:"\ " #{@port_id.inspect}, power: #{@power.inspect}, pre_bandwidth: #{@pre_bandwidth.inspect},"\ " pre_channel: #{@pre_channel.inspect}, pre_power: #{@pre_power.inspect}, pre_usage:"\ " #{@pre_usage.inspect}, reason: #{@reason.inspect}, site_id: #{@site_id.inspect},"\ " site_name: #{@site_name.inspect}, text: #{@text.inspect}, timestamp:"\ " #{@timestamp.inspect}, type: #{@type.inspect}, usage: #{@usage.inspect}, version:"\ " #{@version.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
343 344 345 346 347 348 349 350 351 352 353 |
# File 'lib/mist_api/models/device_event.rb', line 343 def to_s class_name = self.class.name.split('::').last "<#{class_name} ap: #{@ap}, ap_name: #{@ap_name}, apfw: #{@apfw}, audit_id: #{@audit_id},"\ " bandwidth: #{@bandwidth}, channel: #{@channel}, chassis_mac: #{@chassis_mac}, count:"\ " #{@count}, device_name: #{@device_name}, device_type: #{@device_type}, ev_type:"\ " #{@ev_type}, ext_ip: #{@ext_ip}, mac: #{@mac}, model: #{@model}, node: #{@node}, org_id:"\ " #{@org_id}, port_id: #{@port_id}, power: #{@power}, pre_bandwidth: #{@pre_bandwidth},"\ " pre_channel: #{@pre_channel}, pre_power: #{@pre_power}, pre_usage: #{@pre_usage}, reason:"\ " #{@reason}, site_id: #{@site_id}, site_name: #{@site_name}, text: #{@text}, timestamp:"\ " #{@timestamp}, type: #{@type}, usage: #{@usage}, version: #{@version}>" end |