Class: MistApi::WirelessClientSession

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

Overview

WirelessClientSession 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 = nil, band = nil, connect = nil, disconnect = nil, duration = nil, mac = nil, org_id = nil, site_id = nil, ssid = nil, timestamp = nil, wlan_id = nil, client_manufacture = SKIP, for_site = SKIP, tags = SKIP) ⇒ WirelessClientSession

Returns a new instance of WirelessClientSession.



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

def initialize(ap = nil, band = nil, connect = nil, disconnect = nil,
               duration = nil, mac = nil, org_id = nil, site_id = nil,
               ssid = nil, timestamp = nil, wlan_id = nil,
               client_manufacture = SKIP, for_site = SKIP, tags = SKIP)
  @ap = ap
  @band = band
  @client_manufacture = client_manufacture unless client_manufacture == SKIP
  @connect = connect
  @disconnect = disconnect
  @duration = duration
  @for_site = for_site unless for_site == SKIP
  @mac = mac
  @org_id = org_id
  @site_id = site_id
  @ssid = ssid
  @tags = tags unless tags == SKIP
  @timestamp = timestamp
  @wlan_id = wlan_id
end

Instance Attribute Details

#apString

TODO: Write general description for this method

Returns:

  • (String)


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

def ap
  @ap
end

#bandString

TODO: Write general description for this method

Returns:

  • (String)


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

def band
  @band
end

#client_manufactureString

TODO: Write general description for this method

Returns:

  • (String)


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

def client_manufacture
  @client_manufacture
end

#connectInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def connect
  @connect
end

#disconnectInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def disconnect
  @disconnect
end

#durationFloat

TODO: Write general description for this method

Returns:

  • (Float)


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

def duration
  @duration
end

#for_siteTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


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

def for_site
  @for_site
end

#macString

TODO: Write general description for this method

Returns:

  • (String)


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

def mac
  @mac
end

#org_idUUID | String

TODO: Write general description for this method

Returns:

  • (UUID | String)


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

def org_id
  @org_id
end

#site_idUUID | String

TODO: Write general description for this method

Returns:

  • (UUID | String)


50
51
52
# File 'lib/mist_api/models/wireless_client_session.rb', line 50

def site_id
  @site_id
end

#ssidString

TODO: Write general description for this method

Returns:

  • (String)


54
55
56
# File 'lib/mist_api/models/wireless_client_session.rb', line 54

def ssid
  @ssid
end

#tagsArray[String]

TODO: Write general description for this method

Returns:

  • (Array[String])


58
59
60
# File 'lib/mist_api/models/wireless_client_session.rb', line 58

def tags
  @tags
end

#timestampFloat

Epoch (seconds)

Returns:

  • (Float)


62
63
64
# File 'lib/mist_api/models/wireless_client_session.rb', line 62

def timestamp
  @timestamp
end

#wlan_idUUID | String

Epoch (seconds)

Returns:

  • (UUID | String)


66
67
68
# File 'lib/mist_api/models/wireless_client_session.rb', line 66

def wlan_id
  @wlan_id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
153
154
155
156
157
158
159
160
# File 'lib/mist_api/models/wireless_client_session.rb', line 125

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  ap = hash.key?('ap') ? hash['ap'] : nil
  band = hash.key?('band') ? hash['band'] : nil
  connect = hash.key?('connect') ? hash['connect'] : nil
  disconnect = hash.key?('disconnect') ? hash['disconnect'] : nil
  duration = hash.key?('duration') ? hash['duration'] : nil
  mac = hash.key?('mac') ? hash['mac'] : nil
  org_id = hash.key?('org_id') ? hash['org_id'] : nil
  site_id = hash.key?('site_id') ? hash['site_id'] : nil
  ssid = hash.key?('ssid') ? hash['ssid'] : nil
  timestamp = hash.key?('timestamp') ? hash['timestamp'] : nil
  wlan_id = hash.key?('wlan_id') ? hash['wlan_id'] : nil
  client_manufacture =
    hash.key?('client_manufacture') ? hash['client_manufacture'] : SKIP
  for_site = hash.key?('for_site') ? hash['for_site'] : SKIP
  tags = hash.key?('tags') ? hash['tags'] : SKIP

  # Create object from extracted values.
  WirelessClientSession.new(ap,
                            band,
                            connect,
                            disconnect,
                            duration,
                            mac,
                            org_id,
                            site_id,
                            ssid,
                            timestamp,
                            wlan_id,
                            client_manufacture,
                            for_site,
                            tags)
end

.namesObject

A mapping from model property names to API property names.



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/mist_api/models/wireless_client_session.rb', line 69

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['ap'] = 'ap'
  @_hash['band'] = 'band'
  @_hash['client_manufacture'] = 'client_manufacture'
  @_hash['connect'] = 'connect'
  @_hash['disconnect'] = 'disconnect'
  @_hash['duration'] = 'duration'
  @_hash['for_site'] = 'for_site'
  @_hash['mac'] = 'mac'
  @_hash['org_id'] = 'org_id'
  @_hash['site_id'] = 'site_id'
  @_hash['ssid'] = 'ssid'
  @_hash['tags'] = 'tags'
  @_hash['timestamp'] = 'timestamp'
  @_hash['wlan_id'] = 'wlan_id'
  @_hash
end

.nullablesObject

An array for nullable fields



98
99
100
101
102
# File 'lib/mist_api/models/wireless_client_session.rb', line 98

def self.nullables
  %w[
    client_manufacture
  ]
end

.optionalsObject

An array for optional fields



89
90
91
92
93
94
95
# File 'lib/mist_api/models/wireless_client_session.rb', line 89

def self.optionals
  %w[
    client_manufacture
    for_site
    tags
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



172
173
174
175
176
177
178
179
180
# File 'lib/mist_api/models/wireless_client_session.rb', line 172

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} ap: #{@ap.inspect}, band: #{@band.inspect}, client_manufacture:"\
  " #{@client_manufacture.inspect}, connect: #{@connect.inspect}, disconnect:"\
  " #{@disconnect.inspect}, duration: #{@duration.inspect}, for_site: #{@for_site.inspect},"\
  " mac: #{@mac.inspect}, org_id: #{@org_id.inspect}, site_id: #{@site_id.inspect}, ssid:"\
  " #{@ssid.inspect}, tags: #{@tags.inspect}, timestamp: #{@timestamp.inspect}, wlan_id:"\
  " #{@wlan_id.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



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

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} ap: #{@ap}, band: #{@band}, client_manufacture: #{@client_manufacture},"\
  " connect: #{@connect}, disconnect: #{@disconnect}, duration: #{@duration}, for_site:"\
  " #{@for_site}, mac: #{@mac}, org_id: #{@org_id}, site_id: #{@site_id}, ssid: #{@ssid},"\
  " tags: #{@tags}, timestamp: #{@timestamp}, wlan_id: #{@wlan_id}>"
end