Class: OCI::CloudGuard::Models::Problem

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/cloud_guard/models/problem.rb

Overview

Problem Definition.

Constant Summary collapse

RISK_LEVEL_ENUM =
[
  RISK_LEVEL_CRITICAL = 'CRITICAL'.freeze,
  RISK_LEVEL_HIGH = 'HIGH'.freeze,
  RISK_LEVEL_MEDIUM = 'MEDIUM'.freeze,
  RISK_LEVEL_LOW = 'LOW'.freeze,
  RISK_LEVEL_MINOR = 'MINOR'.freeze,
  RISK_LEVEL_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
LIFECYCLE_STATE_ENUM =
[
  LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze,
  LIFECYCLE_STATE_INACTIVE = 'INACTIVE'.freeze,
  LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
LIFECYCLE_DETAIL_ENUM =
[
  LIFECYCLE_DETAIL_OPEN = 'OPEN'.freeze,
  LIFECYCLE_DETAIL_RESOLVED = 'RESOLVED'.freeze,
  LIFECYCLE_DETAIL_DISMISSED = 'DISMISSED'.freeze,
  LIFECYCLE_DETAIL_DELETED = 'DELETED'.freeze,
  LIFECYCLE_DETAIL_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
DETECTOR_ID_ENUM =
[
  DETECTOR_ID_IAAS_ACTIVITY_DETECTOR = 'IAAS_ACTIVITY_DETECTOR'.freeze,
  DETECTOR_ID_IAAS_CONFIGURATION_DETECTOR = 'IAAS_CONFIGURATION_DETECTOR'.freeze,
  DETECTOR_ID_IAAS_THREAT_DETECTOR = 'IAAS_THREAT_DETECTOR'.freeze,
  DETECTOR_ID_IAAS_LOG_INSIGHT_DETECTOR = 'IAAS_LOG_INSIGHT_DETECTOR'.freeze,
  DETECTOR_ID_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Problem

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :id (String)

    The value to assign to the #id property

  • :compartment_id (String)

    The value to assign to the #compartment_id property

  • :detector_rule_id (String)

    The value to assign to the #detector_rule_id property

  • :region (String)

    The value to assign to the #region property

  • :regions (Array<String>)

    The value to assign to the #regions property

  • :risk_level (String)

    The value to assign to the #risk_level property

  • :risk_score (Float)

    The value to assign to the #risk_score property

  • :peak_risk_score_date (String)

    The value to assign to the #peak_risk_score_date property

  • :peak_risk_score (Float)

    The value to assign to the #peak_risk_score property

  • :auto_resolve_date (String)

    The value to assign to the #auto_resolve_date property

  • :peak_risk_score_lookup_period_in_days (Integer)

    The value to assign to the #peak_risk_score_lookup_period_in_days property

  • :resource_id (String)

    The value to assign to the #resource_id property

  • :resource_name (String)

    The value to assign to the #resource_name property

  • :resource_type (String)

    The value to assign to the #resource_type property

  • :labels (Array<String>)

    The value to assign to the #labels property

  • :time_last_detected (DateTime)

    The value to assign to the #time_last_detected property

  • :time_first_detected (DateTime)

    The value to assign to the #time_first_detected property

  • :lifecycle_state (String)

    The value to assign to the #lifecycle_state property

  • :lifecycle_detail (String)

    The value to assign to the #lifecycle_detail property

  • :detector_id (String)

    The value to assign to the #detector_id property

  • :target_id (String)

    The value to assign to the #target_id property

  • :additional_details (Hash<String, String>)

    The value to assign to the #additional_details property

  • :description (String)

    The value to assign to the #description property

  • :recommendation (String)

    The value to assign to the #recommendation property

  • :comment (String)

    The value to assign to the #comment property

  • :impacted_resource_id (String)

    The value to assign to the #impacted_resource_id property

  • :impacted_resource_name (String)

    The value to assign to the #impacted_resource_name property

  • :impacted_resource_type (String)

    The value to assign to the #impacted_resource_type property



261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
# File 'lib/oci/cloud_guard/models/problem.rb', line 261

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

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

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

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

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

  self.risk_level = attributes[:'riskLevel'] if attributes[:'riskLevel']

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

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

  self.risk_score = attributes[:'riskScore'] if attributes[:'riskScore']

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

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

  self.peak_risk_score_date = attributes[:'peakRiskScoreDate'] if attributes[:'peakRiskScoreDate']

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

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

  self.peak_risk_score = attributes[:'peakRiskScore'] if attributes[:'peakRiskScore']

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

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

  self.auto_resolve_date = attributes[:'autoResolveDate'] if attributes[:'autoResolveDate']

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

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

  self.peak_risk_score_lookup_period_in_days = attributes[:'peakRiskScoreLookupPeriodInDays'] if attributes[:'peakRiskScoreLookupPeriodInDays']

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

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

  self.resource_id = attributes[:'resourceId'] if attributes[:'resourceId']

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

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

  self.resource_name = attributes[:'resourceName'] if attributes[:'resourceName']

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

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

  self.resource_type = attributes[:'resourceType'] if attributes[:'resourceType']

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

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

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

  self.time_last_detected = attributes[:'timeLastDetected'] if attributes[:'timeLastDetected']

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

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

  self.time_first_detected = attributes[:'timeFirstDetected'] if attributes[:'timeFirstDetected']

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

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

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

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

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

  self.detector_id = attributes[:'detectorId'] if attributes[:'detectorId']

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

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

  self.target_id = attributes[:'targetId'] if attributes[:'targetId']

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

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

  self.additional_details = attributes[:'additionalDetails'] if attributes[:'additionalDetails']

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

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

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

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

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

  self.impacted_resource_id = attributes[:'impactedResourceId'] if attributes[:'impactedResourceId']

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

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

  self.impacted_resource_name = attributes[:'impactedResourceName'] if attributes[:'impactedResourceName']

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

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

  self.impacted_resource_type = attributes[:'impactedResourceType'] if attributes[:'impactedResourceType']

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

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

Instance Attribute Details

#additional_detailsHash<String, String>

The additional details of the Problem

Returns:

  • (Hash<String, String>)


129
130
131
# File 'lib/oci/cloud_guard/models/problem.rb', line 129

def additional_details
  @additional_details
end

#auto_resolve_dateString

The date and time when the problem will be auto resolved. Format defined by RFC3339.

Returns:

  • (String)


81
82
83
# File 'lib/oci/cloud_guard/models/problem.rb', line 81

def auto_resolve_date
  @auto_resolve_date
end

#commentString

User Comments

Returns:

  • (String)


141
142
143
# File 'lib/oci/cloud_guard/models/problem.rb', line 141

def comment
  @comment
end

#compartment_idString

[Required] Compartment Identifier where the resource is created

Returns:

  • (String)


49
50
51
# File 'lib/oci/cloud_guard/models/problem.rb', line 49

def compartment_id
  @compartment_id
end

#descriptionString

Description of the problem

Returns:

  • (String)


133
134
135
# File 'lib/oci/cloud_guard/models/problem.rb', line 133

def description
  @description
end

#detector_idString

Id of the detector associated with the Problem.

Returns:

  • (String)


121
122
123
# File 'lib/oci/cloud_guard/models/problem.rb', line 121

def detector_id
  @detector_id
end

#detector_rule_idString

Identifier of the rule

Returns:

  • (String)


53
54
55
# File 'lib/oci/cloud_guard/models/problem.rb', line 53

def detector_rule_id
  @detector_rule_id
end

#idString

[Required] Unique identifier that is immutable on creation

Returns:

  • (String)


45
46
47
# File 'lib/oci/cloud_guard/models/problem.rb', line 45

def id
  @id
end

#impacted_resource_idString

Identifier of the impacted Resource

Returns:

  • (String)


145
146
147
# File 'lib/oci/cloud_guard/models/problem.rb', line 145

def impacted_resource_id
  @impacted_resource_id
end

#impacted_resource_nameString

DisplayName of the impacted Resource

Returns:

  • (String)


149
150
151
# File 'lib/oci/cloud_guard/models/problem.rb', line 149

def impacted_resource_name
  @impacted_resource_name
end

#impacted_resource_typeString

Type of the impacted Resource

Returns:

  • (String)


153
154
155
# File 'lib/oci/cloud_guard/models/problem.rb', line 153

def impacted_resource_type
  @impacted_resource_type
end

#labelsArray<String>

user defined labels on the problem

Returns:

  • (Array<String>)


101
102
103
# File 'lib/oci/cloud_guard/models/problem.rb', line 101

def labels
  @labels
end

#lifecycle_detailString

The lifecycleDetail will give more detail on the substate of the lifecycleState.

Returns:

  • (String)


117
118
119
# File 'lib/oci/cloud_guard/models/problem.rb', line 117

def lifecycle_detail
  @lifecycle_detail
end

#lifecycle_stateString

The current state of the Problem.

Returns:

  • (String)


113
114
115
# File 'lib/oci/cloud_guard/models/problem.rb', line 113

def lifecycle_state
  @lifecycle_state
end

#peak_risk_scoreFloat

Peak risk score for the problem

Returns:

  • (Float)


77
78
79
# File 'lib/oci/cloud_guard/models/problem.rb', line 77

def peak_risk_score
  @peak_risk_score
end

#peak_risk_score_dateString

The date and time for the peak risk score that is observed. Format defined by RFC3339.

Returns:

  • (String)


73
74
75
# File 'lib/oci/cloud_guard/models/problem.rb', line 73

def peak_risk_score_date
  @peak_risk_score_date
end

#peak_risk_score_lookup_period_in_daysInteger

Number of days for which peak score is calculated for the problem

Returns:

  • (Integer)


85
86
87
# File 'lib/oci/cloud_guard/models/problem.rb', line 85

def peak_risk_score_lookup_period_in_days
  @peak_risk_score_lookup_period_in_days
end

#recommendationString

Recommendation for the problem

Returns:

  • (String)


137
138
139
# File 'lib/oci/cloud_guard/models/problem.rb', line 137

def recommendation
  @recommendation
end

#regionString

DEPRECATED

Returns:

  • (String)


57
58
59
# File 'lib/oci/cloud_guard/models/problem.rb', line 57

def region
  @region
end

#regionsArray<String>

Regions where the problem is found

Returns:

  • (Array<String>)


61
62
63
# File 'lib/oci/cloud_guard/models/problem.rb', line 61

def regions
  @regions
end

#resource_idString

Identifier of the Resource

Returns:

  • (String)


89
90
91
# File 'lib/oci/cloud_guard/models/problem.rb', line 89

def resource_id
  @resource_id
end

#resource_nameString

DisplayName of the Resource

Returns:

  • (String)


93
94
95
# File 'lib/oci/cloud_guard/models/problem.rb', line 93

def resource_name
  @resource_name
end

#resource_typeString

Type of the Resource

Returns:

  • (String)


97
98
99
# File 'lib/oci/cloud_guard/models/problem.rb', line 97

def resource_type
  @resource_type
end

#risk_levelString

The Risk Level

Returns:

  • (String)


65
66
67
# File 'lib/oci/cloud_guard/models/problem.rb', line 65

def risk_level
  @risk_level
end

#risk_scoreFloat

Risk Score for the problem

Returns:

  • (Float)


69
70
71
# File 'lib/oci/cloud_guard/models/problem.rb', line 69

def risk_score
  @risk_score
end

#target_idString

targetId of the problem

Returns:

  • (String)


125
126
127
# File 'lib/oci/cloud_guard/models/problem.rb', line 125

def target_id
  @target_id
end

#time_first_detectedDateTime

The date and time the problem was first detected. Format defined by RFC3339.

Returns:

  • (DateTime)


109
110
111
# File 'lib/oci/cloud_guard/models/problem.rb', line 109

def time_first_detected
  @time_first_detected
end

#time_last_detectedDateTime

The date and time the problem was last detected. Format defined by RFC3339.

Returns:

  • (DateTime)


105
106
107
# File 'lib/oci/cloud_guard/models/problem.rb', line 105

def time_last_detected
  @time_last_detected
end

Class Method Details

.attribute_mapObject

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



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
# File 'lib/oci/cloud_guard/models/problem.rb', line 156

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'compartment_id': :'compartmentId',
    'detector_rule_id': :'detectorRuleId',
    'region': :'region',
    'regions': :'regions',
    'risk_level': :'riskLevel',
    'risk_score': :'riskScore',
    'peak_risk_score_date': :'peakRiskScoreDate',
    'peak_risk_score': :'peakRiskScore',
    'auto_resolve_date': :'autoResolveDate',
    'peak_risk_score_lookup_period_in_days': :'peakRiskScoreLookupPeriodInDays',
    'resource_id': :'resourceId',
    'resource_name': :'resourceName',
    'resource_type': :'resourceType',
    'labels': :'labels',
    'time_last_detected': :'timeLastDetected',
    'time_first_detected': :'timeFirstDetected',
    'lifecycle_state': :'lifecycleState',
    'lifecycle_detail': :'lifecycleDetail',
    'detector_id': :'detectorId',
    'target_id': :'targetId',
    'additional_details': :'additionalDetails',
    'description': :'description',
    'recommendation': :'recommendation',
    'comment': :'comment',
    'impacted_resource_id': :'impactedResourceId',
    'impacted_resource_name': :'impactedResourceName',
    'impacted_resource_type': :'impactedResourceType'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
# File 'lib/oci/cloud_guard/models/problem.rb', line 192

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'compartment_id': :'String',
    'detector_rule_id': :'String',
    'region': :'String',
    'regions': :'Array<String>',
    'risk_level': :'String',
    'risk_score': :'Float',
    'peak_risk_score_date': :'String',
    'peak_risk_score': :'Float',
    'auto_resolve_date': :'String',
    'peak_risk_score_lookup_period_in_days': :'Integer',
    'resource_id': :'String',
    'resource_name': :'String',
    'resource_type': :'String',
    'labels': :'Array<String>',
    'time_last_detected': :'DateTime',
    'time_first_detected': :'DateTime',
    'lifecycle_state': :'String',
    'lifecycle_detail': :'String',
    'detector_id': :'String',
    'target_id': :'String',
    'additional_details': :'Hash<String, String>',
    'description': :'String',
    'recommendation': :'String',
    'comment': :'String',
    'impacted_resource_id': :'String',
    'impacted_resource_name': :'String',
    'impacted_resource_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



467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
# File 'lib/oci/cloud_guard/models/problem.rb', line 467

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

  self.class == other.class &&
    id == other.id &&
    compartment_id == other.compartment_id &&
    detector_rule_id == other.detector_rule_id &&
    region == other.region &&
    regions == other.regions &&
    risk_level == other.risk_level &&
    risk_score == other.risk_score &&
    peak_risk_score_date == other.peak_risk_score_date &&
    peak_risk_score == other.peak_risk_score &&
    auto_resolve_date == other.auto_resolve_date &&
    peak_risk_score_lookup_period_in_days == other.peak_risk_score_lookup_period_in_days &&
    resource_id == other.resource_id &&
    resource_name == other.resource_name &&
    resource_type == other.resource_type &&
    labels == other.labels &&
    time_last_detected == other.time_last_detected &&
    time_first_detected == other.time_first_detected &&
    lifecycle_state == other.lifecycle_state &&
    lifecycle_detail == other.lifecycle_detail &&
    detector_id == other.detector_id &&
    target_id == other.target_id &&
    additional_details == other.additional_details &&
    description == other.description &&
    recommendation == other.recommendation &&
    comment == other.comment &&
    impacted_resource_id == other.impacted_resource_id &&
    impacted_resource_name == other.impacted_resource_name &&
    impacted_resource_type == other.impacted_resource_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



524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
# File 'lib/oci/cloud_guard/models/problem.rb', line 524

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


504
505
506
# File 'lib/oci/cloud_guard/models/problem.rb', line 504

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



513
514
515
# File 'lib/oci/cloud_guard/models/problem.rb', line 513

def hash
  [id, compartment_id, detector_rule_id, region, regions, risk_level, risk_score, peak_risk_score_date, peak_risk_score, auto_resolve_date, peak_risk_score_lookup_period_in_days, resource_id, resource_name, resource_type, labels, time_last_detected, time_first_detected, lifecycle_state, lifecycle_detail, detector_id, target_id, additional_details, description, recommendation, comment, impacted_resource_id, impacted_resource_name, impacted_resource_type].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



557
558
559
560
561
562
563
564
565
566
# File 'lib/oci/cloud_guard/models/problem.rb', line 557

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



551
552
553
# File 'lib/oci/cloud_guard/models/problem.rb', line 551

def to_s
  to_hash.to_s
end