Class: OCI::Dblm::Models::VulnerabilityResourceSummary

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

Overview

The assessed Resources.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ VulnerabilityResourceSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
# File 'lib/oci/dblm/models/vulnerability_resource_summary.rb', line 131

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

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

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

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

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

  self.time_config_collected = attributes[:'timeConfigCollected'] if attributes[:'timeConfigCollected']

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

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

  self.time_scan_ended = attributes[:'timeScanEnded'] if attributes[:'timeScanEnded']

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

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

  self.image_id = attributes[:'imageId'] if attributes[:'imageId']

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

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

  self.subscribed_image = attributes[:'subscribedImage'] if attributes[:'subscribedImage']

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

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

  self.metric_errors = attributes[:'metricErrors'] if attributes[:'metricErrors']

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

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

  self.child_pdbs = attributes[:'childPdbs'] if attributes[:'childPdbs']

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

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

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

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

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

Instance Attribute Details

#child_pdbsArray<OCI::Dblm::Models::ChildPdb>

[Required] PDBs for a CDB.

Returns:



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

def child_pdbs
  @child_pdbs
end

#idString

[Required] The resource ID for this resource.

Returns:

  • (String)


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

def id
  @id
end

#image_idString

[Required] Identifier for the resource is subscribed to.

Returns:

  • (String)


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

def image_id
  @image_id
end

#metric_errorsArray<OCI::Dblm::Models::MetricError>

[Required] Metric errors.

Returns:



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

def metric_errors
  @metric_errors
end

#nameString

[Required] The name of the resource.

Returns:

  • (String)


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

def name
  @name
end

#patch_recommendations_detailsArray<OCI::Dblm::Models::PatchRecommendationsDetailsSummary>

[Required] List of the patch recommendations for databases



65
66
67
# File 'lib/oci/dblm/models/vulnerability_resource_summary.rb', line 65

def patch_recommendations_details
  @patch_recommendations_details
end

#patch_recommendations_summaryObject

[Required] Summary of the patch recommendations for databases.

Returns:

  • (Object)


61
62
63
# File 'lib/oci/dblm/models/vulnerability_resource_summary.rb', line 61

def patch_recommendations_summary
  @patch_recommendations_summary
end

#platformString

[Required] A string representing the platform of the resource.

Returns:

  • (String)


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

def platform
  @platform
end

#releaseString

[Required] A string representing the release of the resource.

Returns:

  • (String)


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

def release
  @release
end

#subscribed_imageString

[Required] Image the resource is subscribed to.

Returns:

  • (String)


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

def subscribed_image
  @subscribed_image
end

#time_config_collectedDateTime

[Required] Time when the latest configuration collection happened.

Returns:

  • (DateTime)


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

def time_config_collected
  @time_config_collected
end

#time_scan_endedDateTime

[Required] Time when the latest scan happened for the resource.

Returns:

  • (DateTime)


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

def time_scan_ended
  @time_scan_ended
end

#versionString

[Required] A string representing the version of the resource.

Returns:

  • (String)


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

def version
  @version
end

#vulnerabilities_summaryObject

[Required] Summary of the resources that are registered and may or may not have vulnerabilities.

Returns:

  • (Object)


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

def vulnerabilities_summary
  @vulnerabilities_summary
end

Class Method Details

.attribute_mapObject

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



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

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'name': :'name',
    'version': :'version',
    'release': :'release',
    'platform': :'platform',
    'time_config_collected': :'timeConfigCollected',
    'time_scan_ended': :'timeScanEnded',
    'image_id': :'imageId',
    'subscribed_image': :'subscribedImage',
    'metric_errors': :'metricErrors',
    'child_pdbs': :'childPdbs',
    'vulnerabilities_summary': :'vulnerabilitiesSummary',
    'patch_recommendations_summary': :'patchRecommendationsSummary',
    'patch_recommendations_details': :'patchRecommendationsDetails'
    # 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
106
107
108
109
# File 'lib/oci/dblm/models/vulnerability_resource_summary.rb', line 90

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'name': :'String',
    'version': :'String',
    'release': :'String',
    'platform': :'String',
    'time_config_collected': :'DateTime',
    'time_scan_ended': :'DateTime',
    'image_id': :'String',
    'subscribed_image': :'String',
    'metric_errors': :'Array<OCI::Dblm::Models::MetricError>',
    'child_pdbs': :'Array<OCI::Dblm::Models::ChildPdb>',
    'vulnerabilities_summary': :'Object',
    'patch_recommendations_summary': :'Object',
    'patch_recommendations_details': :'Array<OCI::Dblm::Models::PatchRecommendationsDetailsSummary>'
    # 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



209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
# File 'lib/oci/dblm/models/vulnerability_resource_summary.rb', line 209

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

  self.class == other.class &&
    id == other.id &&
    name == other.name &&
    version == other.version &&
    release == other.release &&
    platform == other.platform &&
    time_config_collected == other.time_config_collected &&
    time_scan_ended == other.time_scan_ended &&
    image_id == other.image_id &&
    subscribed_image == other.subscribed_image &&
    metric_errors == other.metric_errors &&
    child_pdbs == other.child_pdbs &&
    vulnerabilities_summary == other.vulnerabilities_summary &&
    patch_recommendations_summary == other.patch_recommendations_summary &&
    patch_recommendations_details == other.patch_recommendations_details
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



252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
# File 'lib/oci/dblm/models/vulnerability_resource_summary.rb', line 252

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


232
233
234
# File 'lib/oci/dblm/models/vulnerability_resource_summary.rb', line 232

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



241
242
243
# File 'lib/oci/dblm/models/vulnerability_resource_summary.rb', line 241

def hash
  [id, name, version, release, platform, time_config_collected, time_scan_ended, image_id, subscribed_image, metric_errors, child_pdbs, vulnerabilities_summary, patch_recommendations_summary, patch_recommendations_details].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



285
286
287
288
289
290
291
292
293
294
# File 'lib/oci/dblm/models/vulnerability_resource_summary.rb', line 285

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



279
280
281
# File 'lib/oci/dblm/models/vulnerability_resource_summary.rb', line 279

def to_s
  to_hash.to_s
end