Class: OCI::OsManagementHub::Models::UpdatablePackageSummary

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

Overview

Provides summary information for a software package available for installation on a managed instance.

Constant Summary collapse

UPDATE_TYPE_ENUM =
[
  UPDATE_TYPE_SECURITY = 'SECURITY'.freeze,
  UPDATE_TYPE_BUGFIX = 'BUGFIX'.freeze,
  UPDATE_TYPE_ENHANCEMENT = 'ENHANCEMENT'.freeze,
  UPDATE_TYPE_OTHER = 'OTHER'.freeze,
  UPDATE_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
ADVISORY_SEVERITY_ENUM =
[
  ADVISORY_SEVERITY_LOW = 'LOW'.freeze,
  ADVISORY_SEVERITY_MODERATE = 'MODERATE'.freeze,
  ADVISORY_SEVERITY_IMPORTANT = 'IMPORTANT'.freeze,
  ADVISORY_SEVERITY_CRITICAL = 'CRITICAL'.freeze,
  ADVISORY_SEVERITY_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Constants inherited from PackageSummary

PackageSummary::ARCHITECTURE_ENUM, PackageSummary::PACKAGE_CLASSIFICATION_ENUM

Instance Attribute Summary collapse

Attributes inherited from PackageSummary

#architecture, #display_name, #name, #package_classification, #software_sources, #type, #version

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from PackageSummary

get_subtype

Constructor Details

#initialize(attributes = {}) ⇒ UpdatablePackageSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
# File 'lib/oci/os_management_hub/models/updatable_package_summary.rb', line 106

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

  attributes['packageClassification'] = 'UPDATABLE'

  super(attributes)

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

  self.installed_version = attributes[:'installedVersion'] if attributes[:'installedVersion']

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

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

  self.update_type = attributes[:'updateType'] if attributes[:'updateType']

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

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

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

  self.related_cves = attributes[:'relatedCves'] if attributes[:'relatedCves']

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

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

  self.advisory_severity = attributes[:'advisorySeverity'] if attributes[:'advisorySeverity']

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

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

Instance Attribute Details

#advisory_severityString

The severity level of the security update. Only applicable when updateType is SECURITY.

Returns:

  • (String)


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

def advisory_severity
  @advisory_severity
end

#errataArray<String>

List of errata applicable to this update.

Returns:

  • (Array<String>)


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

def errata
  @errata
end

#installed_versionString

The version of the package that is currently installed on the instance.

Returns:

  • (String)


31
32
33
# File 'lib/oci/os_management_hub/models/updatable_package_summary.rb', line 31

def installed_version
  @installed_version
end

List of CVEs applicable to this erratum.

Returns:

  • (Array<String>)


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

def related_cves
  @related_cves
end

#update_typeString

[Required] The type of update.

Returns:

  • (String)


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

def update_type
  @update_type
end

Class Method Details

.attribute_mapObject

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



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/oci/os_management_hub/models/updatable_package_summary.rb', line 50

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'display_name': :'displayName',
    'name': :'name',
    'type': :'type',
    'version': :'version',
    'architecture': :'architecture',
    'software_sources': :'softwareSources',
    'package_classification': :'packageClassification',
    'installed_version': :'installedVersion',
    'update_type': :'updateType',
    'errata': :'errata',
    'related_cves': :'relatedCves',
    'advisory_severity': :'advisorySeverity'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/oci/os_management_hub/models/updatable_package_summary.rb', line 70

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'display_name': :'String',
    'name': :'String',
    'type': :'String',
    'version': :'String',
    'architecture': :'String',
    'software_sources': :'Array<OCI::OsManagementHub::Models::SoftwareSourceDetails>',
    'package_classification': :'String',
    'installed_version': :'String',
    'update_type': :'String',
    'errata': :'Array<String>',
    'related_cves': :'Array<String>',
    'advisory_severity': :'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



176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# File 'lib/oci/os_management_hub/models/updatable_package_summary.rb', line 176

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

  self.class == other.class &&
    display_name == other.display_name &&
    name == other.name &&
    type == other.type &&
    version == other.version &&
    architecture == other.architecture &&
    software_sources == other.software_sources &&
    package_classification == other.package_classification &&
    installed_version == other.installed_version &&
    update_type == other.update_type &&
    errata == other.errata &&
    related_cves == other.related_cves &&
    advisory_severity == other.advisory_severity
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



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

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


197
198
199
# File 'lib/oci/os_management_hub/models/updatable_package_summary.rb', line 197

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



206
207
208
# File 'lib/oci/os_management_hub/models/updatable_package_summary.rb', line 206

def hash
  [display_name, name, type, version, architecture, software_sources, package_classification, installed_version, update_type, errata, related_cves, advisory_severity].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



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

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



244
245
246
# File 'lib/oci/os_management_hub/models/updatable_package_summary.rb', line 244

def to_s
  to_hash.to_s
end