Class: OCI::Dblm::Models::DblmVulnerability

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

Overview

A Dblm Vulnerability is a description of a Dblm Vulnerability.

To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, talk to an administrator. If you're an administrator who needs to write policies to give users access, see Getting Started with Policies.

Constant Summary collapse

LIFECYCLE_STATE_ENUM =
[
  LIFECYCLE_STATE_CREATING = 'CREATING'.freeze,
  LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze,
  LIFECYCLE_STATE_FAILED = 'FAILED'.freeze,
  LIFECYCLE_STATE_NEEDS_ATTENTION = 'NEEDS_ATTENTION'.freeze,
  LIFECYCLE_STATE_DELETING = 'DELETING'.freeze,
  LIFECYCLE_STATE_DELETED = 'DELETED'.freeze,
  LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ DblmVulnerability

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
174
175
176
177
178
179
180
# File 'lib/oci/dblm/models/dblm_vulnerability.rb', line 123

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

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

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

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

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

  self.time_enabled = attributes[:'timeEnabled'] if attributes[:'timeEnabled']

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

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

  self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState']

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

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

  self.resources_summary = attributes[:'resourcesSummary'] if attributes[:'resourcesSummary']

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

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

  self.vulnerabilities_summary = attributes[:'vulnerabilitiesSummary'] if attributes[:'vulnerabilitiesSummary']

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

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

  self.patch_recommendations_summary = attributes[:'patchRecommendationsSummary'] if attributes[:'patchRecommendationsSummary']

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

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

  self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']

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

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

  self.system_tags = attributes[:'systemTags'] if attributes[:'systemTags']

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

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

Instance Attribute Details

#compartment_idString

[Required] Compartment Identifier.

Returns:

  • (String)


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

def compartment_id
  @compartment_id
end

#freeform_tagsHash<String, String>

Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {\"bar-key\": \"value\"}

Returns:

  • (Hash<String, String>)


63
64
65
# File 'lib/oci/dblm/models/dblm_vulnerability.rb', line 63

def freeform_tags
  @freeform_tags
end

#lifecycle_stateString

The current state of the feature.

Returns:

  • (String)


45
46
47
# File 'lib/oci/dblm/models/dblm_vulnerability.rb', line 45

def lifecycle_state
  @lifecycle_state
end

#messageString

A message describing the status of the feature's state.

Returns:

  • (String)


37
38
39
# File 'lib/oci/dblm/models/dblm_vulnerability.rb', line 37

def message
  @message
end

#patch_recommendations_summaryObject

Summary of the patch recommendations for databases.

Returns:

  • (Object)


57
58
59
# File 'lib/oci/dblm/models/dblm_vulnerability.rb', line 57

def patch_recommendations_summary
  @patch_recommendations_summary
end

#resourcesArray<OCI::Dblm::Models::ResourceInfo>

Resources objects.



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

def resources
  @resources
end

#resources_summaryObject

Summary of dblm registered and unregistered resources.

Returns:

  • (Object)


49
50
51
# File 'lib/oci/dblm/models/dblm_vulnerability.rb', line 49

def resources_summary
  @resources_summary
end

#system_tagsHash<String, Hash<String, Object>>

System tags for this resource. Each key is predefined and scoped to a namespace. Example: {\"orcl-cloud\": {\"free-tier-retained\": \"true\"}}

Returns:

  • (Hash<String, Hash<String, Object>>)


69
70
71
# File 'lib/oci/dblm/models/dblm_vulnerability.rb', line 69

def system_tags
  @system_tags
end

#time_enabledDateTime

The time the the Vulnerability was enabled. An RFC3339 formatted datetime string.

Returns:

  • (DateTime)


41
42
43
# File 'lib/oci/dblm/models/dblm_vulnerability.rb', line 41

def time_enabled
  @time_enabled
end

#vulnerabilities_summaryObject

Summary of vulnerabilities found in registered resources grouped by severity.

Returns:

  • (Object)


53
54
55
# File 'lib/oci/dblm/models/dblm_vulnerability.rb', line 53

def vulnerabilities_summary
  @vulnerabilities_summary
end

Class Method Details

.attribute_mapObject

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



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

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'compartment_id': :'compartmentId',
    'resources': :'resources',
    'message': :'message',
    'time_enabled': :'timeEnabled',
    'lifecycle_state': :'lifecycleState',
    'resources_summary': :'resourcesSummary',
    'vulnerabilities_summary': :'vulnerabilitiesSummary',
    'patch_recommendations_summary': :'patchRecommendationsSummary',
    'freeform_tags': :'freeformTags',
    'system_tags': :'systemTags'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



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

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'compartment_id': :'String',
    'resources': :'Array<OCI::Dblm::Models::ResourceInfo>',
    'message': :'String',
    'time_enabled': :'DateTime',
    'lifecycle_state': :'String',
    'resources_summary': :'Object',
    'vulnerabilities_summary': :'Object',
    'patch_recommendations_summary': :'Object',
    'freeform_tags': :'Hash<String, String>',
    'system_tags': :'Hash<String, Hash<String, Object>>'
    # 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



202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# File 'lib/oci/dblm/models/dblm_vulnerability.rb', line 202

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

  self.class == other.class &&
    compartment_id == other.compartment_id &&
    resources == other.resources &&
    message == other.message &&
    time_enabled == other.time_enabled &&
    lifecycle_state == other.lifecycle_state &&
    resources_summary == other.resources_summary &&
    vulnerabilities_summary == other.vulnerabilities_summary &&
    patch_recommendations_summary == other.patch_recommendations_summary &&
    freeform_tags == other.freeform_tags &&
    system_tags == other.system_tags
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



241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
# File 'lib/oci/dblm/models/dblm_vulnerability.rb', line 241

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


221
222
223
# File 'lib/oci/dblm/models/dblm_vulnerability.rb', line 221

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



230
231
232
# File 'lib/oci/dblm/models/dblm_vulnerability.rb', line 230

def hash
  [compartment_id, resources, message, time_enabled, lifecycle_state, resources_summary, vulnerabilities_summary, patch_recommendations_summary, freeform_tags, system_tags].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



274
275
276
277
278
279
280
281
282
283
# File 'lib/oci/dblm/models/dblm_vulnerability.rb', line 274

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



268
269
270
# File 'lib/oci/dblm/models/dblm_vulnerability.rb', line 268

def to_s
  to_hash.to_s
end