Class: OCI::OsManagementHub::Models::ErratumSummary

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

Overview

Provides summary information for an erratum. An erratum is an important software change which can include security advisories, bug fixes, or enhancements.

Constant Summary collapse

CLASSIFICATION_TYPE_ENUM =
[
  CLASSIFICATION_TYPE_SECURITY = 'SECURITY'.freeze,
  CLASSIFICATION_TYPE_BUGFIX = 'BUGFIX'.freeze,
  CLASSIFICATION_TYPE_ENHANCEMENT = 'ENHANCEMENT'.freeze,
  CLASSIFICATION_TYPE_OTHER = 'OTHER'.freeze,
  CLASSIFICATION_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
ADVISORY_TYPE_ENUM =
[
  ADVISORY_TYPE_SECURITY = 'SECURITY'.freeze,
  ADVISORY_TYPE_BUGFIX = 'BUGFIX'.freeze,
  ADVISORY_TYPE_ENHANCEMENT = 'ENHANCEMENT'.freeze,
  ADVISORY_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ErratumSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :name (String)

    The value to assign to the #name property

  • :synopsis (String)

    The value to assign to the #synopsis property

  • :time_issued (DateTime)

    The value to assign to the #time_issued property

  • :time_updated (DateTime)

    The value to assign to the #time_updated property

  • :classification_type (String)

    The value to assign to the #classification_type property

  • :related_cves (Array<String>)

    The value to assign to the #related_cves property

  • :os_families (Array<OCI::OsManagementHub::Models::OsFamily>)

    The value to assign to the #os_families property

  • :advisory_severity (String)

    The value to assign to the #advisory_severity property

  • :advisory_type (String)

    The value to assign to the #advisory_type property



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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# File 'lib/oci/os_management_hub/models/erratum_summary.rb', line 122

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.name = attributes[:'name'] if attributes[:'name']

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

  self.time_issued = attributes[:'timeIssued'] if attributes[:'timeIssued']

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

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

  self.time_updated = attributes[:'timeUpdated'] if attributes[:'timeUpdated']

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

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

  self.classification_type = attributes[:'classificationType'] if attributes[:'classificationType']

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

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

  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.os_families = attributes[:'osFamilies'] if attributes[:'osFamilies']

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

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

  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']

  self.advisory_type = attributes[:'advisoryType'] if attributes[:'advisoryType']

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

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

Instance Attribute Details

#advisory_severityString

The severity advisory. Only valid for security type advisories.

Returns:

  • (String)


67
68
69
# File 'lib/oci/os_management_hub/models/erratum_summary.rb', line 67

def advisory_severity
  @advisory_severity
end

#advisory_typeString

The advisory type of the erratum.

Returns:

  • (String)


71
72
73
# File 'lib/oci/os_management_hub/models/erratum_summary.rb', line 71

def advisory_type
  @advisory_type
end

#classification_typeString

Type of the erratum. This property is deprecated and it will be removed in a future API release. Please refer to the advisoryType property instead.

Returns:

  • (String)


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

def classification_type
  @classification_type
end

#nameString

[Required] Advisory name.

Returns:

  • (String)


37
38
39
# File 'lib/oci/os_management_hub/models/erratum_summary.rb', line 37

def name
  @name
end

#os_familiesArray<OCI::OsManagementHub::Models::OsFamily>

List of affected OS families.

Returns:

  • (Array<OCI::OsManagementHub::Models::OsFamily>)


63
64
65
# File 'lib/oci/os_management_hub/models/erratum_summary.rb', line 63

def os_families
  @os_families
end

List of CVEs applicable to this erratum.

Returns:

  • (Array<String>)


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

def related_cves
  @related_cves
end

#synopsisString

Summary description of the erratum.

Returns:

  • (String)


41
42
43
# File 'lib/oci/os_management_hub/models/erratum_summary.rb', line 41

def synopsis
  @synopsis
end

#time_issuedDateTime

The date and time the erratum was issued (in RFC 3339 format).

Returns:

  • (DateTime)


46
47
48
# File 'lib/oci/os_management_hub/models/erratum_summary.rb', line 46

def time_issued
  @time_issued
end

#time_updatedDateTime

The date and time the erratum was updated (in RFC 3339 format).

Returns:

  • (DateTime)


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

def time_updated
  @time_updated
end

Class Method Details

.attribute_mapObject

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



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

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'name': :'name',
    'synopsis': :'synopsis',
    'time_issued': :'timeIssued',
    'time_updated': :'timeUpdated',
    'classification_type': :'classificationType',
    'related_cves': :'relatedCves',
    'os_families': :'osFamilies',
    'advisory_severity': :'advisorySeverity',
    'advisory_type': :'advisoryType'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/oci/os_management_hub/models/erratum_summary.rb', line 91

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'name': :'String',
    'synopsis': :'String',
    'time_issued': :'DateTime',
    'time_updated': :'DateTime',
    'classification_type': :'String',
    'related_cves': :'Array<String>',
    'os_families': :'Array<OCI::OsManagementHub::Models::OsFamily>',
    'advisory_severity': :'String',
    'advisory_type': :'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



221
222
223
224
225
226
227
228
229
230
231
232
233
234
# File 'lib/oci/os_management_hub/models/erratum_summary.rb', line 221

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

  self.class == other.class &&
    name == other.name &&
    synopsis == other.synopsis &&
    time_issued == other.time_issued &&
    time_updated == other.time_updated &&
    classification_type == other.classification_type &&
    related_cves == other.related_cves &&
    os_families == other.os_families &&
    advisory_severity == other.advisory_severity &&
    advisory_type == other.advisory_type
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



259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
# File 'lib/oci/os_management_hub/models/erratum_summary.rb', line 259

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


239
240
241
# File 'lib/oci/os_management_hub/models/erratum_summary.rb', line 239

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



248
249
250
# File 'lib/oci/os_management_hub/models/erratum_summary.rb', line 248

def hash
  [name, synopsis, time_issued, time_updated, classification_type, related_cves, os_families, advisory_severity, advisory_type].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



292
293
294
295
296
297
298
299
300
301
# File 'lib/oci/os_management_hub/models/erratum_summary.rb', line 292

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



286
287
288
# File 'lib/oci/os_management_hub/models/erratum_summary.rb', line 286

def to_s
  to_hash.to_s
end