Class: IntersightClient::ApplianceUpgradeAllOf

Inherits:
Object
  • Object
show all
Defined in:
lib/intersight_client/models/appliance_upgrade_all_of.rb

Overview

Definition of the list of properties defined in ‘appliance.Upgrade’, excluding properties defined in parent classes.

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ApplianceUpgradeAllOf

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
# File 'lib/intersight_client/models/appliance_upgrade_all_of.rb', line 194

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `IntersightClient::ApplianceUpgradeAllOf` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!self.class.acceptable_attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `#{self.class.name}`. Please check the name to make sure it's valid. List of attributes: " + self.class.acceptable_attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'class_id')
    self.class_id = attributes[:'class_id']
  else
    self.class_id = 'appliance.Upgrade'
  end

  if attributes.key?(:'object_type')
    self.object_type = attributes[:'object_type']
  else
    self.object_type = 'appliance.Upgrade'
  end

  if attributes.key?(:'active')
    self.active = attributes[:'active']
  end

  if attributes.key?(:'auto_created')
    self.auto_created = attributes[:'auto_created']
  end

  if attributes.key?(:'completed_phases')
    if (value = attributes[:'completed_phases']).is_a?(Array)
      self.completed_phases = value
    end
  end

  if attributes.key?(:'current_phase')
    self.current_phase = attributes[:'current_phase']
  end

  if attributes.key?(:'description')
    self.description = attributes[:'description']
  end

  if attributes.key?(:'elapsed_time')
    self.elapsed_time = attributes[:'elapsed_time']
  end

  if attributes.key?(:'end_time')
    self.end_time = attributes[:'end_time']
  end

  if attributes.key?(:'error_code')
    self.error_code = attributes[:'error_code']
  end

  if attributes.key?(:'fingerprint')
    self.fingerprint = attributes[:'fingerprint']
  end

  if attributes.key?(:'is_rolling_back')
    self.is_rolling_back = attributes[:'is_rolling_back']
  else
    self.is_rolling_back = false
  end

  if attributes.key?(:'is_user_triggered')
    self.is_user_triggered = attributes[:'is_user_triggered']
  else
    self.is_user_triggered = false
  end

  if attributes.key?(:'messages')
    if (value = attributes[:'messages']).is_a?(Array)
      self.messages = value
    end
  end

  if attributes.key?(:'rollback_needed')
    self.rollback_needed = attributes[:'rollback_needed']
  else
    self.rollback_needed = false
  end

  if attributes.key?(:'rollback_phases')
    if (value = attributes[:'rollback_phases']).is_a?(Array)
      self.rollback_phases = value
    end
  end

  if attributes.key?(:'rollback_status')
    self.rollback_status = attributes[:'rollback_status']
  end

  if attributes.key?(:'services')
    if (value = attributes[:'services']).is_a?(Array)
      self.services = value
    end
  end

  if attributes.key?(:'start_time')
    self.start_time = attributes[:'start_time']
  end

  if attributes.key?(:'status')
    self.status = attributes[:'status']
  end

  if attributes.key?(:'total_phases')
    self.total_phases = attributes[:'total_phases']
  end

  if attributes.key?(:'ui_packages')
    if (value = attributes[:'ui_packages']).is_a?(Array)
      self.ui_packages = value
    end
  end

  if attributes.key?(:'version')
    self.version = attributes[:'version']
  end

  if attributes.key?(:'account')
    self. = attributes[:'account']
  end

  if attributes.key?(:'image_bundle')
    self.image_bundle = attributes[:'image_bundle']
  end
end

Instance Attribute Details

#accountObject

Returns the value of attribute account.



82
83
84
# File 'lib/intersight_client/models/appliance_upgrade_all_of.rb', line 82

def 
  @account
end

#activeObject

Indicates if the software upgrade is active or not.



26
27
28
# File 'lib/intersight_client/models/appliance_upgrade_all_of.rb', line 26

def active
  @active
end

#auto_createdObject

Indicates that the request was automatically created by the system.



29
30
31
# File 'lib/intersight_client/models/appliance_upgrade_all_of.rb', line 29

def auto_created
  @auto_created
end

#class_idObject

The fully-qualified name of the instantiated, concrete type. This property is used as a discriminator to identify the type of the payload when marshaling and unmarshaling data.



20
21
22
# File 'lib/intersight_client/models/appliance_upgrade_all_of.rb', line 20

def class_id
  @class_id
end

#completed_phasesObject

Returns the value of attribute completed_phases.



31
32
33
# File 'lib/intersight_client/models/appliance_upgrade_all_of.rb', line 31

def completed_phases
  @completed_phases
end

#current_phaseObject

Returns the value of attribute current_phase.



33
34
35
# File 'lib/intersight_client/models/appliance_upgrade_all_of.rb', line 33

def current_phase
  @current_phase
end

#descriptionObject

Description of the software upgrade.



36
37
38
# File 'lib/intersight_client/models/appliance_upgrade_all_of.rb', line 36

def description
  @description
end

#elapsed_timeObject

Elapsed time in seconds during the software upgrade.



39
40
41
# File 'lib/intersight_client/models/appliance_upgrade_all_of.rb', line 39

def elapsed_time
  @elapsed_time
end

#end_timeObject

End date of the software upgrade.



42
43
44
# File 'lib/intersight_client/models/appliance_upgrade_all_of.rb', line 42

def end_time
  @end_time
end

#error_codeObject

Error code for Intersight Appliance’s software upgrade. In case of failure - this code will help decide if software upgrade can be retried.



45
46
47
# File 'lib/intersight_client/models/appliance_upgrade_all_of.rb', line 45

def error_code
  @error_code
end

#fingerprintObject

Software upgrade manifest’s fingerprint.



48
49
50
# File 'lib/intersight_client/models/appliance_upgrade_all_of.rb', line 48

def fingerprint
  @fingerprint
end

#image_bundleObject

Returns the value of attribute image_bundle.



84
85
86
# File 'lib/intersight_client/models/appliance_upgrade_all_of.rb', line 84

def image_bundle
  @image_bundle
end

#is_rolling_backObject

Track if software upgrade is upgrading or rolling back.



51
52
53
# File 'lib/intersight_client/models/appliance_upgrade_all_of.rb', line 51

def is_rolling_back
  @is_rolling_back
end

#is_user_triggeredObject

Indicates if the upgrade is triggered by user or due to schedule.



54
55
56
# File 'lib/intersight_client/models/appliance_upgrade_all_of.rb', line 54

def is_user_triggered
  @is_user_triggered
end

#messagesObject

Returns the value of attribute messages.



56
57
58
# File 'lib/intersight_client/models/appliance_upgrade_all_of.rb', line 56

def messages
  @messages
end

#object_typeObject

The fully-qualified name of the instantiated, concrete type. The value should be the same as the ‘ClassId’ property.



23
24
25
# File 'lib/intersight_client/models/appliance_upgrade_all_of.rb', line 23

def object_type
  @object_type
end

#rollback_neededObject

Track if rollback is needed.



59
60
61
# File 'lib/intersight_client/models/appliance_upgrade_all_of.rb', line 59

def rollback_needed
  @rollback_needed
end

#rollback_phasesObject

Returns the value of attribute rollback_phases.



61
62
63
# File 'lib/intersight_client/models/appliance_upgrade_all_of.rb', line 61

def rollback_phases
  @rollback_phases
end

#rollback_statusObject

Status of the Intersight Appliance’s software rollback status.



64
65
66
# File 'lib/intersight_client/models/appliance_upgrade_all_of.rb', line 64

def rollback_status
  @rollback_status
end

#servicesObject

Returns the value of attribute services.



66
67
68
# File 'lib/intersight_client/models/appliance_upgrade_all_of.rb', line 66

def services
  @services
end

#start_timeObject

Start date of the software upgrade. UI can modify startTime to re-schedule an upgrade.



69
70
71
# File 'lib/intersight_client/models/appliance_upgrade_all_of.rb', line 69

def start_time
  @start_time
end

#statusObject

Status of the Intersight Appliance’s software upgrade.



72
73
74
# File 'lib/intersight_client/models/appliance_upgrade_all_of.rb', line 72

def status
  @status
end

#total_phasesObject

TotalPhase represents the total number of the upgradePhases for one upgrade.



75
76
77
# File 'lib/intersight_client/models/appliance_upgrade_all_of.rb', line 75

def total_phases
  @total_phases
end

#ui_packagesObject

Returns the value of attribute ui_packages.



77
78
79
# File 'lib/intersight_client/models/appliance_upgrade_all_of.rb', line 77

def ui_packages
  @ui_packages
end

#versionObject

Software upgrade manifest’s version.



80
81
82
# File 'lib/intersight_client/models/appliance_upgrade_all_of.rb', line 80

def version
  @version
end

Class Method Details

.acceptable_attribute_mapObject

Returns the key-value map of all the JSON attributes this model knows about



145
146
147
# File 'lib/intersight_client/models/appliance_upgrade_all_of.rb', line 145

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



140
141
142
# File 'lib/intersight_client/models/appliance_upgrade_all_of.rb', line 140

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# File 'lib/intersight_client/models/appliance_upgrade_all_of.rb', line 109

def self.attribute_map
  {
    :'class_id' => :'ClassId',
    :'object_type' => :'ObjectType',
    :'active' => :'Active',
    :'auto_created' => :'AutoCreated',
    :'completed_phases' => :'CompletedPhases',
    :'current_phase' => :'CurrentPhase',
    :'description' => :'Description',
    :'elapsed_time' => :'ElapsedTime',
    :'end_time' => :'EndTime',
    :'error_code' => :'ErrorCode',
    :'fingerprint' => :'Fingerprint',
    :'is_rolling_back' => :'IsRollingBack',
    :'is_user_triggered' => :'IsUserTriggered',
    :'messages' => :'Messages',
    :'rollback_needed' => :'RollbackNeeded',
    :'rollback_phases' => :'RollbackPhases',
    :'rollback_status' => :'RollbackStatus',
    :'services' => :'Services',
    :'start_time' => :'StartTime',
    :'status' => :'Status',
    :'total_phases' => :'TotalPhases',
    :'ui_packages' => :'UiPackages',
    :'version' => :'Version',
    :'account' => :'Account',
    :'image_bundle' => :'ImageBundle'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



422
423
424
# File 'lib/intersight_client/models/appliance_upgrade_all_of.rb', line 422

def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end

.openapi_nullableObject

List of attributes with nullable: true



181
182
183
184
185
186
187
188
189
190
# File 'lib/intersight_client/models/appliance_upgrade_all_of.rb', line 181

def self.openapi_nullable
  Set.new([
    :'completed_phases',
    :'current_phase',
    :'messages',
    :'rollback_phases',
    :'services',
    :'ui_packages',
  ])
end

.openapi_typesObject

Attribute type mapping.



150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# File 'lib/intersight_client/models/appliance_upgrade_all_of.rb', line 150

def self.openapi_types
  {
    :'class_id' => :'String',
    :'object_type' => :'String',
    :'active' => :'Boolean',
    :'auto_created' => :'Boolean',
    :'completed_phases' => :'Array<OnpremUpgradePhase>',
    :'current_phase' => :'OnpremUpgradePhase',
    :'description' => :'String',
    :'elapsed_time' => :'Integer',
    :'end_time' => :'Time',
    :'error_code' => :'Integer',
    :'fingerprint' => :'String',
    :'is_rolling_back' => :'Boolean',
    :'is_user_triggered' => :'Boolean',
    :'messages' => :'Array<String>',
    :'rollback_needed' => :'Boolean',
    :'rollback_phases' => :'Array<OnpremUpgradePhase>',
    :'rollback_status' => :'String',
    :'services' => :'Array<String>',
    :'start_time' => :'Time',
    :'status' => :'String',
    :'total_phases' => :'Integer',
    :'ui_packages' => :'Array<String>',
    :'version' => :'String',
    :'account' => :'IamAccountRelationship',
    :'image_bundle' => :'ApplianceImageBundleRelationship'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
# File 'lib/intersight_client/models/appliance_upgrade_all_of.rb', line 377

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      class_id == o.class_id &&
      object_type == o.object_type &&
      active == o.active &&
      auto_created == o.auto_created &&
      completed_phases == o.completed_phases &&
      current_phase == o.current_phase &&
      description == o.description &&
      elapsed_time == o.elapsed_time &&
      end_time == o.end_time &&
      error_code == o.error_code &&
      fingerprint == o.fingerprint &&
      is_rolling_back == o.is_rolling_back &&
      is_user_triggered == o.is_user_triggered &&
      messages == o.messages &&
      rollback_needed == o.rollback_needed &&
      rollback_phases == o.rollback_phases &&
      rollback_status == o.rollback_status &&
      services == o.services &&
      start_time == o.start_time &&
      status == o.status &&
      total_phases == o.total_phases &&
      ui_packages == o.ui_packages &&
      version == o.version &&
       == o. &&
      image_bundle == o.image_bundle
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
# File 'lib/intersight_client/models/appliance_upgrade_all_of.rb', line 452

def _deserialize(type, value)
  case type.to_sym
  when :Time
    Time.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    # models (e.g. Pet) or oneOf
    klass = IntersightClient.const_get(type)
    klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



523
524
525
526
527
528
529
530
531
532
533
534
535
# File 'lib/intersight_client/models/appliance_upgrade_all_of.rb', line 523

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
# File 'lib/intersight_client/models/appliance_upgrade_all_of.rb', line 429

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  ApplianceUpgradeAllOf.openapi_types.each_pair do |key, type|
    if attributes[ApplianceUpgradeAllOf.attribute_map[key]].nil? && ApplianceUpgradeAllOf.openapi_nullable.include?(key)
      self.send("#{key}=", nil)
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[ApplianceUpgradeAllOf.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[ApplianceUpgradeAllOf.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[ApplianceUpgradeAllOf.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[ApplianceUpgradeAllOf.attribute_map[key]]))
    end
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


409
410
411
# File 'lib/intersight_client/models/appliance_upgrade_all_of.rb', line 409

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



415
416
417
# File 'lib/intersight_client/models/appliance_upgrade_all_of.rb', line 415

def hash
  [class_id, object_type, active, auto_created, completed_phases, current_phase, description, elapsed_time, end_time, error_code, fingerprint, is_rolling_back, is_user_triggered, messages, rollback_needed, rollback_phases, rollback_status, services, start_time, status, total_phases, ui_packages, version, , image_bundle].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



330
331
332
333
334
335
336
337
338
339
340
341
# File 'lib/intersight_client/models/appliance_upgrade_all_of.rb', line 330

def list_invalid_properties
  invalid_properties = Array.new
  if @class_id.nil?
    invalid_properties.push('invalid value for "class_id", class_id cannot be nil.')
  end

  if @object_type.nil?
    invalid_properties.push('invalid value for "object_type", object_type cannot be nil.')
  end

  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



499
500
501
# File 'lib/intersight_client/models/appliance_upgrade_all_of.rb', line 499

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



505
506
507
508
509
510
511
512
513
514
515
516
517
# File 'lib/intersight_client/models/appliance_upgrade_all_of.rb', line 505

def to_hash
  hash = {}
  ApplianceUpgradeAllOf.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = ApplianceUpgradeAllOf.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



493
494
495
# File 'lib/intersight_client/models/appliance_upgrade_all_of.rb', line 493

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



345
346
347
348
349
350
351
352
353
# File 'lib/intersight_client/models/appliance_upgrade_all_of.rb', line 345

def valid?
  return false if @class_id.nil?
  class_id_validator = EnumAttributeValidator.new('String', ["appliance.Upgrade"])
  return false unless class_id_validator.valid?(@class_id)
  return false if @object_type.nil?
  object_type_validator = EnumAttributeValidator.new('String', ["appliance.Upgrade"])
  return false unless object_type_validator.valid?(@object_type)
  true
end