Class: MistApi::WebhookRssizoneEvent
- Defined in:
- lib/mist_api/models/webhook_rssizone_event.rb
Overview
WebhookRssizoneEvent Model.
Instance Attribute Summary collapse
-
#mac ⇒ String
Client MAC address.
-
#map_id ⇒ UUID | String
Client MAC address.
-
#rssizone_id ⇒ UUID | String
RSSI zone name.
-
#site_id ⇒ UUID | String
RSSI zone name.
-
#timestamp ⇒ Float
Epoch (seconds).
-
#trigger ⇒ WebhookZoneEventTriggerEnum
enum: ‘enter`, `exit`.
-
#type ⇒ WebhookZoneEventTypeEnum
Type of client.
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(mac = nil, map_id = nil, rssizone_id = nil, site_id = nil, timestamp = nil, trigger = nil, type = nil) ⇒ WebhookRssizoneEvent
constructor
A new instance of WebhookRssizoneEvent.
-
#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(mac = nil, map_id = nil, rssizone_id = nil, site_id = nil, timestamp = nil, trigger = nil, type = nil) ⇒ WebhookRssizoneEvent
Returns a new instance of WebhookRssizoneEvent.
63 64 65 66 67 68 69 70 71 72 |
# File 'lib/mist_api/models/webhook_rssizone_event.rb', line 63 def initialize(mac = nil, map_id = nil, rssizone_id = nil, site_id = nil, = nil, trigger = nil, type = nil) @mac = mac @map_id = map_id @rssizone_id = rssizone_id @site_id = site_id @timestamp = @trigger = trigger @type = type end |
Instance Attribute Details
#mac ⇒ String
Client MAC address
14 15 16 |
# File 'lib/mist_api/models/webhook_rssizone_event.rb', line 14 def mac @mac end |
#map_id ⇒ UUID | String
Client MAC address
18 19 20 |
# File 'lib/mist_api/models/webhook_rssizone_event.rb', line 18 def map_id @map_id end |
#rssizone_id ⇒ UUID | String
RSSI zone name
22 23 24 |
# File 'lib/mist_api/models/webhook_rssizone_event.rb', line 22 def rssizone_id @rssizone_id end |
#site_id ⇒ UUID | String
RSSI zone name
26 27 28 |
# File 'lib/mist_api/models/webhook_rssizone_event.rb', line 26 def site_id @site_id end |
#timestamp ⇒ Float
Epoch (seconds)
30 31 32 |
# File 'lib/mist_api/models/webhook_rssizone_event.rb', line 30 def @timestamp end |
#trigger ⇒ WebhookZoneEventTriggerEnum
enum: ‘enter`, `exit`
34 35 36 |
# File 'lib/mist_api/models/webhook_rssizone_event.rb', line 34 def trigger @trigger end |
#type ⇒ WebhookZoneEventTypeEnum
Type of client. enum: ‘asset` (BLE Tag), `sdk`, `wifi`
38 39 40 |
# File 'lib/mist_api/models/webhook_rssizone_event.rb', line 38 def type @type end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/mist_api/models/webhook_rssizone_event.rb', line 75 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. mac = hash.key?('mac') ? hash['mac'] : nil map_id = hash.key?('map_id') ? hash['map_id'] : nil rssizone_id = hash.key?('rssizone_id') ? hash['rssizone_id'] : nil site_id = hash.key?('site_id') ? hash['site_id'] : nil = hash.key?('timestamp') ? hash['timestamp'] : nil trigger = hash.key?('trigger') ? hash['trigger'] : nil type = hash.key?('type') ? hash['type'] : nil # Create object from extracted values. WebhookRssizoneEvent.new(mac, map_id, rssizone_id, site_id, , trigger, type) end |
.names ⇒ Object
A mapping from model property names to API property names.
41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/mist_api/models/webhook_rssizone_event.rb', line 41 def self.names @_hash = {} if @_hash.nil? @_hash['mac'] = 'mac' @_hash['map_id'] = 'map_id' @_hash['rssizone_id'] = 'rssizone_id' @_hash['site_id'] = 'site_id' @_hash['timestamp'] = 'timestamp' @_hash['trigger'] = 'trigger' @_hash['type'] = 'type' @_hash end |
.nullables ⇒ Object
An array for nullable fields
59 60 61 |
# File 'lib/mist_api/models/webhook_rssizone_event.rb', line 59 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
54 55 56 |
# File 'lib/mist_api/models/webhook_rssizone_event.rb', line 54 def self.optionals [] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 |
# File 'lib/mist_api/models/webhook_rssizone_event.rb', line 99 def self.validate(value) if value.instance_of? self return ( APIHelper.valid_type?(value.mac, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.map_id, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.rssizone_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.trigger, ->(val) { WebhookZoneEventTriggerEnum.validate(val) }) and APIHelper.valid_type?(value.type, ->(val) { WebhookZoneEventTypeEnum.validate(val) }) ) end return false unless value.instance_of? Hash ( APIHelper.valid_type?(value['mac'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['map_id'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['rssizone_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['trigger'], ->(val) { WebhookZoneEventTriggerEnum.validate(val) }) and APIHelper.valid_type?(value['type'], ->(val) { WebhookZoneEventTypeEnum.validate(val) }) ) end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
147 148 149 150 151 152 |
# File 'lib/mist_api/models/webhook_rssizone_event.rb', line 147 def inspect class_name = self.class.name.split('::').last "<#{class_name} mac: #{@mac.inspect}, map_id: #{@map_id.inspect}, rssizone_id:"\ " #{@rssizone_id.inspect}, site_id: #{@site_id.inspect}, timestamp: #{@timestamp.inspect},"\ " trigger: #{@trigger.inspect}, type: #{@type.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
140 141 142 143 144 |
# File 'lib/mist_api/models/webhook_rssizone_event.rb', line 140 def to_s class_name = self.class.name.split('::').last "<#{class_name} mac: #{@mac}, map_id: #{@map_id}, rssizone_id: #{@rssizone_id}, site_id:"\ " #{@site_id}, timestamp: #{@timestamp}, trigger: #{@trigger}, type: #{@type}>" end |