Class: UntitledApi::InternalDevicesUpgradeResponse2

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/untitled_api/models/internal_devices_upgrade_response2.rb

Overview

Response data

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(strategy = SKIP, distro = SKIP, target_count = SKIP, reboot_at = SKIP, device_type = SKIP, start_time = SKIP, status = SKIP, max_failure_percentage = SKIP, channel = SKIP, device_ids = SKIP, payload = SKIP, is_distro_upgrade = SKIP, max_failures = SKIP, create_at = SKIP, targets = SKIP, id = SKIP) ⇒ InternalDevicesUpgradeResponse2

Returns a new instance of InternalDevicesUpgradeResponse2.



125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# File 'lib/untitled_api/models/internal_devices_upgrade_response2.rb', line 125

def initialize(strategy = SKIP,
               distro = SKIP,
               target_count = SKIP,
               reboot_at = SKIP,
               device_type = SKIP,
               start_time = SKIP,
               status = SKIP,
               max_failure_percentage = SKIP,
               channel = SKIP,
               device_ids = SKIP,
               payload = SKIP,
               is_distro_upgrade = SKIP,
               max_failures = SKIP,
               create_at = SKIP,
               targets = SKIP,
               id = SKIP)
  @strategy = strategy unless strategy == SKIP
  @distro = distro unless distro == SKIP
  @target_count = target_count unless target_count == SKIP
  @reboot_at = reboot_at unless reboot_at == SKIP
  @device_type = device_type unless device_type == SKIP
  @start_time = start_time unless start_time == SKIP
  @status = status unless status == SKIP
  @max_failure_percentage = max_failure_percentage unless max_failure_percentage == SKIP
  @channel = channel unless channel == SKIP
  @device_ids = device_ids unless device_ids == SKIP
  @payload = payload unless payload == SKIP
  @is_distro_upgrade = is_distro_upgrade unless is_distro_upgrade == SKIP
  @max_failures = max_failures unless max_failures == SKIP
  @create_at = create_at unless create_at == SKIP
  @targets = targets unless targets == SKIP
  @id = id unless id == SKIP
end

Instance Attribute Details

#channelString

TODO: Write general description for this method

Returns:

  • (String)


46
47
48
# File 'lib/untitled_api/models/internal_devices_upgrade_response2.rb', line 46

def channel
  @channel
end

#create_atFloat

TODO: Write general description for this method

Returns:

  • (Float)


66
67
68
# File 'lib/untitled_api/models/internal_devices_upgrade_response2.rb', line 66

def create_at
  @create_at
end

#device_idsObject

TODO: Write general description for this method

Returns:

  • (Object)


50
51
52
# File 'lib/untitled_api/models/internal_devices_upgrade_response2.rb', line 50

def device_ids
  @device_ids
end

#device_typeString

TODO: Write general description for this method

Returns:

  • (String)


30
31
32
# File 'lib/untitled_api/models/internal_devices_upgrade_response2.rb', line 30

def device_type
  @device_type
end

#distroString

TODO: Write general description for this method

Returns:

  • (String)


18
19
20
# File 'lib/untitled_api/models/internal_devices_upgrade_response2.rb', line 18

def distro
  @distro
end

#idString

TODO: Write general description for this method

Returns:

  • (String)


74
75
76
# File 'lib/untitled_api/models/internal_devices_upgrade_response2.rb', line 74

def id
  @id
end

#is_distro_upgradeObject

TODO: Write general description for this method

Returns:

  • (Object)


58
59
60
# File 'lib/untitled_api/models/internal_devices_upgrade_response2.rb', line 58

def is_distro_upgrade
  @is_distro_upgrade
end

#max_failure_percentageFloat

TODO: Write general description for this method

Returns:

  • (Float)


42
43
44
# File 'lib/untitled_api/models/internal_devices_upgrade_response2.rb', line 42

def max_failure_percentage
  @max_failure_percentage
end

#max_failuresObject

TODO: Write general description for this method

Returns:

  • (Object)


62
63
64
# File 'lib/untitled_api/models/internal_devices_upgrade_response2.rb', line 62

def max_failures
  @max_failures
end

#payloadObject

TODO: Write general description for this method

Returns:

  • (Object)


54
55
56
# File 'lib/untitled_api/models/internal_devices_upgrade_response2.rb', line 54

def payload
  @payload
end

#reboot_atFloat

TODO: Write general description for this method

Returns:

  • (Float)


26
27
28
# File 'lib/untitled_api/models/internal_devices_upgrade_response2.rb', line 26

def reboot_at
  @reboot_at
end

#start_timeFloat

TODO: Write general description for this method

Returns:

  • (Float)


34
35
36
# File 'lib/untitled_api/models/internal_devices_upgrade_response2.rb', line 34

def start_time
  @start_time
end

#statusString

TODO: Write general description for this method

Returns:

  • (String)


38
39
40
# File 'lib/untitled_api/models/internal_devices_upgrade_response2.rb', line 38

def status
  @status
end

#strategyString

TODO: Write general description for this method

Returns:

  • (String)


14
15
16
# File 'lib/untitled_api/models/internal_devices_upgrade_response2.rb', line 14

def strategy
  @strategy
end

#target_countFloat

TODO: Write general description for this method

Returns:

  • (Float)


22
23
24
# File 'lib/untitled_api/models/internal_devices_upgrade_response2.rb', line 22

def target_count
  @target_count
end

#targetsObject

TODO: Write general description for this method

Returns:

  • (Object)


70
71
72
# File 'lib/untitled_api/models/internal_devices_upgrade_response2.rb', line 70

def targets
  @targets
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
# File 'lib/untitled_api/models/internal_devices_upgrade_response2.rb', line 160

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  strategy = hash.key?('strategy') ? hash['strategy'] : SKIP
  distro = hash.key?('distro') ? hash['distro'] : SKIP
  target_count = hash.key?('target_count') ? hash['target_count'] : SKIP
  reboot_at = hash.key?('reboot_at') ? hash['reboot_at'] : SKIP
  device_type = hash.key?('device_type') ? hash['device_type'] : SKIP
  start_time = hash.key?('start_time') ? hash['start_time'] : SKIP
  status = hash.key?('status') ? hash['status'] : SKIP
  max_failure_percentage =
    hash.key?('max_failure_percentage') ? hash['max_failure_percentage'] : SKIP
  channel = hash.key?('channel') ? hash['channel'] : SKIP
  device_ids = hash.key?('device_ids') ? hash['device_ids'] : SKIP
  payload = hash.key?('payload') ? hash['payload'] : SKIP
  is_distro_upgrade =
    hash.key?('is_distro_upgrade') ? hash['is_distro_upgrade'] : SKIP
  max_failures = hash.key?('max_failures') ? hash['max_failures'] : SKIP
  create_at = hash.key?('create_at') ? hash['create_at'] : SKIP
  targets = hash.key?('targets') ? hash['targets'] : SKIP
  id = hash.key?('id') ? hash['id'] : SKIP

  # Create object from extracted values.
  InternalDevicesUpgradeResponse2.new(strategy,
                                      distro,
                                      target_count,
                                      reboot_at,
                                      device_type,
                                      start_time,
                                      status,
                                      max_failure_percentage,
                                      channel,
                                      device_ids,
                                      payload,
                                      is_distro_upgrade,
                                      max_failures,
                                      create_at,
                                      targets,
                                      id)
end

.namesObject

A mapping from model property names to API property names.



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/untitled_api/models/internal_devices_upgrade_response2.rb', line 77

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['strategy'] = 'strategy'
  @_hash['distro'] = 'distro'
  @_hash['target_count'] = 'target_count'
  @_hash['reboot_at'] = 'reboot_at'
  @_hash['device_type'] = 'device_type'
  @_hash['start_time'] = 'start_time'
  @_hash['status'] = 'status'
  @_hash['max_failure_percentage'] = 'max_failure_percentage'
  @_hash['channel'] = 'channel'
  @_hash['device_ids'] = 'device_ids'
  @_hash['payload'] = 'payload'
  @_hash['is_distro_upgrade'] = 'is_distro_upgrade'
  @_hash['max_failures'] = 'max_failures'
  @_hash['create_at'] = 'create_at'
  @_hash['targets'] = 'targets'
  @_hash['id'] = 'id'
  @_hash
end

.nullablesObject

An array for nullable fields



121
122
123
# File 'lib/untitled_api/models/internal_devices_upgrade_response2.rb', line 121

def self.nullables
  []
end

.optionalsObject

An array for optional fields



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/untitled_api/models/internal_devices_upgrade_response2.rb', line 99

def self.optionals
  %w[
    strategy
    distro
    target_count
    reboot_at
    device_type
    start_time
    status
    max_failure_percentage
    channel
    device_ids
    payload
    is_distro_upgrade
    max_failures
    create_at
    targets
    id
  ]
end