Class: MistApi::ResponseUpgradeOrgDevices
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- MistApi::ResponseUpgradeOrgDevices
- Defined in:
- lib/mist_api/models/response_upgrade_org_devices.rb
Overview
ResponseUpgradeOrgDevices Model.
Instance Attribute Summary collapse
-
#enable_p2p ⇒ TrueClass | FalseClass
Whether to allow local AP-to-AP FW upgrade.
-
#force ⇒ TrueClass | FalseClass
Whether to force upgrade when requested version is same as running version.
-
#id ⇒ UUID | String
Unique ID of the object instance in the Mist Organization.
-
#strategy ⇒ UpgradeDeviceStrategyEnum
enum: ‘big_bang` (upgrade all at once), `canary`, `rrm` (APs only), `serial` (one at a time).
-
#target_version ⇒ String
Version to upgrade to.
-
#upgrades ⇒ Array[UpgradeOrgDevicesUpgrade]
Version to upgrade to.
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(enable_p2p = SKIP, force = SKIP, id = SKIP, strategy = UpgradeDeviceStrategyEnum::BIG_BANG, target_version = SKIP, upgrades = SKIP) ⇒ ResponseUpgradeOrgDevices
constructor
A new instance of ResponseUpgradeOrgDevices.
-
#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(enable_p2p = SKIP, force = SKIP, id = SKIP, strategy = UpgradeDeviceStrategyEnum::BIG_BANG, target_version = SKIP, upgrades = SKIP) ⇒ ResponseUpgradeOrgDevices
Returns a new instance of ResponseUpgradeOrgDevices.
66 67 68 69 70 71 72 73 74 75 |
# File 'lib/mist_api/models/response_upgrade_org_devices.rb', line 66 def initialize(enable_p2p = SKIP, force = SKIP, id = SKIP, strategy = UpgradeDeviceStrategyEnum::BIG_BANG, target_version = SKIP, upgrades = SKIP) @enable_p2p = enable_p2p unless enable_p2p == SKIP @force = force unless force == SKIP @id = id unless id == SKIP @strategy = strategy unless strategy == SKIP @target_version = target_version unless target_version == SKIP @upgrades = upgrades unless upgrades == SKIP end |
Instance Attribute Details
#enable_p2p ⇒ TrueClass | FalseClass
Whether to allow local AP-to-AP FW upgrade
14 15 16 |
# File 'lib/mist_api/models/response_upgrade_org_devices.rb', line 14 def enable_p2p @enable_p2p end |
#force ⇒ TrueClass | FalseClass
Whether to force upgrade when requested version is same as running version
18 19 20 |
# File 'lib/mist_api/models/response_upgrade_org_devices.rb', line 18 def force @force end |
#id ⇒ UUID | String
Unique ID of the object instance in the Mist Organization
22 23 24 |
# File 'lib/mist_api/models/response_upgrade_org_devices.rb', line 22 def id @id end |
#strategy ⇒ UpgradeDeviceStrategyEnum
enum: ‘big_bang` (upgrade all at once), `canary`, `rrm` (APs only), `serial` (one at a time)
27 28 29 |
# File 'lib/mist_api/models/response_upgrade_org_devices.rb', line 27 def strategy @strategy end |
#target_version ⇒ String
Version to upgrade to
31 32 33 |
# File 'lib/mist_api/models/response_upgrade_org_devices.rb', line 31 def target_version @target_version end |
#upgrades ⇒ Array[UpgradeOrgDevicesUpgrade]
Version to upgrade to
35 36 37 |
# File 'lib/mist_api/models/response_upgrade_org_devices.rb', line 35 def upgrades @upgrades end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/mist_api/models/response_upgrade_org_devices.rb', line 78 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. enable_p2p = hash.key?('enable_p2p') ? hash['enable_p2p'] : SKIP force = hash.key?('force') ? hash['force'] : SKIP id = hash.key?('id') ? hash['id'] : SKIP strategy = hash['strategy'] ||= UpgradeDeviceStrategyEnum::BIG_BANG target_version = hash.key?('target_version') ? hash['target_version'] : SKIP # Parameter is an array, so we need to iterate through it upgrades = nil unless hash['upgrades'].nil? upgrades = [] hash['upgrades'].each do |structure| upgrades << (UpgradeOrgDevicesUpgrade.from_hash(structure) if structure) end end upgrades = SKIP unless hash.key?('upgrades') # Create object from extracted values. ResponseUpgradeOrgDevices.new(enable_p2p, force, id, strategy, target_version, upgrades) end |
.names ⇒ Object
A mapping from model property names to API property names.
38 39 40 41 42 43 44 45 46 47 |
# File 'lib/mist_api/models/response_upgrade_org_devices.rb', line 38 def self.names @_hash = {} if @_hash.nil? @_hash['enable_p2p'] = 'enable_p2p' @_hash['force'] = 'force' @_hash['id'] = 'id' @_hash['strategy'] = 'strategy' @_hash['target_version'] = 'target_version' @_hash['upgrades'] = 'upgrades' @_hash end |
.nullables ⇒ Object
An array for nullable fields
62 63 64 |
# File 'lib/mist_api/models/response_upgrade_org_devices.rb', line 62 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
50 51 52 53 54 55 56 57 58 59 |
# File 'lib/mist_api/models/response_upgrade_org_devices.rb', line 50 def self.optionals %w[ enable_p2p force id strategy target_version upgrades ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
116 117 118 119 120 121 |
# File 'lib/mist_api/models/response_upgrade_org_devices.rb', line 116 def inspect class_name = self.class.name.split('::').last "<#{class_name} enable_p2p: #{@enable_p2p.inspect}, force: #{@force.inspect}, id:"\ " #{@id.inspect}, strategy: #{@strategy.inspect}, target_version:"\ " #{@target_version.inspect}, upgrades: #{@upgrades.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
109 110 111 112 113 |
# File 'lib/mist_api/models/response_upgrade_org_devices.rb', line 109 def to_s class_name = self.class.name.split('::').last "<#{class_name} enable_p2p: #{@enable_p2p}, force: #{@force}, id: #{@id}, strategy:"\ " #{@strategy}, target_version: #{@target_version}, upgrades: #{@upgrades}>" end |