Class: MistApi::WebhookNacAccountingEvent

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

Overview

WebhookNacAccountingEvent 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(ap = SKIP, auth_type = SKIP, bssid = SKIP, client_ip = SKIP, client_type = SKIP, mac = SKIP, nas_vendor = SKIP, org_id = SKIP, rx_pkts = SKIP, site_id = SKIP, ssid = SKIP, timestamp = SKIP, tx_pkts = SKIP, type = SKIP, username = SKIP) ⇒ WebhookNacAccountingEvent

Returns a new instance of WebhookNacAccountingEvent.



124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# File 'lib/mist_api/models/webhook_nac_accounting_event.rb', line 124

def initialize(ap = SKIP, auth_type = SKIP, bssid = SKIP, client_ip = SKIP,
               client_type = SKIP, mac = SKIP, nas_vendor = SKIP,
               org_id = SKIP, rx_pkts = SKIP, site_id = SKIP, ssid = SKIP,
               timestamp = SKIP, tx_pkts = SKIP, type = SKIP,
               username = SKIP)
  @ap = ap unless ap == SKIP
  @auth_type = auth_type unless auth_type == SKIP
  @bssid = bssid unless bssid == SKIP
  @client_ip = client_ip unless client_ip == SKIP
  @client_type = client_type unless client_type == SKIP
  @mac = mac unless mac == SKIP
  @nas_vendor = nas_vendor unless nas_vendor == SKIP
  @org_id = org_id unless org_id == SKIP
  @rx_pkts = rx_pkts unless rx_pkts == SKIP
  @site_id = site_id unless site_id == SKIP
  @ssid = ssid unless ssid == SKIP
  @timestamp = timestamp unless timestamp == SKIP
  @tx_pkts = tx_pkts unless tx_pkts == SKIP
  @type = type unless type == SKIP
  @username = username unless username == SKIP
end

Instance Attribute Details

#apString

MAC address of the AP the client roamed or disconnected from

Returns:

  • (String)


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

def ap
  @ap
end

#auth_typeNacAuthTypeEnum

enum: ‘cert`, `device-auth`, `eap-teap`, `eap-tls`, `eap-ttls`, `idp`, `mab`, `eap-peap`

Returns:



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

def auth_type
  @auth_type
end

#bssidString

MAC physical address of the access point

Returns:

  • (String)


23
24
25
# File 'lib/mist_api/models/webhook_nac_accounting_event.rb', line 23

def bssid
  @bssid
end

#client_ipString

IP Address of client

Returns:

  • (String)


27
28
29
# File 'lib/mist_api/models/webhook_nac_accounting_event.rb', line 27

def client_ip
  @client_ip
end

#client_typeString

Client type E.g. “wired”, “wireless”, “vty”

Returns:

  • (String)


31
32
33
# File 'lib/mist_api/models/webhook_nac_accounting_event.rb', line 31

def client_type
  @client_type
end

#macString

Client’s MAC Address

Returns:

  • (String)


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

def mac
  @mac
end

#nas_vendorString

NAS Device vendor name E.g. “Juniper”, “Cisco”

Returns:

  • (String)


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

def nas_vendor
  @nas_vendor
end

#org_idUUID | String

NAS Device vendor name E.g. “Juniper”, “Cisco”

Returns:

  • (UUID | String)


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

def org_id
  @org_id
end

#rx_pktsInteger

Amount of packets received since connection

Returns:

  • (Integer)


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

def rx_pkts
  @rx_pkts
end

#site_idUUID | String

Amount of packets received since connection

Returns:

  • (UUID | String)


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

def site_id
  @site_id
end

#ssidString

ESSID

Returns:

  • (String)


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

def ssid
  @ssid
end

#timestampFloat

Epoch (seconds)

Returns:

  • (Float)


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

def timestamp
  @timestamp
end

#tx_pktsInteger

Amount of packets sent since connection

Returns:

  • (Integer)


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

def tx_pkts
  @tx_pkts
end

#typeString

Type of event. E.g. “ACCOUNTING_START”, “ACCOUNTING_UPDATE”, “ACCOUNTING_STOP”

Returns:

  • (String)


68
69
70
# File 'lib/mist_api/models/webhook_nac_accounting_event.rb', line 68

def type
  @type
end

#usernameString

Username authenticated with

Returns:

  • (String)


72
73
74
# File 'lib/mist_api/models/webhook_nac_accounting_event.rb', line 72

def username
  @username
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
174
175
176
177
178
179
180
181
182
183
# File 'lib/mist_api/models/webhook_nac_accounting_event.rb', line 147

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  ap = hash.key?('ap') ? hash['ap'] : SKIP
  auth_type = hash.key?('auth_type') ? hash['auth_type'] : SKIP
  bssid = hash.key?('bssid') ? hash['bssid'] : SKIP
  client_ip = hash.key?('client_ip') ? hash['client_ip'] : SKIP
  client_type = hash.key?('client_type') ? hash['client_type'] : SKIP
  mac = hash.key?('mac') ? hash['mac'] : SKIP
  nas_vendor = hash.key?('nas_vendor') ? hash['nas_vendor'] : SKIP
  org_id = hash.key?('org_id') ? hash['org_id'] : SKIP
  rx_pkts = hash.key?('rx_pkts') ? hash['rx_pkts'] : SKIP
  site_id = hash.key?('site_id') ? hash['site_id'] : SKIP
  ssid = hash.key?('ssid') ? hash['ssid'] : SKIP
  timestamp = hash.key?('timestamp') ? hash['timestamp'] : SKIP
  tx_pkts = hash.key?('tx_pkts') ? hash['tx_pkts'] : SKIP
  type = hash.key?('type') ? hash['type'] : SKIP
  username = hash.key?('username') ? hash['username'] : SKIP

  # Create object from extracted values.
  WebhookNacAccountingEvent.new(ap,
                                auth_type,
                                bssid,
                                client_ip,
                                client_type,
                                mac,
                                nas_vendor,
                                org_id,
                                rx_pkts,
                                site_id,
                                ssid,
                                timestamp,
                                tx_pkts,
                                type,
                                username)
end

.namesObject

A mapping from model property names to API property names.



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/mist_api/models/webhook_nac_accounting_event.rb', line 75

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['ap'] = 'ap'
  @_hash['auth_type'] = 'auth_type'
  @_hash['bssid'] = 'bssid'
  @_hash['client_ip'] = 'client_ip'
  @_hash['client_type'] = 'client_type'
  @_hash['mac'] = 'mac'
  @_hash['nas_vendor'] = 'nas_vendor'
  @_hash['org_id'] = 'org_id'
  @_hash['rx_pkts'] = 'rx_pkts'
  @_hash['site_id'] = 'site_id'
  @_hash['ssid'] = 'ssid'
  @_hash['timestamp'] = 'timestamp'
  @_hash['tx_pkts'] = 'tx_pkts'
  @_hash['type'] = 'type'
  @_hash['username'] = 'username'
  @_hash
end

.nullablesObject

An array for nullable fields



117
118
119
120
121
122
# File 'lib/mist_api/models/webhook_nac_accounting_event.rb', line 117

def self.nullables
  %w[
    rx_pkts
    tx_pkts
  ]
end

.optionalsObject

An array for optional fields



96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/mist_api/models/webhook_nac_accounting_event.rb', line 96

def self.optionals
  %w[
    ap
    auth_type
    bssid
    client_ip
    client_type
    mac
    nas_vendor
    org_id
    rx_pkts
    site_id
    ssid
    timestamp
    tx_pkts
    type
    username
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:



187
188
189
190
191
192
193
# File 'lib/mist_api/models/webhook_nac_accounting_event.rb', line 187

def self.validate(value)
  return true if value.instance_of? self

  return false unless value.instance_of? Hash

  true
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



205
206
207
208
209
210
211
212
213
# File 'lib/mist_api/models/webhook_nac_accounting_event.rb', line 205

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} ap: #{@ap.inspect}, auth_type: #{@auth_type.inspect}, bssid:"\
  " #{@bssid.inspect}, client_ip: #{@client_ip.inspect}, client_type: #{@client_type.inspect},"\
  " mac: #{@mac.inspect}, nas_vendor: #{@nas_vendor.inspect}, org_id: #{@org_id.inspect},"\
  " rx_pkts: #{@rx_pkts.inspect}, site_id: #{@site_id.inspect}, ssid: #{@ssid.inspect},"\
  " timestamp: #{@timestamp.inspect}, tx_pkts: #{@tx_pkts.inspect}, type: #{@type.inspect},"\
  " username: #{@username.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



196
197
198
199
200
201
202
# File 'lib/mist_api/models/webhook_nac_accounting_event.rb', line 196

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} ap: #{@ap}, auth_type: #{@auth_type}, bssid: #{@bssid}, client_ip:"\
  " #{@client_ip}, client_type: #{@client_type}, mac: #{@mac}, nas_vendor: #{@nas_vendor},"\
  " org_id: #{@org_id}, rx_pkts: #{@rx_pkts}, site_id: #{@site_id}, ssid: #{@ssid}, timestamp:"\
  " #{@timestamp}, tx_pkts: #{@tx_pkts}, type: #{@type}, username: #{@username}>"
end