Class: MistApi::EventsClient

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

Overview

Client events

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(band = nil, timestamp = nil, ap = SKIP, bssid = SKIP, channel = SKIP, key_mgmt = SKIP, proto = SKIP, ssid = SKIP, text = SKIP, type = SKIP, type_code = SKIP, wlan_id = SKIP) ⇒ EventsClient

Returns a new instance of EventsClient.



104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# File 'lib/mist_api/models/events_client.rb', line 104

def initialize(band = nil, timestamp = nil, ap = SKIP, bssid = SKIP,
               channel = SKIP, key_mgmt = SKIP, proto = SKIP, ssid = SKIP,
               text = SKIP, type = SKIP, type_code = SKIP, wlan_id = SKIP)
  @ap = ap unless ap == SKIP
  @band = band
  @bssid = bssid unless bssid == SKIP
  @channel = channel unless channel == SKIP
  @key_mgmt = key_mgmt unless key_mgmt == SKIP
  @proto = proto unless proto == SKIP
  @ssid = ssid unless ssid == SKIP
  @text = text unless text == SKIP
  @timestamp = timestamp
  @type = type unless type == SKIP
  @type_code = type_code unless type_code == SKIP
  @wlan_id = wlan_id unless wlan_id == SKIP
end

Instance Attribute Details

#apString

TODO: Write general description for this method

Returns:

  • (String)


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

def ap
  @ap
end

#bandDot11BandEnum

enum: ‘24`, `5`, `5-dedicated`, `5-selectable`, `6`, `6-dedicated`, `6-selectable`

Returns:



19
20
21
# File 'lib/mist_api/models/events_client.rb', line 19

def band
  @band
end

#bssidString

enum: ‘24`, `5`, `5-dedicated`, `5-selectable`, `6`, `6-dedicated`, `6-selectable`

Returns:

  • (String)


24
25
26
# File 'lib/mist_api/models/events_client.rb', line 24

def bssid
  @bssid
end

#channelInteger

enum: ‘24`, `5`, `5-dedicated`, `5-selectable`, `6`, `6-dedicated`, `6-selectable`

Returns:

  • (Integer)


29
30
31
# File 'lib/mist_api/models/events_client.rb', line 29

def channel
  @channel
end

#key_mgmtClientKeyMgmtEnum

Key management protocol used for the latest authentication. enum: ‘WPA2-PSK`, `WPA2-PSK-FT`, `WPA2-PSK-SHA256`, `WPA3-EAP-SHA256`, `WPA3-SAE-FT`, `WPA3-SAE-PSK`

Returns:



35
36
37
# File 'lib/mist_api/models/events_client.rb', line 35

def key_mgmt
  @key_mgmt
end

#protoDot11ProtoEnum

enum: ‘a`, `ac`, `ax`, `b`, `be`, `g`, `n`

Returns:



39
40
41
# File 'lib/mist_api/models/events_client.rb', line 39

def proto
  @proto
end

#ssidString

enum: ‘a`, `ac`, `ax`, `b`, `be`, `g`, `n`

Returns:

  • (String)


43
44
45
# File 'lib/mist_api/models/events_client.rb', line 43

def ssid
  @ssid
end

#textString

enum: ‘a`, `ac`, `ax`, `b`, `be`, `g`, `n`

Returns:

  • (String)


47
48
49
# File 'lib/mist_api/models/events_client.rb', line 47

def text
  @text
end

#timestampFloat

Epoch (seconds)

Returns:

  • (Float)


51
52
53
# File 'lib/mist_api/models/events_client.rb', line 51

def timestamp
  @timestamp
end

#typeString

Event type, e.g. MARVIS_EVENT_CLIENT_FBT_FAILURE

Returns:

  • (String)


55
56
57
# File 'lib/mist_api/models/events_client.rb', line 55

def type
  @type
end

#type_codeInteger

For assoc/disassoc events

Returns:

  • (Integer)


59
60
61
# File 'lib/mist_api/models/events_client.rb', line 59

def type_code
  @type_code
end

#wlan_idUUID | String

For assoc/disassoc events

Returns:

  • (UUID | String)


63
64
65
# File 'lib/mist_api/models/events_client.rb', line 63

def wlan_id
  @wlan_id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# File 'lib/mist_api/models/events_client.rb', line 122

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  band = hash.key?('band') ? hash['band'] : nil
  timestamp = hash.key?('timestamp') ? hash['timestamp'] : nil
  ap = hash.key?('ap') ? hash['ap'] : SKIP
  bssid = hash.key?('bssid') ? hash['bssid'] : SKIP
  channel = hash.key?('channel') ? hash['channel'] : SKIP
  key_mgmt = hash.key?('key_mgmt') ? hash['key_mgmt'] : SKIP
  proto = hash.key?('proto') ? hash['proto'] : SKIP
  ssid = hash.key?('ssid') ? hash['ssid'] : SKIP
  text = hash.key?('text') ? hash['text'] : SKIP
  type = hash.key?('type') ? hash['type'] : SKIP
  type_code = hash.key?('type_code') ? hash['type_code'] : SKIP
  wlan_id = hash.key?('wlan_id') ? hash['wlan_id'] : SKIP

  # Create object from extracted values.
  EventsClient.new(band,
                   timestamp,
                   ap,
                   bssid,
                   channel,
                   key_mgmt,
                   proto,
                   ssid,
                   text,
                   type,
                   type_code,
                   wlan_id)
end

.namesObject

A mapping from model property names to API property names.



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/mist_api/models/events_client.rb', line 66

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['ap'] = 'ap'
  @_hash['band'] = 'band'
  @_hash['bssid'] = 'bssid'
  @_hash['channel'] = 'channel'
  @_hash['key_mgmt'] = 'key_mgmt'
  @_hash['proto'] = 'proto'
  @_hash['ssid'] = 'ssid'
  @_hash['text'] = 'text'
  @_hash['timestamp'] = 'timestamp'
  @_hash['type'] = 'type'
  @_hash['type_code'] = 'type_code'
  @_hash['wlan_id'] = 'wlan_id'
  @_hash
end

.nullablesObject

An array for nullable fields



100
101
102
# File 'lib/mist_api/models/events_client.rb', line 100

def self.nullables
  []
end

.optionalsObject

An array for optional fields



84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/mist_api/models/events_client.rb', line 84

def self.optionals
  %w[
    ap
    bssid
    channel
    key_mgmt
    proto
    ssid
    text
    type
    type_code
    wlan_id
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



163
164
165
166
167
168
169
# File 'lib/mist_api/models/events_client.rb', line 163

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} ap: #{@ap.inspect}, band: #{@band.inspect}, bssid: #{@bssid.inspect},"\
  " channel: #{@channel.inspect}, key_mgmt: #{@key_mgmt.inspect}, proto: #{@proto.inspect},"\
  " ssid: #{@ssid.inspect}, text: #{@text.inspect}, timestamp: #{@timestamp.inspect}, type:"\
  " #{@type.inspect}, type_code: #{@type_code.inspect}, wlan_id: #{@wlan_id.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



155
156
157
158
159
160
# File 'lib/mist_api/models/events_client.rb', line 155

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} ap: #{@ap}, band: #{@band}, bssid: #{@bssid}, channel: #{@channel},"\
  " key_mgmt: #{@key_mgmt}, proto: #{@proto}, ssid: #{@ssid}, text: #{@text}, timestamp:"\
  " #{@timestamp}, type: #{@type}, type_code: #{@type_code}, wlan_id: #{@wlan_id}>"
end