Class: MistApi::UpgradeOrgDevicesUpgradeInfo

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

Overview

UpgradeOrgDevicesUpgradeInfo Model.

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(id = SKIP, start_time = SKIP, status = SKIP, targets = SKIP) ⇒ UpgradeOrgDevicesUpgradeInfo

Returns a new instance of UpgradeOrgDevicesUpgradeInfo.



55
56
57
58
59
60
# File 'lib/mist_api/models/upgrade_org_devices_upgrade_info.rb', line 55

def initialize(id = SKIP, start_time = SKIP, status = SKIP, targets = SKIP)
  @id = id unless id == SKIP
  @start_time = start_time unless start_time == SKIP
  @status = status unless status == SKIP
  @targets = targets unless targets == SKIP
end

Instance Attribute Details

#idUUID | String

Unique ID of the object instance in the Mist Organization

Returns:

  • (UUID | String)


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

def id
  @id
end

#start_timeInteger

Unique ID of the object instance in the Mist Organization

Returns:

  • (Integer)


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

def start_time
  @start_time
end

#statusUpgradeDeviceStatusEnum

status upgrade is in. enum: ‘cancelled`, `completed`, `created`, `downloaded`, `downloading`, `failed`, `upgrading`, `queued`



23
24
25
# File 'lib/mist_api/models/upgrade_org_devices_upgrade_info.rb', line 23

def status
  @status
end

#targetsUpgradeDevicesTargets

status upgrade is in. enum: ‘cancelled`, `completed`, `created`, `downloaded`, `downloading`, `failed`, `upgrading`, `queued`



28
29
30
# File 'lib/mist_api/models/upgrade_org_devices_upgrade_info.rb', line 28

def targets
  @targets
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
# File 'lib/mist_api/models/upgrade_org_devices_upgrade_info.rb', line 63

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  id = hash.key?('id') ? hash['id'] : SKIP
  start_time = hash.key?('start_time') ? hash['start_time'] : SKIP
  status = hash.key?('status') ? hash['status'] : SKIP
  targets = UpgradeDevicesTargets.from_hash(hash['targets']) if hash['targets']

  # Create object from extracted values.
  UpgradeOrgDevicesUpgradeInfo.new(id,
                                   start_time,
                                   status,
                                   targets)
end

.namesObject

A mapping from model property names to API property names.



31
32
33
34
35
36
37
38
# File 'lib/mist_api/models/upgrade_org_devices_upgrade_info.rb', line 31

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['id'] = 'id'
  @_hash['start_time'] = 'start_time'
  @_hash['status'] = 'status'
  @_hash['targets'] = 'targets'
  @_hash
end

.nullablesObject

An array for nullable fields



51
52
53
# File 'lib/mist_api/models/upgrade_org_devices_upgrade_info.rb', line 51

def self.nullables
  []
end

.optionalsObject

An array for optional fields



41
42
43
44
45
46
47
48
# File 'lib/mist_api/models/upgrade_org_devices_upgrade_info.rb', line 41

def self.optionals
  %w[
    id
    start_time
    status
    targets
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



87
88
89
90
91
# File 'lib/mist_api/models/upgrade_org_devices_upgrade_info.rb', line 87

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} id: #{@id.inspect}, start_time: #{@start_time.inspect}, status:"\
  " #{@status.inspect}, targets: #{@targets.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



80
81
82
83
84
# File 'lib/mist_api/models/upgrade_org_devices_upgrade_info.rb', line 80

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} id: #{@id}, start_time: #{@start_time}, status: #{@status}, targets:"\
  " #{@targets}>"
end