Class: OCI::OsManagementHub::Models::SystemDetails

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/os_management_hub/models/system_details.rb

Overview

Provides information about the system architecture and operating system.

Constant Summary collapse

ARCHITECTURE_ENUM =
[
  ARCHITECTURE_X86_64 = 'X86_64'.freeze,
  ARCHITECTURE_AARCH64 = 'AARCH64'.freeze,
  ARCHITECTURE_I686 = 'I686'.freeze,
  ARCHITECTURE_NOARCH = 'NOARCH'.freeze,
  ARCHITECTURE_SRC = 'SRC'.freeze,
  ARCHITECTURE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
OS_FAMILY_ENUM =
[
  OS_FAMILY_ORACLE_LINUX_9 = 'ORACLE_LINUX_9'.freeze,
  OS_FAMILY_ORACLE_LINUX_8 = 'ORACLE_LINUX_8'.freeze,
  OS_FAMILY_ORACLE_LINUX_7 = 'ORACLE_LINUX_7'.freeze,
  OS_FAMILY_ORACLE_LINUX_6 = 'ORACLE_LINUX_6'.freeze,
  OS_FAMILY_WINDOWS_SERVER_2016 = 'WINDOWS_SERVER_2016'.freeze,
  OS_FAMILY_WINDOWS_SERVER_2019 = 'WINDOWS_SERVER_2019'.freeze,
  OS_FAMILY_WINDOWS_SERVER_2022 = 'WINDOWS_SERVER_2022'.freeze,
  OS_FAMILY_ALL = 'ALL'.freeze,
  OS_FAMILY_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ SystemDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :architecture (String)

    The value to assign to the #architecture property

  • :ksplice_effective_kernel_version (String)

    The value to assign to the #ksplice_effective_kernel_version property

  • :os_family (String)

    The value to assign to the #os_family property

  • :os_name (String)

    The value to assign to the #os_name property

  • :os_kernel_release (String)

    The value to assign to the #os_kernel_release property

  • :os_kernel_version (String)

    The value to assign to the #os_kernel_version property

  • :os_system_version (String)

    The value to assign to the #os_system_version property



104
105
106
107
108
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
138
139
140
141
142
143
144
145
146
147
# File 'lib/oci/os_management_hub/models/system_details.rb', line 104

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  self.architecture = attributes[:'architecture'] if attributes[:'architecture']

  self.ksplice_effective_kernel_version = attributes[:'kspliceEffectiveKernelVersion'] if attributes[:'kspliceEffectiveKernelVersion']

  raise 'You cannot provide both :kspliceEffectiveKernelVersion and :ksplice_effective_kernel_version' if attributes.key?(:'kspliceEffectiveKernelVersion') && attributes.key?(:'ksplice_effective_kernel_version')

  self.ksplice_effective_kernel_version = attributes[:'ksplice_effective_kernel_version'] if attributes[:'ksplice_effective_kernel_version']

  self.os_family = attributes[:'osFamily'] if attributes[:'osFamily']

  raise 'You cannot provide both :osFamily and :os_family' if attributes.key?(:'osFamily') && attributes.key?(:'os_family')

  self.os_family = attributes[:'os_family'] if attributes[:'os_family']

  self.os_name = attributes[:'osName'] if attributes[:'osName']

  raise 'You cannot provide both :osName and :os_name' if attributes.key?(:'osName') && attributes.key?(:'os_name')

  self.os_name = attributes[:'os_name'] if attributes[:'os_name']

  self.os_kernel_release = attributes[:'osKernelRelease'] if attributes[:'osKernelRelease']

  raise 'You cannot provide both :osKernelRelease and :os_kernel_release' if attributes.key?(:'osKernelRelease') && attributes.key?(:'os_kernel_release')

  self.os_kernel_release = attributes[:'os_kernel_release'] if attributes[:'os_kernel_release']

  self.os_kernel_version = attributes[:'osKernelVersion'] if attributes[:'osKernelVersion']

  raise 'You cannot provide both :osKernelVersion and :os_kernel_version' if attributes.key?(:'osKernelVersion') && attributes.key?(:'os_kernel_version')

  self.os_kernel_version = attributes[:'os_kernel_version'] if attributes[:'os_kernel_version']

  self.os_system_version = attributes[:'osSystemVersion'] if attributes[:'osSystemVersion']

  raise 'You cannot provide both :osSystemVersion and :os_system_version' if attributes.key?(:'osSystemVersion') && attributes.key?(:'os_system_version')

  self.os_system_version = attributes[:'os_system_version'] if attributes[:'os_system_version']
end

Instance Attribute Details

#architectureString

[Required] Architecture type.

Returns:

  • (String)


35
36
37
# File 'lib/oci/os_management_hub/models/system_details.rb', line 35

def architecture
  @architecture
end

#ksplice_effective_kernel_versionString

Version of the Ksplice effective kernel.

Returns:

  • (String)


39
40
41
# File 'lib/oci/os_management_hub/models/system_details.rb', line 39

def ksplice_effective_kernel_version
  @ksplice_effective_kernel_version
end

#os_familyString

[Required] Operating system type.

Returns:

  • (String)


43
44
45
# File 'lib/oci/os_management_hub/models/system_details.rb', line 43

def os_family
  @os_family
end

#os_kernel_releaseString

Release of the kernel.

Returns:

  • (String)


51
52
53
# File 'lib/oci/os_management_hub/models/system_details.rb', line 51

def os_kernel_release
  @os_kernel_release
end

#os_kernel_versionString

Version of the kernel.

Returns:

  • (String)


55
56
57
# File 'lib/oci/os_management_hub/models/system_details.rb', line 55

def os_kernel_version
  @os_kernel_version
end

#os_nameString

[Required] Name of the operating system.

Returns:

  • (String)


47
48
49
# File 'lib/oci/os_management_hub/models/system_details.rb', line 47

def os_name
  @os_name
end

#os_system_versionString

[Required] Version of the operating system.

Returns:

  • (String)


59
60
61
# File 'lib/oci/os_management_hub/models/system_details.rb', line 59

def os_system_version
  @os_system_version
end

Class Method Details

.attribute_mapObject

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



62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/oci/os_management_hub/models/system_details.rb', line 62

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'architecture': :'architecture',
    'ksplice_effective_kernel_version': :'kspliceEffectiveKernelVersion',
    'os_family': :'osFamily',
    'os_name': :'osName',
    'os_kernel_release': :'osKernelRelease',
    'os_kernel_version': :'osKernelVersion',
    'os_system_version': :'osSystemVersion'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/oci/os_management_hub/models/system_details.rb', line 77

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'architecture': :'String',
    'ksplice_effective_kernel_version': :'String',
    'os_family': :'String',
    'os_name': :'String',
    'os_kernel_release': :'String',
    'os_kernel_version': :'String',
    'os_system_version': :'String'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



182
183
184
185
186
187
188
189
190
191
192
193
# File 'lib/oci/os_management_hub/models/system_details.rb', line 182

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    architecture == other.architecture &&
    ksplice_effective_kernel_version == other.ksplice_effective_kernel_version &&
    os_family == other.os_family &&
    os_name == other.os_name &&
    os_kernel_release == other.os_kernel_release &&
    os_kernel_version == other.os_kernel_version &&
    os_system_version == other.os_system_version
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



218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
# File 'lib/oci/os_management_hub/models/system_details.rb', line 218

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)

  self.class.swagger_types.each_pair do |key, type|
    if type =~ /^Array<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        public_method("#{key}=").call(
          attributes[self.class.attribute_map[key]]
            .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
        )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      public_method("#{key}=").call(
        OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
      )
    end
    # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(other) ⇒ Boolean

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


198
199
200
# File 'lib/oci/os_management_hub/models/system_details.rb', line 198

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



207
208
209
# File 'lib/oci/os_management_hub/models/system_details.rb', line 207

def hash
  [architecture, ksplice_effective_kernel_version, os_family, os_name, os_kernel_release, os_kernel_version, os_system_version].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



251
252
253
254
255
256
257
258
259
260
# File 'lib/oci/os_management_hub/models/system_details.rb', line 251

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = public_method(attr).call
    next if value.nil? && !instance_variable_defined?("@#{attr}")

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

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



245
246
247
# File 'lib/oci/os_management_hub/models/system_details.rb', line 245

def to_s
  to_hash.to_s
end