Class: MistApi::JuniperSrxAutoUpgrade
- Defined in:
- lib/mist_api/models/juniper_srx_auto_upgrade.rb
Overview
auto_upgrade device first time it is onboarded
Instance Attribute Summary collapse
-
#custom_versions ⇒ Hash[String, String]
Property key is the SRX Hardware model (e.g. “SRX4600”).
-
#enabled ⇒ TrueClass | FalseClass
Property key is the SRX Hardware model (e.g. “SRX4600”).
-
#snapshot ⇒ TrueClass | FalseClass
Property key is the SRX Hardware model (e.g. “SRX4600”).
-
#version ⇒ String
Firmware version to deploy (e.g. 23.4R2-S5.5).
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(custom_versions = SKIP, enabled = false, snapshot = false, version = SKIP) ⇒ JuniperSrxAutoUpgrade
constructor
A new instance of JuniperSrxAutoUpgrade.
-
#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(custom_versions = SKIP, enabled = false, snapshot = false, version = SKIP) ⇒ JuniperSrxAutoUpgrade
Returns a new instance of JuniperSrxAutoUpgrade.
54 55 56 57 58 59 60 |
# File 'lib/mist_api/models/juniper_srx_auto_upgrade.rb', line 54 def initialize(custom_versions = SKIP, enabled = false, snapshot = false, version = SKIP) @custom_versions = custom_versions unless custom_versions == SKIP @enabled = enabled unless enabled == SKIP @snapshot = snapshot unless snapshot == SKIP @version = version unless version == SKIP end |
Instance Attribute Details
#custom_versions ⇒ Hash[String, String]
Property key is the SRX Hardware model (e.g. “SRX4600”)
14 15 16 |
# File 'lib/mist_api/models/juniper_srx_auto_upgrade.rb', line 14 def custom_versions @custom_versions end |
#enabled ⇒ TrueClass | FalseClass
Property key is the SRX Hardware model (e.g. “SRX4600”)
18 19 20 |
# File 'lib/mist_api/models/juniper_srx_auto_upgrade.rb', line 18 def enabled @enabled end |
#snapshot ⇒ TrueClass | FalseClass
Property key is the SRX Hardware model (e.g. “SRX4600”)
22 23 24 |
# File 'lib/mist_api/models/juniper_srx_auto_upgrade.rb', line 22 def snapshot @snapshot end |
#version ⇒ String
Firmware version to deploy (e.g. 23.4R2-S5.5). Optional, used when custom_versions not specified
27 28 29 |
# File 'lib/mist_api/models/juniper_srx_auto_upgrade.rb', line 27 def version @version end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/mist_api/models/juniper_srx_auto_upgrade.rb', line 63 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. custom_versions = hash.key?('custom_versions') ? hash['custom_versions'] : SKIP enabled = hash['enabled'] ||= false snapshot = hash['snapshot'] ||= false version = hash.key?('version') ? hash['version'] : SKIP # Create object from extracted values. JuniperSrxAutoUpgrade.new(custom_versions, enabled, snapshot, version) end |
.names ⇒ Object
A mapping from model property names to API property names.
30 31 32 33 34 35 36 37 |
# File 'lib/mist_api/models/juniper_srx_auto_upgrade.rb', line 30 def self.names @_hash = {} if @_hash.nil? @_hash['custom_versions'] = 'custom_versions' @_hash['enabled'] = 'enabled' @_hash['snapshot'] = 'snapshot' @_hash['version'] = 'version' @_hash end |
.nullables ⇒ Object
An array for nullable fields
50 51 52 |
# File 'lib/mist_api/models/juniper_srx_auto_upgrade.rb', line 50 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
40 41 42 43 44 45 46 47 |
# File 'lib/mist_api/models/juniper_srx_auto_upgrade.rb', line 40 def self.optionals %w[ custom_versions enabled snapshot version ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
88 89 90 91 92 |
# File 'lib/mist_api/models/juniper_srx_auto_upgrade.rb', line 88 def inspect class_name = self.class.name.split('::').last "<#{class_name} custom_versions: #{@custom_versions.inspect}, enabled: #{@enabled.inspect},"\ " snapshot: #{@snapshot.inspect}, version: #{@version.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
81 82 83 84 85 |
# File 'lib/mist_api/models/juniper_srx_auto_upgrade.rb', line 81 def to_s class_name = self.class.name.split('::').last "<#{class_name} custom_versions: #{@custom_versions}, enabled: #{@enabled}, snapshot:"\ " #{@snapshot}, version: #{@version}>" end |