Class: MistApi::JuniperSrxAutoUpgrade

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/mist_api/models/juniper_srx_auto_upgrade.rb

Overview

auto_upgrade device first time it is onboarded

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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_versionsHash[String, String]

Property key is the SRX Hardware model (e.g. “SRX4600”)

Returns:

  • (Hash[String, String])


14
15
16
# File 'lib/mist_api/models/juniper_srx_auto_upgrade.rb', line 14

def custom_versions
  @custom_versions
end

#enabledTrueClass | FalseClass

Property key is the SRX Hardware model (e.g. “SRX4600”)

Returns:

  • (TrueClass | FalseClass)


18
19
20
# File 'lib/mist_api/models/juniper_srx_auto_upgrade.rb', line 18

def enabled
  @enabled
end

#snapshotTrueClass | FalseClass

Property key is the SRX Hardware model (e.g. “SRX4600”)

Returns:

  • (TrueClass | FalseClass)


22
23
24
# File 'lib/mist_api/models/juniper_srx_auto_upgrade.rb', line 22

def snapshot
  @snapshot
end

#versionString

Firmware version to deploy (e.g. 23.4R2-S5.5). Optional, used when custom_versions not specified

Returns:

  • (String)


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

.namesObject

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

.nullablesObject

An array for nullable fields



50
51
52
# File 'lib/mist_api/models/juniper_srx_auto_upgrade.rb', line 50

def self.nullables
  []
end

.optionalsObject

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

#inspectObject

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_sObject

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