Class: MistApi::MxedgeUpgradeInfoItems

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

Overview

MxedgeUpgradeInfoItems 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(package = nil, version = nil, default = SKIP, distro = SKIP) ⇒ MxedgeUpgradeInfoItems

Returns a new instance of MxedgeUpgradeInfoItems.



51
52
53
54
55
56
# File 'lib/mist_api/models/mxedge_upgrade_info_items.rb', line 51

def initialize(package = nil, version = nil, default = SKIP, distro = SKIP)
  @default = default unless default == SKIP
  @distro = distro unless distro == SKIP
  @package = package
  @version = version
end

Instance Attribute Details

#defaultTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


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

def default
  @default
end

#distroString

TODO: Write general description for this method

Returns:

  • (String)


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

def distro
  @distro
end

#packageString

TODO: Write general description for this method

Returns:

  • (String)


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

def package
  @package
end

#versionString

TODO: Write general description for this method

Returns:

  • (String)


26
27
28
# File 'lib/mist_api/models/mxedge_upgrade_info_items.rb', line 26

def version
  @version
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/mist_api/models/mxedge_upgrade_info_items.rb', line 59

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  package = hash.key?('package') ? hash['package'] : nil
  version = hash.key?('version') ? hash['version'] : nil
  default = hash.key?('default') ? hash['default'] : SKIP
  distro = hash.key?('distro') ? hash['distro'] : SKIP

  # Create object from extracted values.
  MxedgeUpgradeInfoItems.new(package,
                             version,
                             default,
                             distro)
end

.namesObject

A mapping from model property names to API property names.



29
30
31
32
33
34
35
36
# File 'lib/mist_api/models/mxedge_upgrade_info_items.rb', line 29

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['default'] = 'default'
  @_hash['distro'] = 'distro'
  @_hash['package'] = 'package'
  @_hash['version'] = 'version'
  @_hash
end

.nullablesObject

An array for nullable fields



47
48
49
# File 'lib/mist_api/models/mxedge_upgrade_info_items.rb', line 47

def self.nullables
  []
end

.optionalsObject

An array for optional fields



39
40
41
42
43
44
# File 'lib/mist_api/models/mxedge_upgrade_info_items.rb', line 39

def self.optionals
  %w[
    default
    distro
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



83
84
85
86
87
# File 'lib/mist_api/models/mxedge_upgrade_info_items.rb', line 83

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} default: #{@default.inspect}, distro: #{@distro.inspect}, package:"\
  " #{@package.inspect}, version: #{@version.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



76
77
78
79
80
# File 'lib/mist_api/models/mxedge_upgrade_info_items.rb', line 76

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} default: #{@default}, distro: #{@distro}, package: #{@package}, version:"\
  " #{@version}>"
end