Class: MistApi::StatsDeviceOther
- Defined in:
- lib/mist_api/models/stats_device_other.rb
Overview
StatsDeviceOther Model.
Instance Attribute Summary collapse
-
#cached_stats ⇒ TrueClass | FalseClass
TODO: Write general description for this method.
-
#config_status ⇒ String
TODO: Write general description for this method.
-
#connected_devices ⇒ Hash[String, StatsDeviceOtherConnectedDevice]
Property key is the connected device MAC Address.
-
#interfaces ⇒ Hash[String, StatsDeviceOtherInterface]
Property key is the interface name.
-
#last_config ⇒ Integer
Property key is the interface name.
-
#last_seen ⇒ Float
Last seen timestamp.
-
#lldp_enabled ⇒ TrueClass | FalseClass
Last seen timestamp.
-
#mac ⇒ String
Last seen timestamp.
-
#status ⇒ String
Last seen timestamp.
-
#uptime ⇒ Integer
Last seen timestamp.
-
#vendor ⇒ String
Last seen timestamp.
-
#vendor_specific ⇒ StatsDeviceOtherVendorSpecific
When ‘vendor`==`cradlepoint`.
-
#version ⇒ String
When ‘vendor`==`cradlepoint`.
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(cached_stats = SKIP, config_status = SKIP, connected_devices = SKIP, interfaces = SKIP, last_config = SKIP, last_seen = SKIP, lldp_enabled = SKIP, mac = SKIP, status = SKIP, uptime = SKIP, vendor = SKIP, vendor_specific = SKIP, version = SKIP) ⇒ StatsDeviceOther
constructor
A new instance of StatsDeviceOther.
-
#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(cached_stats = SKIP, config_status = SKIP, connected_devices = SKIP, interfaces = SKIP, last_config = SKIP, last_seen = SKIP, lldp_enabled = SKIP, mac = SKIP, status = SKIP, uptime = SKIP, vendor = SKIP, vendor_specific = SKIP, version = SKIP) ⇒ StatsDeviceOther
Returns a new instance of StatsDeviceOther.
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/mist_api/models/stats_device_other.rb', line 109 def initialize(cached_stats = SKIP, config_status = SKIP, connected_devices = SKIP, interfaces = SKIP, last_config = SKIP, last_seen = SKIP, lldp_enabled = SKIP, mac = SKIP, status = SKIP, uptime = SKIP, vendor = SKIP, vendor_specific = SKIP, version = SKIP) @cached_stats = cached_stats unless cached_stats == SKIP @config_status = config_status unless config_status == SKIP @connected_devices = connected_devices unless connected_devices == SKIP @interfaces = interfaces unless interfaces == SKIP @last_config = last_config unless last_config == SKIP @last_seen = last_seen unless last_seen == SKIP @lldp_enabled = lldp_enabled unless lldp_enabled == SKIP @mac = mac unless mac == SKIP @status = status unless status == SKIP @uptime = uptime unless uptime == SKIP @vendor = vendor unless vendor == SKIP @vendor_specific = vendor_specific unless vendor_specific == SKIP @version = version unless version == SKIP end |
Instance Attribute Details
#cached_stats ⇒ TrueClass | FalseClass
TODO: Write general description for this method
14 15 16 |
# File 'lib/mist_api/models/stats_device_other.rb', line 14 def cached_stats @cached_stats end |
#config_status ⇒ String
TODO: Write general description for this method
18 19 20 |
# File 'lib/mist_api/models/stats_device_other.rb', line 18 def config_status @config_status end |
#connected_devices ⇒ Hash[String, StatsDeviceOtherConnectedDevice]
Property key is the connected device MAC Address
22 23 24 |
# File 'lib/mist_api/models/stats_device_other.rb', line 22 def connected_devices @connected_devices end |
#interfaces ⇒ Hash[String, StatsDeviceOtherInterface]
Property key is the interface name
26 27 28 |
# File 'lib/mist_api/models/stats_device_other.rb', line 26 def interfaces @interfaces end |
#last_config ⇒ Integer
Property key is the interface name
30 31 32 |
# File 'lib/mist_api/models/stats_device_other.rb', line 30 def last_config @last_config end |
#last_seen ⇒ Float
Last seen timestamp
34 35 36 |
# File 'lib/mist_api/models/stats_device_other.rb', line 34 def last_seen @last_seen end |
#lldp_enabled ⇒ TrueClass | FalseClass
Last seen timestamp
38 39 40 |
# File 'lib/mist_api/models/stats_device_other.rb', line 38 def lldp_enabled @lldp_enabled end |
#mac ⇒ String
Last seen timestamp
42 43 44 |
# File 'lib/mist_api/models/stats_device_other.rb', line 42 def mac @mac end |
#status ⇒ String
Last seen timestamp
46 47 48 |
# File 'lib/mist_api/models/stats_device_other.rb', line 46 def status @status end |
#uptime ⇒ Integer
Last seen timestamp
50 51 52 |
# File 'lib/mist_api/models/stats_device_other.rb', line 50 def uptime @uptime end |
#vendor ⇒ String
Last seen timestamp
54 55 56 |
# File 'lib/mist_api/models/stats_device_other.rb', line 54 def vendor @vendor end |
#vendor_specific ⇒ StatsDeviceOtherVendorSpecific
When ‘vendor`==`cradlepoint`
58 59 60 |
# File 'lib/mist_api/models/stats_device_other.rb', line 58 def vendor_specific @vendor_specific end |
#version ⇒ String
When ‘vendor`==`cradlepoint`
62 63 64 |
# File 'lib/mist_api/models/stats_device_other.rb', line 62 def version @version end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 168 |
# File 'lib/mist_api/models/stats_device_other.rb', line 130 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. cached_stats = hash.key?('cached_stats') ? hash['cached_stats'] : SKIP config_status = hash.key?('config_status') ? hash['config_status'] : SKIP connected_devices = StatsDeviceOtherConnectedDevice.from_hash(hash['connected_devices']) if hash['connected_devices'] connected_devices = SKIP unless hash.key?('connected_devices') interfaces = StatsDeviceOtherInterface.from_hash(hash['interfaces']) if hash['interfaces'] interfaces = SKIP unless hash.key?('interfaces') last_config = hash.key?('last_config') ? hash['last_config'] : SKIP last_seen = hash.key?('last_seen') ? hash['last_seen'] : SKIP lldp_enabled = hash.key?('lldp_enabled') ? hash['lldp_enabled'] : SKIP mac = hash.key?('mac') ? hash['mac'] : SKIP status = hash.key?('status') ? hash['status'] : SKIP uptime = hash.key?('uptime') ? hash['uptime'] : SKIP vendor = hash.key?('vendor') ? hash['vendor'] : SKIP vendor_specific = StatsDeviceOtherVendorSpecific.from_hash(hash['vendor_specific']) if hash['vendor_specific'] version = hash.key?('version') ? hash['version'] : SKIP # Create object from extracted values. StatsDeviceOther.new(cached_stats, config_status, connected_devices, interfaces, last_config, last_seen, lldp_enabled, mac, status, uptime, vendor, vendor_specific, version) end |
.names ⇒ Object
A mapping from model property names to API property names.
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/mist_api/models/stats_device_other.rb', line 65 def self.names @_hash = {} if @_hash.nil? @_hash['cached_stats'] = 'cached_stats' @_hash['config_status'] = 'config_status' @_hash['connected_devices'] = 'connected_devices' @_hash['interfaces'] = 'interfaces' @_hash['last_config'] = 'last_config' @_hash['last_seen'] = 'last_seen' @_hash['lldp_enabled'] = 'lldp_enabled' @_hash['mac'] = 'mac' @_hash['status'] = 'status' @_hash['uptime'] = 'uptime' @_hash['vendor'] = 'vendor' @_hash['vendor_specific'] = 'vendor_specific' @_hash['version'] = 'version' @_hash end |
.nullables ⇒ Object
An array for nullable fields
103 104 105 106 107 |
# File 'lib/mist_api/models/stats_device_other.rb', line 103 def self.nullables %w[ last_seen ] end |
.optionals ⇒ Object
An array for optional fields
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/mist_api/models/stats_device_other.rb', line 84 def self.optionals %w[ cached_stats config_status connected_devices interfaces last_config last_seen lldp_enabled mac status uptime vendor vendor_specific version ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
181 182 183 184 185 186 187 188 189 |
# File 'lib/mist_api/models/stats_device_other.rb', line 181 def inspect class_name = self.class.name.split('::').last "<#{class_name} cached_stats: #{@cached_stats.inspect}, config_status:"\ " #{@config_status.inspect}, connected_devices: #{@connected_devices.inspect}, interfaces:"\ " #{@interfaces.inspect}, last_config: #{@last_config.inspect}, last_seen:"\ " #{@last_seen.inspect}, lldp_enabled: #{@lldp_enabled.inspect}, mac: #{@mac.inspect},"\ " status: #{@status.inspect}, uptime: #{@uptime.inspect}, vendor: #{@vendor.inspect},"\ " vendor_specific: #{@vendor_specific.inspect}, version: #{@version.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
171 172 173 174 175 176 177 178 |
# File 'lib/mist_api/models/stats_device_other.rb', line 171 def to_s class_name = self.class.name.split('::').last "<#{class_name} cached_stats: #{@cached_stats}, config_status: #{@config_status},"\ " connected_devices: #{@connected_devices}, interfaces: #{@interfaces}, last_config:"\ " #{@last_config}, last_seen: #{@last_seen}, lldp_enabled: #{@lldp_enabled}, mac: #{@mac},"\ " status: #{@status}, uptime: #{@uptime}, vendor: #{@vendor}, vendor_specific:"\ " #{@vendor_specific}, version: #{@version}>" end |