Class: MistApi::DiscoveredSwitch
- Defined in:
- lib/mist_api/models/discovered_switch.rb
Overview
DiscoveredSwitch Model.
Instance Attribute Summary collapse
-
#adopted ⇒ TrueClass | FalseClass
TODO: Write general description for this method.
-
#ap_redundancy ⇒ ApRedundancy
TODO: Write general description for this method.
-
#aps ⇒ Array[DiscoveredSwitchAp]
TODO: Write general description for this method.
-
#chassis_id ⇒ Array[String]
TODO: Write general description for this method.
-
#for_site ⇒ TrueClass | FalseClass
TODO: Write general description for this method.
-
#mgmt_addr ⇒ String
TODO: Write general description for this method.
-
#model ⇒ String
TODO: Write general description for this method.
-
#org_id ⇒ UUID | String
TODO: Write general description for this method.
-
#site_id ⇒ UUID | String
TODO: Write general description for this method.
-
#system_desc ⇒ String
TODO: Write general description for this method.
-
#system_name ⇒ String
TODO: Write general description for this method.
-
#timestamp ⇒ Float
Epoch (seconds).
-
#vendor ⇒ String
Epoch (seconds).
-
#version ⇒ String
Epoch (seconds).
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(adopted = SKIP, ap_redundancy = SKIP, aps = SKIP, chassis_id = SKIP, for_site = SKIP, mgmt_addr = SKIP, model = SKIP, org_id = SKIP, site_id = SKIP, system_desc = SKIP, system_name = SKIP, timestamp = SKIP, vendor = SKIP, version = SKIP) ⇒ DiscoveredSwitch
constructor
A new instance of DiscoveredSwitch.
-
#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(adopted = SKIP, ap_redundancy = SKIP, aps = SKIP, chassis_id = SKIP, for_site = SKIP, mgmt_addr = SKIP, model = SKIP, org_id = SKIP, site_id = SKIP, system_desc = SKIP, system_name = SKIP, timestamp = SKIP, vendor = SKIP, version = SKIP) ⇒ DiscoveredSwitch
Returns a new instance of DiscoveredSwitch.
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
# File 'lib/mist_api/models/discovered_switch.rb', line 113 def initialize(adopted = SKIP, ap_redundancy = SKIP, aps = SKIP, chassis_id = SKIP, for_site = SKIP, mgmt_addr = SKIP, model = SKIP, org_id = SKIP, site_id = SKIP, system_desc = SKIP, system_name = SKIP, = SKIP, vendor = SKIP, version = SKIP) @adopted = adopted unless adopted == SKIP @ap_redundancy = ap_redundancy unless ap_redundancy == SKIP @aps = aps unless aps == SKIP @chassis_id = chassis_id unless chassis_id == SKIP @for_site = for_site unless for_site == SKIP @mgmt_addr = mgmt_addr unless mgmt_addr == SKIP @model = model unless model == SKIP @org_id = org_id unless org_id == SKIP @site_id = site_id unless site_id == SKIP @system_desc = system_desc unless system_desc == SKIP @system_name = system_name unless system_name == SKIP @timestamp = unless == SKIP @vendor = vendor unless vendor == SKIP @version = version unless version == SKIP end |
Instance Attribute Details
#adopted ⇒ TrueClass | FalseClass
TODO: Write general description for this method
14 15 16 |
# File 'lib/mist_api/models/discovered_switch.rb', line 14 def adopted @adopted end |
#ap_redundancy ⇒ ApRedundancy
TODO: Write general description for this method
18 19 20 |
# File 'lib/mist_api/models/discovered_switch.rb', line 18 def ap_redundancy @ap_redundancy end |
#aps ⇒ Array[DiscoveredSwitchAp]
TODO: Write general description for this method
22 23 24 |
# File 'lib/mist_api/models/discovered_switch.rb', line 22 def aps @aps end |
#chassis_id ⇒ Array[String]
TODO: Write general description for this method
26 27 28 |
# File 'lib/mist_api/models/discovered_switch.rb', line 26 def chassis_id @chassis_id end |
#for_site ⇒ TrueClass | FalseClass
TODO: Write general description for this method
30 31 32 |
# File 'lib/mist_api/models/discovered_switch.rb', line 30 def for_site @for_site end |
#mgmt_addr ⇒ String
TODO: Write general description for this method
34 35 36 |
# File 'lib/mist_api/models/discovered_switch.rb', line 34 def mgmt_addr @mgmt_addr end |
#model ⇒ String
TODO: Write general description for this method
38 39 40 |
# File 'lib/mist_api/models/discovered_switch.rb', line 38 def model @model end |
#org_id ⇒ UUID | String
TODO: Write general description for this method
42 43 44 |
# File 'lib/mist_api/models/discovered_switch.rb', line 42 def org_id @org_id end |
#site_id ⇒ UUID | String
TODO: Write general description for this method
46 47 48 |
# File 'lib/mist_api/models/discovered_switch.rb', line 46 def site_id @site_id end |
#system_desc ⇒ String
TODO: Write general description for this method
50 51 52 |
# File 'lib/mist_api/models/discovered_switch.rb', line 50 def system_desc @system_desc end |
#system_name ⇒ String
TODO: Write general description for this method
54 55 56 |
# File 'lib/mist_api/models/discovered_switch.rb', line 54 def system_name @system_name end |
#timestamp ⇒ Float
Epoch (seconds)
58 59 60 |
# File 'lib/mist_api/models/discovered_switch.rb', line 58 def @timestamp end |
#vendor ⇒ String
Epoch (seconds)
62 63 64 |
# File 'lib/mist_api/models/discovered_switch.rb', line 62 def vendor @vendor end |
#version ⇒ String
Epoch (seconds)
66 67 68 |
# File 'lib/mist_api/models/discovered_switch.rb', line 66 def version @version end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 169 170 171 172 173 174 175 176 177 178 |
# File 'lib/mist_api/models/discovered_switch.rb', line 135 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. adopted = hash.key?('adopted') ? hash['adopted'] : SKIP ap_redundancy = ApRedundancy.from_hash(hash['ap_redundancy']) if hash['ap_redundancy'] # Parameter is an array, so we need to iterate through it aps = nil unless hash['aps'].nil? aps = [] hash['aps'].each do |structure| aps << (DiscoveredSwitchAp.from_hash(structure) if structure) end end aps = SKIP unless hash.key?('aps') chassis_id = hash.key?('chassis_id') ? hash['chassis_id'] : SKIP for_site = hash.key?('for_site') ? hash['for_site'] : SKIP mgmt_addr = hash.key?('mgmt_addr') ? hash['mgmt_addr'] : SKIP model = hash.key?('model') ? hash['model'] : SKIP org_id = hash.key?('org_id') ? hash['org_id'] : SKIP site_id = hash.key?('site_id') ? hash['site_id'] : SKIP system_desc = hash.key?('system_desc') ? hash['system_desc'] : SKIP system_name = hash.key?('system_name') ? hash['system_name'] : SKIP = hash.key?('timestamp') ? hash['timestamp'] : SKIP vendor = hash.key?('vendor') ? hash['vendor'] : SKIP version = hash.key?('version') ? hash['version'] : SKIP # Create object from extracted values. DiscoveredSwitch.new(adopted, ap_redundancy, aps, chassis_id, for_site, mgmt_addr, model, org_id, site_id, system_desc, system_name, , vendor, version) end |
.names ⇒ Object
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/discovered_switch.rb', line 69 def self.names @_hash = {} if @_hash.nil? @_hash['adopted'] = 'adopted' @_hash['ap_redundancy'] = 'ap_redundancy' @_hash['aps'] = 'aps' @_hash['chassis_id'] = 'chassis_id' @_hash['for_site'] = 'for_site' @_hash['mgmt_addr'] = 'mgmt_addr' @_hash['model'] = 'model' @_hash['org_id'] = 'org_id' @_hash['site_id'] = 'site_id' @_hash['system_desc'] = 'system_desc' @_hash['system_name'] = 'system_name' @_hash['timestamp'] = 'timestamp' @_hash['vendor'] = 'vendor' @_hash['version'] = 'version' @_hash end |
.nullables ⇒ Object
An array for nullable fields
109 110 111 |
# File 'lib/mist_api/models/discovered_switch.rb', line 109 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/mist_api/models/discovered_switch.rb', line 89 def self.optionals %w[ adopted ap_redundancy aps chassis_id for_site mgmt_addr model org_id site_id system_desc system_name timestamp vendor version ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
191 192 193 194 195 196 197 198 199 |
# File 'lib/mist_api/models/discovered_switch.rb', line 191 def inspect class_name = self.class.name.split('::').last "<#{class_name} adopted: #{@adopted.inspect}, ap_redundancy: #{@ap_redundancy.inspect},"\ " aps: #{@aps.inspect}, chassis_id: #{@chassis_id.inspect}, for_site: #{@for_site.inspect},"\ " mgmt_addr: #{@mgmt_addr.inspect}, model: #{@model.inspect}, org_id: #{@org_id.inspect},"\ " site_id: #{@site_id.inspect}, system_desc: #{@system_desc.inspect}, system_name:"\ " #{@system_name.inspect}, timestamp: #{@timestamp.inspect}, vendor: #{@vendor.inspect},"\ " version: #{@version.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
181 182 183 184 185 186 187 188 |
# File 'lib/mist_api/models/discovered_switch.rb', line 181 def to_s class_name = self.class.name.split('::').last "<#{class_name} adopted: #{@adopted}, ap_redundancy: #{@ap_redundancy}, aps: #{@aps},"\ " chassis_id: #{@chassis_id}, for_site: #{@for_site}, mgmt_addr: #{@mgmt_addr}, model:"\ " #{@model}, org_id: #{@org_id}, site_id: #{@site_id}, system_desc: #{@system_desc},"\ " system_name: #{@system_name}, timestamp: #{@timestamp}, vendor: #{@vendor}, version:"\ " #{@version}>" end |