Class: MistApi::WebhookSdkclientScanDataEvent

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/mist_api/models/webhook_sdkclient_scan_data_event.rb

Overview

WebhookSdkclientScanDataEvent Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(connection_ap = nil, connection_band = nil, connection_bssid = nil, connection_channel = nil, connection_rssi = nil, mac = nil, site_id = nil, last_seen = SKIP, scan_data = SKIP) ⇒ WebhookSdkclientScanDataEvent

Returns a new instance of WebhookSdkclientScanDataEvent.



78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/mist_api/models/webhook_sdkclient_scan_data_event.rb', line 78

def initialize(connection_ap = nil, connection_band = nil,
               connection_bssid = nil, connection_channel = nil,
               connection_rssi = nil, mac = nil, site_id = nil,
               last_seen = SKIP, scan_data = SKIP)
  @connection_ap = connection_ap
  @connection_band = connection_band
  @connection_bssid = connection_bssid
  @connection_channel = connection_channel
  @connection_rssi = connection_rssi
  @last_seen = last_seen unless last_seen == SKIP
  @mac = mac
  @scan_data = scan_data unless scan_data == SKIP
  @site_id = site_id
end

Instance Attribute Details

#connection_apString

MAC address of the AP the client is connected to

Returns:

  • (String)


14
15
16
# File 'lib/mist_api/models/webhook_sdkclient_scan_data_event.rb', line 14

def connection_ap
  @connection_ap
end

#connection_bandString

5GHz or 2.4GHz band, of the BSSID the client is connected to

Returns:

  • (String)


18
19
20
# File 'lib/mist_api/models/webhook_sdkclient_scan_data_event.rb', line 18

def connection_band
  @connection_band
end

#connection_bssidString

BSSID of the AP the client is connected to

Returns:

  • (String)


22
23
24
# File 'lib/mist_api/models/webhook_sdkclient_scan_data_event.rb', line 22

def connection_bssid
  @connection_bssid
end

#connection_channelInteger

Channel of the band the client is connected to

Returns:

  • (Integer)


26
27
28
# File 'lib/mist_api/models/webhook_sdkclient_scan_data_event.rb', line 26

def connection_channel
  @connection_channel
end

#connection_rssiFloat

RSSI of the client’s connection to the AP/BSSID

Returns:

  • (Float)


30
31
32
# File 'lib/mist_api/models/webhook_sdkclient_scan_data_event.rb', line 30

def connection_rssi
  @connection_rssi
end

#last_seenFloat

Last seen timestamp

Returns:

  • (Float)


34
35
36
# File 'lib/mist_api/models/webhook_sdkclient_scan_data_event.rb', line 34

def last_seen
  @last_seen
end

#macString

Client’s MAC Address

Returns:

  • (String)


38
39
40
# File 'lib/mist_api/models/webhook_sdkclient_scan_data_event.rb', line 38

def mac
  @mac
end

#scan_dataArray[WebhookSdkclientScanDataEventScanDataItem]

Client’s MAC Address



42
43
44
# File 'lib/mist_api/models/webhook_sdkclient_scan_data_event.rb', line 42

def scan_data
  @scan_data
end

#site_idUUID | String

Client’s MAC Address

Returns:

  • (UUID | String)


46
47
48
# File 'lib/mist_api/models/webhook_sdkclient_scan_data_event.rb', line 46

def site_id
  @site_id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



94
95
96
97
98
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
# File 'lib/mist_api/models/webhook_sdkclient_scan_data_event.rb', line 94

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  connection_ap = hash.key?('connection_ap') ? hash['connection_ap'] : nil
  connection_band =
    hash.key?('connection_band') ? hash['connection_band'] : nil
  connection_bssid =
    hash.key?('connection_bssid') ? hash['connection_bssid'] : nil
  connection_channel =
    hash.key?('connection_channel') ? hash['connection_channel'] : nil
  connection_rssi =
    hash.key?('connection_rssi') ? hash['connection_rssi'] : nil
  mac = hash.key?('mac') ? hash['mac'] : nil
  site_id = hash.key?('site_id') ? hash['site_id'] : nil
  last_seen = hash.key?('last_seen') ? hash['last_seen'] : SKIP
  # Parameter is an array, so we need to iterate through it
  scan_data = nil
  unless hash['scan_data'].nil?
    scan_data = []
    hash['scan_data'].each do |structure|
      scan_data << (WebhookSdkclientScanDataEventScanDataItem.from_hash(structure) if structure)
    end
  end

  scan_data = SKIP unless hash.key?('scan_data')

  # Create object from extracted values.
  WebhookSdkclientScanDataEvent.new(connection_ap,
                                    connection_band,
                                    connection_bssid,
                                    connection_channel,
                                    connection_rssi,
                                    mac,
                                    site_id,
                                    last_seen,
                                    scan_data)
end

.namesObject

A mapping from model property names to API property names.



49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/mist_api/models/webhook_sdkclient_scan_data_event.rb', line 49

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['connection_ap'] = 'connection_ap'
  @_hash['connection_band'] = 'connection_band'
  @_hash['connection_bssid'] = 'connection_bssid'
  @_hash['connection_channel'] = 'connection_channel'
  @_hash['connection_rssi'] = 'connection_rssi'
  @_hash['last_seen'] = 'last_seen'
  @_hash['mac'] = 'mac'
  @_hash['scan_data'] = 'scan_data'
  @_hash['site_id'] = 'site_id'
  @_hash
end

.nullablesObject

An array for nullable fields



72
73
74
75
76
# File 'lib/mist_api/models/webhook_sdkclient_scan_data_event.rb', line 72

def self.nullables
  %w[
    last_seen
  ]
end

.optionalsObject

An array for optional fields



64
65
66
67
68
69
# File 'lib/mist_api/models/webhook_sdkclient_scan_data_event.rb', line 64

def self.optionals
  %w[
    last_seen
    scan_data
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:



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
168
169
170
171
172
173
# File 'lib/mist_api/models/webhook_sdkclient_scan_data_event.rb', line 135

def self.validate(value)
  if value.instance_of? self
    return (
      APIHelper.valid_type?(value.connection_ap,
                            ->(val) { val.instance_of? String }) and
        APIHelper.valid_type?(value.connection_band,
                              ->(val) { val.instance_of? String }) and
        APIHelper.valid_type?(value.connection_bssid,
                              ->(val) { val.instance_of? String }) and
        APIHelper.valid_type?(value.connection_channel,
                              ->(val) { val.instance_of? Integer }) and
        APIHelper.valid_type?(value.connection_rssi,
                              ->(val) { val.instance_of? Float }) and
        APIHelper.valid_type?(value.mac,
                              ->(val) { val.instance_of? String }) and
        APIHelper.valid_type?(value.site_id,
                              ->(val) { val.instance_of? String })
    )
  end

  return false unless value.instance_of? Hash

  (
    APIHelper.valid_type?(value['connection_ap'],
                          ->(val) { val.instance_of? String }) and
      APIHelper.valid_type?(value['connection_band'],
                            ->(val) { val.instance_of? String }) and
      APIHelper.valid_type?(value['connection_bssid'],
                            ->(val) { val.instance_of? String }) and
      APIHelper.valid_type?(value['connection_channel'],
                            ->(val) { val.instance_of? Integer }) and
      APIHelper.valid_type?(value['connection_rssi'],
                            ->(val) { val.instance_of? Float }) and
      APIHelper.valid_type?(value['mac'],
                            ->(val) { val.instance_of? String }) and
      APIHelper.valid_type?(value['site_id'],
                            ->(val) { val.instance_of? String })
  )
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



185
186
187
188
189
190
191
192
# File 'lib/mist_api/models/webhook_sdkclient_scan_data_event.rb', line 185

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} connection_ap: #{@connection_ap.inspect}, connection_band:"\
  " #{@connection_band.inspect}, connection_bssid: #{@connection_bssid.inspect},"\
  " connection_channel: #{@connection_channel.inspect}, connection_rssi:"\
  " #{@connection_rssi.inspect}, last_seen: #{@last_seen.inspect}, mac: #{@mac.inspect},"\
  " scan_data: #{@scan_data.inspect}, site_id: #{@site_id.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



176
177
178
179
180
181
182
# File 'lib/mist_api/models/webhook_sdkclient_scan_data_event.rb', line 176

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} connection_ap: #{@connection_ap}, connection_band: #{@connection_band},"\
  " connection_bssid: #{@connection_bssid}, connection_channel: #{@connection_channel},"\
  " connection_rssi: #{@connection_rssi}, last_seen: #{@last_seen}, mac: #{@mac}, scan_data:"\
  " #{@scan_data}, site_id: #{@site_id}>"
end