Class: OCI::Dblm::Models::PatchRecommendationsDetailsSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/dblm/models/patch_recommendations_details_summary.rb

Overview

Summary of patch recommendations for databases.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ PatchRecommendationsDetailsSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :patch_name (String)

    The value to assign to the #patch_name property

  • :abstract_text (String)

    The value to assign to the #abstract_text property

  • :classification_name (String)

    The value to assign to the #classification_name property

  • :time_evaluated (DateTime)

    The value to assign to the #time_evaluated property

  • :has_fix_for_cve (BOOLEAN)

    The value to assign to the #has_fix_for_cve property

  • :time_released (DateTime)

    The value to assign to the #time_released property



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/oci/dblm/models/patch_recommendations_details_summary.rb', line 75

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

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

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

  self.abstract_text = attributes[:'abstractText'] if attributes[:'abstractText']

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

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

  self.classification_name = attributes[:'classificationName'] if attributes[:'classificationName']

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

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

  self.time_evaluated = attributes[:'timeEvaluated'] if attributes[:'timeEvaluated']

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

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

  self.has_fix_for_cve = attributes[:'hasFixForCve'] unless attributes[:'hasFixForCve'].nil?

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

  self.has_fix_for_cve = attributes[:'has_fix_for_cve'] unless attributes[:'has_fix_for_cve'].nil?

  self.time_released = attributes[:'timeReleased'] if attributes[:'timeReleased']

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

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

Instance Attribute Details

#abstract_textString

[Required] Description of the patch recommendation.

Returns:

  • (String)


17
18
19
# File 'lib/oci/dblm/models/patch_recommendations_details_summary.rb', line 17

def abstract_text
  @abstract_text
end

#classification_nameString

[Required] Classification of the patch recommendation.

Returns:

  • (String)


21
22
23
# File 'lib/oci/dblm/models/patch_recommendations_details_summary.rb', line 21

def classification_name
  @classification_name
end

#has_fix_for_cveBOOLEAN

[Required] If the patch has a fix for a CVE.

Returns:

  • (BOOLEAN)


29
30
31
# File 'lib/oci/dblm/models/patch_recommendations_details_summary.rb', line 29

def has_fix_for_cve
  @has_fix_for_cve
end

#patch_nameString

[Required] Name of the patch recommendation.

Returns:

  • (String)


13
14
15
# File 'lib/oci/dblm/models/patch_recommendations_details_summary.rb', line 13

def patch_name
  @patch_name
end

#time_evaluatedDateTime

[Required] Evaluation date for the patch recommendation.

Returns:

  • (DateTime)


25
26
27
# File 'lib/oci/dblm/models/patch_recommendations_details_summary.rb', line 25

def time_evaluated
  @time_evaluated
end

#time_releasedDateTime

[Required] Release date for the patch.

Returns:

  • (DateTime)


33
34
35
# File 'lib/oci/dblm/models/patch_recommendations_details_summary.rb', line 33

def time_released
  @time_released
end

Class Method Details

.attribute_mapObject

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



36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/oci/dblm/models/patch_recommendations_details_summary.rb', line 36

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'patch_name': :'patchName',
    'abstract_text': :'abstractText',
    'classification_name': :'classificationName',
    'time_evaluated': :'timeEvaluated',
    'has_fix_for_cve': :'hasFixForCve',
    'time_released': :'timeReleased'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/oci/dblm/models/patch_recommendations_details_summary.rb', line 50

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'patch_name': :'String',
    'abstract_text': :'String',
    'classification_name': :'String',
    'time_evaluated': :'DateTime',
    'has_fix_for_cve': :'BOOLEAN',
    'time_released': :'DateTime'
    # 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



125
126
127
128
129
130
131
132
133
134
135
# File 'lib/oci/dblm/models/patch_recommendations_details_summary.rb', line 125

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

  self.class == other.class &&
    patch_name == other.patch_name &&
    abstract_text == other.abstract_text &&
    classification_name == other.classification_name &&
    time_evaluated == other.time_evaluated &&
    has_fix_for_cve == other.has_fix_for_cve &&
    time_released == other.time_released
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



160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# File 'lib/oci/dblm/models/patch_recommendations_details_summary.rb', line 160

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


140
141
142
# File 'lib/oci/dblm/models/patch_recommendations_details_summary.rb', line 140

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



149
150
151
# File 'lib/oci/dblm/models/patch_recommendations_details_summary.rb', line 149

def hash
  [patch_name, abstract_text, classification_name, time_evaluated, has_fix_for_cve, time_released].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



193
194
195
196
197
198
199
200
201
202
# File 'lib/oci/dblm/models/patch_recommendations_details_summary.rb', line 193

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



187
188
189
# File 'lib/oci/dblm/models/patch_recommendations_details_summary.rb', line 187

def to_s
  to_hash.to_s
end