Class: MistApi::DiscoveredSwitchAp
- Defined in:
- lib/mist_api/models/discovered_switch_ap.rb
Overview
DiscoveredSwitchAp Model.
Instance Attribute Summary collapse
-
#hostname ⇒ String
TODO: Write general description for this method.
-
#inactive_wired_vlans ⇒ Array[Integer]
TODO: Write general description for this method.
-
#mac ⇒ String
TODO: Write general description for this method.
-
#mwhen ⇒ String
TODO: Write general description for this method.
-
#poe_status ⇒ TrueClass | FalseClass
TODO: Write general description for this method.
-
#port ⇒ String
TODO: Write general description for this method.
-
#port_id ⇒ String
TODO: Write general description for this method.
-
#power_draw ⇒ Float
TODO: Write general description for this method.
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(hostname = SKIP, inactive_wired_vlans = SKIP, mac = SKIP, poe_status = SKIP, port = SKIP, port_id = SKIP, power_draw = SKIP, mwhen = SKIP) ⇒ DiscoveredSwitchAp
constructor
A new instance of DiscoveredSwitchAp.
-
#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(hostname = SKIP, inactive_wired_vlans = SKIP, mac = SKIP, poe_status = SKIP, port = SKIP, port_id = SKIP, power_draw = SKIP, mwhen = SKIP) ⇒ DiscoveredSwitchAp
Returns a new instance of DiscoveredSwitchAp.
77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/mist_api/models/discovered_switch_ap.rb', line 77 def initialize(hostname = SKIP, inactive_wired_vlans = SKIP, mac = SKIP, poe_status = SKIP, port = SKIP, port_id = SKIP, power_draw = SKIP, mwhen = SKIP) @hostname = hostname unless hostname == SKIP @inactive_wired_vlans = inactive_wired_vlans unless inactive_wired_vlans == SKIP @mac = mac unless mac == SKIP @poe_status = poe_status unless poe_status == SKIP @port = port unless port == SKIP @port_id = port_id unless port_id == SKIP @power_draw = power_draw unless power_draw == SKIP @mwhen = mwhen unless mwhen == SKIP end |
Instance Attribute Details
#hostname ⇒ String
TODO: Write general description for this method
14 15 16 |
# File 'lib/mist_api/models/discovered_switch_ap.rb', line 14 def hostname @hostname end |
#inactive_wired_vlans ⇒ Array[Integer]
TODO: Write general description for this method
18 19 20 |
# File 'lib/mist_api/models/discovered_switch_ap.rb', line 18 def inactive_wired_vlans @inactive_wired_vlans end |
#mac ⇒ String
TODO: Write general description for this method
22 23 24 |
# File 'lib/mist_api/models/discovered_switch_ap.rb', line 22 def mac @mac end |
#mwhen ⇒ String
TODO: Write general description for this method
42 43 44 |
# File 'lib/mist_api/models/discovered_switch_ap.rb', line 42 def mwhen @mwhen end |
#poe_status ⇒ TrueClass | FalseClass
TODO: Write general description for this method
26 27 28 |
# File 'lib/mist_api/models/discovered_switch_ap.rb', line 26 def poe_status @poe_status end |
#port ⇒ String
TODO: Write general description for this method
30 31 32 |
# File 'lib/mist_api/models/discovered_switch_ap.rb', line 30 def port @port end |
#port_id ⇒ String
TODO: Write general description for this method
34 35 36 |
# File 'lib/mist_api/models/discovered_switch_ap.rb', line 34 def port_id @port_id end |
#power_draw ⇒ Float
TODO: Write general description for this method
38 39 40 |
# File 'lib/mist_api/models/discovered_switch_ap.rb', line 38 def power_draw @power_draw end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/mist_api/models/discovered_switch_ap.rb', line 91 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. hostname = hash.key?('hostname') ? hash['hostname'] : SKIP inactive_wired_vlans = hash.key?('inactive_wired_vlans') ? hash['inactive_wired_vlans'] : SKIP mac = hash.key?('mac') ? hash['mac'] : SKIP poe_status = hash.key?('poe_status') ? hash['poe_status'] : SKIP port = hash.key?('port') ? hash['port'] : SKIP port_id = hash.key?('port_id') ? hash['port_id'] : SKIP power_draw = hash.key?('power_draw') ? hash['power_draw'] : SKIP mwhen = hash.key?('when') ? hash['when'] : SKIP # Create object from extracted values. DiscoveredSwitchAp.new(hostname, inactive_wired_vlans, mac, poe_status, port, port_id, power_draw, mwhen) end |
.names ⇒ Object
A mapping from model property names to API property names.
45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/mist_api/models/discovered_switch_ap.rb', line 45 def self.names @_hash = {} if @_hash.nil? @_hash['hostname'] = 'hostname' @_hash['inactive_wired_vlans'] = 'inactive_wired_vlans' @_hash['mac'] = 'mac' @_hash['poe_status'] = 'poe_status' @_hash['port'] = 'port' @_hash['port_id'] = 'port_id' @_hash['power_draw'] = 'power_draw' @_hash['mwhen'] = 'when' @_hash end |
.nullables ⇒ Object
An array for nullable fields
73 74 75 |
# File 'lib/mist_api/models/discovered_switch_ap.rb', line 73 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/mist_api/models/discovered_switch_ap.rb', line 59 def self.optionals %w[ hostname inactive_wired_vlans mac poe_status port port_id power_draw mwhen ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
125 126 127 128 129 130 131 |
# File 'lib/mist_api/models/discovered_switch_ap.rb', line 125 def inspect class_name = self.class.name.split('::').last "<#{class_name} hostname: #{@hostname.inspect}, inactive_wired_vlans:"\ " #{@inactive_wired_vlans.inspect}, mac: #{@mac.inspect}, poe_status:"\ " #{@poe_status.inspect}, port: #{@port.inspect}, port_id: #{@port_id.inspect}, power_draw:"\ " #{@power_draw.inspect}, mwhen: #{@mwhen.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
117 118 119 120 121 122 |
# File 'lib/mist_api/models/discovered_switch_ap.rb', line 117 def to_s class_name = self.class.name.split('::').last "<#{class_name} hostname: #{@hostname}, inactive_wired_vlans: #{@inactive_wired_vlans},"\ " mac: #{@mac}, poe_status: #{@poe_status}, port: #{@port}, port_id: #{@port_id},"\ " power_draw: #{@power_draw}, mwhen: #{@mwhen}>" end |