Class: MistApi::WebhookAlarmEvent
- Defined in:
- lib/mist_api/models/webhook_alarm_event.rb
Overview
WebhookAlarmEvent Model.
Instance Attribute Summary collapse
-
#aps ⇒ Array[String]
TODO: Write general description for this method.
-
#bssids ⇒ Array[String]
TODO: Write general description for this method.
-
#count ⇒ Integer
If present, represents number of events of given type occurred in current interval, default=1.
-
#event_id ⇒ UUID | String
Event id.
-
#for_site ⇒ TrueClass | FalseClass
Event id.
-
#id ⇒ UUID | String
Unique ID of the object instance in the Mist Organization.
-
#last_seen ⇒ Float
Last seen timestamp.
-
#node ⇒ HaClusterNodeEnum
only for HA.
-
#org_id ⇒ UUID | String
only for HA.
-
#site_id ⇒ UUID | String
only for HA.
-
#ssids ⇒ Array[String]
only for HA.
-
#timestamp ⇒ Float
Epoch (seconds).
-
#type ⇒ String
Event type.
-
#update ⇒ TrueClass | FalseClass
If presents, represents that this is an update to event with given id sent earlier.
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(id = nil, org_id = nil, site_id = nil, timestamp = nil, type = nil, aps = SKIP, bssids = SKIP, count = SKIP, event_id = SKIP, for_site = SKIP, last_seen = SKIP, node = SKIP, ssids = SKIP, update = SKIP) ⇒ WebhookAlarmEvent
constructor
A new instance of WebhookAlarmEvent.
-
#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(id = nil, org_id = nil, site_id = nil, timestamp = nil, type = nil, aps = SKIP, bssids = SKIP, count = SKIP, event_id = SKIP, for_site = SKIP, last_seen = SKIP, node = SKIP, ssids = SKIP, update = SKIP) ⇒ WebhookAlarmEvent
Returns a new instance of WebhookAlarmEvent.
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
# File 'lib/mist_api/models/webhook_alarm_event.rb', line 112 def initialize(id = nil, org_id = nil, site_id = nil, = nil, type = nil, aps = SKIP, bssids = SKIP, count = SKIP, event_id = SKIP, for_site = SKIP, last_seen = SKIP, node = SKIP, ssids = SKIP, update = SKIP) @aps = aps unless aps == SKIP @bssids = bssids unless bssids == SKIP @count = count unless count == SKIP @event_id = event_id unless event_id == SKIP @for_site = for_site unless for_site == SKIP @id = id @last_seen = last_seen unless last_seen == SKIP @node = node unless node == SKIP @org_id = org_id @site_id = site_id @ssids = ssids unless ssids == SKIP @timestamp = @type = type @update = update unless update == SKIP end |
Instance Attribute Details
#aps ⇒ Array[String]
TODO: Write general description for this method
14 15 16 |
# File 'lib/mist_api/models/webhook_alarm_event.rb', line 14 def aps @aps end |
#bssids ⇒ Array[String]
TODO: Write general description for this method
18 19 20 |
# File 'lib/mist_api/models/webhook_alarm_event.rb', line 18 def bssids @bssids end |
#count ⇒ Integer
If present, represents number of events of given type occurred in current interval, default=1
23 24 25 |
# File 'lib/mist_api/models/webhook_alarm_event.rb', line 23 def count @count end |
#event_id ⇒ UUID | String
Event id
27 28 29 |
# File 'lib/mist_api/models/webhook_alarm_event.rb', line 27 def event_id @event_id end |
#for_site ⇒ TrueClass | FalseClass
Event id
31 32 33 |
# File 'lib/mist_api/models/webhook_alarm_event.rb', line 31 def for_site @for_site end |
#id ⇒ UUID | String
Unique ID of the object instance in the Mist Organization
35 36 37 |
# File 'lib/mist_api/models/webhook_alarm_event.rb', line 35 def id @id end |
#last_seen ⇒ Float
Last seen timestamp
39 40 41 |
# File 'lib/mist_api/models/webhook_alarm_event.rb', line 39 def last_seen @last_seen end |
#node ⇒ HaClusterNodeEnum
only for HA. enum: ‘node0`, `node1`
43 44 45 |
# File 'lib/mist_api/models/webhook_alarm_event.rb', line 43 def node @node end |
#org_id ⇒ UUID | String
only for HA. enum: ‘node0`, `node1`
47 48 49 |
# File 'lib/mist_api/models/webhook_alarm_event.rb', line 47 def org_id @org_id end |
#site_id ⇒ UUID | String
only for HA. enum: ‘node0`, `node1`
51 52 53 |
# File 'lib/mist_api/models/webhook_alarm_event.rb', line 51 def site_id @site_id end |
#ssids ⇒ Array[String]
only for HA. enum: ‘node0`, `node1`
55 56 57 |
# File 'lib/mist_api/models/webhook_alarm_event.rb', line 55 def ssids @ssids end |
#timestamp ⇒ Float
Epoch (seconds)
59 60 61 |
# File 'lib/mist_api/models/webhook_alarm_event.rb', line 59 def @timestamp end |
#type ⇒ String
Event type
63 64 65 |
# File 'lib/mist_api/models/webhook_alarm_event.rb', line 63 def type @type end |
#update ⇒ TrueClass | FalseClass
If presents, represents that this is an update to event with given id sent earlier. default=false
68 69 70 |
# File 'lib/mist_api/models/webhook_alarm_event.rb', line 68 def update @update end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 167 |
# File 'lib/mist_api/models/webhook_alarm_event.rb', line 133 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash.key?('id') ? hash['id'] : nil org_id = hash.key?('org_id') ? hash['org_id'] : nil site_id = hash.key?('site_id') ? hash['site_id'] : nil = hash.key?('timestamp') ? hash['timestamp'] : nil type = hash.key?('type') ? hash['type'] : nil aps = hash.key?('aps') ? hash['aps'] : SKIP bssids = hash.key?('bssids') ? hash['bssids'] : SKIP count = hash.key?('count') ? hash['count'] : SKIP event_id = hash.key?('event_id') ? hash['event_id'] : SKIP for_site = hash.key?('for_site') ? hash['for_site'] : SKIP last_seen = hash.key?('last_seen') ? hash['last_seen'] : SKIP node = hash.key?('node') ? hash['node'] : SKIP ssids = hash.key?('ssids') ? hash['ssids'] : SKIP update = hash.key?('update') ? hash['update'] : SKIP # Create object from extracted values. WebhookAlarmEvent.new(id, org_id, site_id, , type, aps, bssids, count, event_id, for_site, last_seen, node, ssids, update) end |
.names ⇒ Object
A mapping from model property names to API property names.
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/mist_api/models/webhook_alarm_event.rb', line 71 def self.names @_hash = {} if @_hash.nil? @_hash['aps'] = 'aps' @_hash['bssids'] = 'bssids' @_hash['count'] = 'count' @_hash['event_id'] = 'event_id' @_hash['for_site'] = 'for_site' @_hash['id'] = 'id' @_hash['last_seen'] = 'last_seen' @_hash['node'] = 'node' @_hash['org_id'] = 'org_id' @_hash['site_id'] = 'site_id' @_hash['ssids'] = 'ssids' @_hash['timestamp'] = 'timestamp' @_hash['type'] = 'type' @_hash['update'] = 'update' @_hash end |
.nullables ⇒ Object
An array for nullable fields
106 107 108 109 110 |
# File 'lib/mist_api/models/webhook_alarm_event.rb', line 106 def self.nullables %w[ last_seen ] end |
.optionals ⇒ Object
An array for optional fields
91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/mist_api/models/webhook_alarm_event.rb', line 91 def self.optionals %w[ aps bssids count event_id for_site last_seen node ssids update ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
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 200 201 |
# File 'lib/mist_api/models/webhook_alarm_event.rb', line 171 def self.validate(value) if value.instance_of? self return ( APIHelper.valid_type?(value.id, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.org_id, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.site_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['id'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['org_id'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['site_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.
213 214 215 216 217 218 219 220 |
# File 'lib/mist_api/models/webhook_alarm_event.rb', line 213 def inspect class_name = self.class.name.split('::').last "<#{class_name} aps: #{@aps.inspect}, bssids: #{@bssids.inspect}, count: #{@count.inspect},"\ " event_id: #{@event_id.inspect}, for_site: #{@for_site.inspect}, id: #{@id.inspect},"\ " last_seen: #{@last_seen.inspect}, node: #{@node.inspect}, org_id: #{@org_id.inspect},"\ " site_id: #{@site_id.inspect}, ssids: #{@ssids.inspect}, timestamp: #{@timestamp.inspect},"\ " type: #{@type.inspect}, update: #{@update.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
204 205 206 207 208 209 210 |
# File 'lib/mist_api/models/webhook_alarm_event.rb', line 204 def to_s class_name = self.class.name.split('::').last "<#{class_name} aps: #{@aps}, bssids: #{@bssids}, count: #{@count}, event_id: #{@event_id},"\ " for_site: #{@for_site}, id: #{@id}, last_seen: #{@last_seen}, node: #{@node}, org_id:"\ " #{@org_id}, site_id: #{@site_id}, ssids: #{@ssids}, timestamp: #{@timestamp}, type:"\ " #{@type}, update: #{@update}>" end |