Class: MistApi::StatsWiredClient
- Defined in:
- lib/mist_api/models/stats_wired_client.rb
Overview
StatsWiredClient Model.
Instance Attribute Summary collapse
-
#auth_state ⇒ String
Client authorization status.
-
#device_id ⇒ String
Device ID the client is connected to.
-
#eth_port ⇒ String
Port on AP where the wired client is connected.
-
#last_seen ⇒ Float
Time when last Tx/Rx observed.
-
#mac ⇒ String
Client mac.
-
#rx_bytes ⇒ Integer
Amount of traffic received since connection.
-
#rx_pkts ⇒ Integer
Amount of packets received since connection.
-
#site_id ⇒ UUID | String
Amount of packets received since connection.
-
#tx_bytes ⇒ Integer
Amount of traffic sent since connection.
-
#tx_pkts ⇒ Integer
Amount of packets sent since connection.
-
#uptime ⇒ Float
How long, in seconds, has the client been connected.
-
#vlan_id ⇒ Float
VLAN id, could be empty.
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.
Instance Method Summary collapse
-
#initialize(mac = nil, auth_state = SKIP, device_id = SKIP, eth_port = SKIP, last_seen = SKIP, rx_bytes = SKIP, rx_pkts = SKIP, site_id = SKIP, tx_bytes = SKIP, tx_pkts = SKIP, uptime = SKIP, vlan_id = SKIP, additional_properties = nil) ⇒ StatsWiredClient
constructor
A new instance of StatsWiredClient.
-
#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, auth_state = SKIP, device_id = SKIP, eth_port = SKIP, last_seen = SKIP, rx_bytes = SKIP, rx_pkts = SKIP, site_id = SKIP, tx_bytes = SKIP, tx_pkts = SKIP, uptime = SKIP, vlan_id = SKIP, additional_properties = nil) ⇒ StatsWiredClient
Returns a new instance of StatsWiredClient.
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
# File 'lib/mist_api/models/stats_wired_client.rb', line 105 def initialize(mac = nil, auth_state = SKIP, device_id = SKIP, eth_port = SKIP, last_seen = SKIP, rx_bytes = SKIP, rx_pkts = SKIP, site_id = SKIP, tx_bytes = SKIP, tx_pkts = SKIP, uptime = SKIP, vlan_id = SKIP, additional_properties = nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @auth_state = auth_state unless auth_state == SKIP @device_id = device_id unless device_id == SKIP @eth_port = eth_port unless eth_port == SKIP @last_seen = last_seen unless last_seen == SKIP @mac = mac @rx_bytes = rx_bytes unless rx_bytes == SKIP @rx_pkts = rx_pkts unless rx_pkts == SKIP @site_id = site_id unless site_id == SKIP @tx_bytes = tx_bytes unless tx_bytes == SKIP @tx_pkts = tx_pkts unless tx_pkts == SKIP @uptime = uptime unless uptime == SKIP @vlan_id = vlan_id unless vlan_id == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#auth_state ⇒ String
Client authorization status
14 15 16 |
# File 'lib/mist_api/models/stats_wired_client.rb', line 14 def auth_state @auth_state end |
#device_id ⇒ String
Device ID the client is connected to
18 19 20 |
# File 'lib/mist_api/models/stats_wired_client.rb', line 18 def device_id @device_id end |
#eth_port ⇒ String
Port on AP where the wired client is connected
22 23 24 |
# File 'lib/mist_api/models/stats_wired_client.rb', line 22 def eth_port @eth_port end |
#last_seen ⇒ Float
Time when last Tx/Rx observed
26 27 28 |
# File 'lib/mist_api/models/stats_wired_client.rb', line 26 def last_seen @last_seen end |
#mac ⇒ String
Client mac
30 31 32 |
# File 'lib/mist_api/models/stats_wired_client.rb', line 30 def mac @mac end |
#rx_bytes ⇒ Integer
Amount of traffic received since connection
34 35 36 |
# File 'lib/mist_api/models/stats_wired_client.rb', line 34 def rx_bytes @rx_bytes end |
#rx_pkts ⇒ Integer
Amount of packets received since connection
38 39 40 |
# File 'lib/mist_api/models/stats_wired_client.rb', line 38 def rx_pkts @rx_pkts end |
#site_id ⇒ UUID | String
Amount of packets received since connection
42 43 44 |
# File 'lib/mist_api/models/stats_wired_client.rb', line 42 def site_id @site_id end |
#tx_bytes ⇒ Integer
Amount of traffic sent since connection
46 47 48 |
# File 'lib/mist_api/models/stats_wired_client.rb', line 46 def tx_bytes @tx_bytes end |
#tx_pkts ⇒ Integer
Amount of packets sent since connection
50 51 52 |
# File 'lib/mist_api/models/stats_wired_client.rb', line 50 def tx_pkts @tx_pkts end |
#uptime ⇒ Float
How long, in seconds, has the client been connected
54 55 56 |
# File 'lib/mist_api/models/stats_wired_client.rb', line 54 def uptime @uptime end |
#vlan_id ⇒ Float
VLAN id, could be empty
58 59 60 |
# File 'lib/mist_api/models/stats_wired_client.rb', line 58 def vlan_id @vlan_id end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 161 162 163 164 165 166 167 |
# File 'lib/mist_api/models/stats_wired_client.rb', line 129 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. mac = hash.key?('mac') ? hash['mac'] : nil auth_state = hash.key?('auth_state') ? hash['auth_state'] : SKIP device_id = hash.key?('device_id') ? hash['device_id'] : SKIP eth_port = hash.key?('eth_port') ? hash['eth_port'] : SKIP last_seen = hash.key?('last_seen') ? hash['last_seen'] : SKIP rx_bytes = hash.key?('rx_bytes') ? hash['rx_bytes'] : SKIP rx_pkts = hash.key?('rx_pkts') ? hash['rx_pkts'] : SKIP site_id = hash.key?('site_id') ? hash['site_id'] : SKIP tx_bytes = hash.key?('tx_bytes') ? hash['tx_bytes'] : SKIP tx_pkts = hash.key?('tx_pkts') ? hash['tx_pkts'] : SKIP uptime = hash.key?('uptime') ? hash['uptime'] : SKIP vlan_id = hash.key?('vlan_id') ? hash['vlan_id'] : SKIP # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. StatsWiredClient.new(mac, auth_state, device_id, eth_port, last_seen, rx_bytes, rx_pkts, site_id, tx_bytes, tx_pkts, uptime, vlan_id, additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/mist_api/models/stats_wired_client.rb', line 61 def self.names @_hash = {} if @_hash.nil? @_hash['auth_state'] = 'auth_state' @_hash['device_id'] = 'device_id' @_hash['eth_port'] = 'eth_port' @_hash['last_seen'] = 'last_seen' @_hash['mac'] = 'mac' @_hash['rx_bytes'] = 'rx_bytes' @_hash['rx_pkts'] = 'rx_pkts' @_hash['site_id'] = 'site_id' @_hash['tx_bytes'] = 'tx_bytes' @_hash['tx_pkts'] = 'tx_pkts' @_hash['uptime'] = 'uptime' @_hash['vlan_id'] = 'vlan_id' @_hash end |
.nullables ⇒ Object
An array for nullable fields
96 97 98 99 100 101 102 103 |
# File 'lib/mist_api/models/stats_wired_client.rb', line 96 def self.nullables %w[ rx_bytes rx_pkts tx_bytes tx_pkts ] end |
.optionals ⇒ Object
An array for optional fields
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/mist_api/models/stats_wired_client.rb', line 79 def self.optionals %w[ auth_state device_id eth_port last_seen rx_bytes rx_pkts site_id tx_bytes tx_pkts uptime vlan_id ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
179 180 181 182 183 184 185 186 187 |
# File 'lib/mist_api/models/stats_wired_client.rb', line 179 def inspect class_name = self.class.name.split('::').last "<#{class_name} auth_state: #{@auth_state.inspect}, device_id: #{@device_id.inspect},"\ " eth_port: #{@eth_port.inspect}, last_seen: #{@last_seen.inspect}, mac: #{@mac.inspect},"\ " rx_bytes: #{@rx_bytes.inspect}, rx_pkts: #{@rx_pkts.inspect}, site_id:"\ " #{@site_id.inspect}, tx_bytes: #{@tx_bytes.inspect}, tx_pkts: #{@tx_pkts.inspect}, uptime:"\ " #{@uptime.inspect}, vlan_id: #{@vlan_id.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
170 171 172 173 174 175 176 |
# File 'lib/mist_api/models/stats_wired_client.rb', line 170 def to_s class_name = self.class.name.split('::').last "<#{class_name} auth_state: #{@auth_state}, device_id: #{@device_id}, eth_port:"\ " #{@eth_port}, last_seen: #{@last_seen}, mac: #{@mac}, rx_bytes: #{@rx_bytes}, rx_pkts:"\ " #{@rx_pkts}, site_id: #{@site_id}, tx_bytes: #{@tx_bytes}, tx_pkts: #{@tx_pkts}, uptime:"\ " #{@uptime}, vlan_id: #{@vlan_id}, additional_properties: #{@additional_properties}>" end |