Class: OCI::CloudGuard::Models::ProblemSummary

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

Overview

Summary information for a problem.

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_IAAS_INSTANCE_SECURITY_DETECTOR = 'IAAS_INSTANCE_SECURITY_DETECTOR'.freeze,
  DETECTOR_ID_IAAS_CONTAINER_SECURITY_DETECTOR = 'IAAS_CONTAINER_SECURITY_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 = {}) ⇒ ProblemSummary

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

  • :risk_level (String)

    The value to assign to the #risk_level property

  • :risk_score (Float)

    The value to assign to the #risk_score 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_first_detected (DateTime)

    The value to assign to the #time_first_detected property

  • :time_last_detected (DateTime)

    The value to assign to the #time_last_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

  • :region (String)

    The value to assign to the #region property

  • :regions (Array<String>)

    The value to assign to the #regions property

  • :target_id (String)

    The value to assign to the #target_id property

  • :locks (Array<OCI::CloudGuard::Models::ResourceLock>)

    The value to assign to the #locks property



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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
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
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 193

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

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

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

Instance Attribute Details

#compartment_idString

[Required] Compartment OCID where the resource is created

Returns:

  • (String)


51
52
53
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 51

def compartment_id
  @compartment_id
end

#detector_idString

Unique identifier of the detector associated with the problem

Returns:

  • (String)


99
100
101
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 99

def detector_id
  @detector_id
end

#detector_rule_idString

Unique identifier of the detector rule

Returns:

  • (String)


55
56
57
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 55

def detector_rule_id
  @detector_rule_id
end

#idString

[Required] Unique identifier that can't be changed after creation

Returns:

  • (String)


47
48
49
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 47

def id
  @id
end

#labelsArray<String>

User-defined labels on the problem

Returns:

  • (Array<String>)


79
80
81
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 79

def labels
  @labels
end

#lifecycle_detailString

Additional details on the substate of the lifecycle state

Returns:

  • (String)


95
96
97
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 95

def lifecycle_detail
  @lifecycle_detail
end

#lifecycle_stateString

The current lifecycle state of the problem

Returns:

  • (String)


91
92
93
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 91

def lifecycle_state
  @lifecycle_state
end

#locksArray<OCI::CloudGuard::Models::ResourceLock>

Locks associated with this resource.



115
116
117
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 115

def locks
  @locks
end

#regionString

DEPRECATED

Returns:

  • (String)


103
104
105
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 103

def region
  @region
end

#regionsArray<String>

List of regions where the problem is found

Returns:

  • (Array<String>)


107
108
109
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 107

def regions
  @regions
end

#resource_idString

Unique identifier of the resource that's impacted by the problem

Returns:

  • (String)


67
68
69
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 67

def resource_id
  @resource_id
end

#resource_nameString

Display name of the resource impacted by the problem

Returns:

  • (String)


71
72
73
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 71

def resource_name
  @resource_name
end

#resource_typeString

Type of the resource impacted by the problem

Returns:

  • (String)


75
76
77
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 75

def resource_type
  @resource_type
end

#risk_levelString

The risk level of the problem

Returns:

  • (String)


59
60
61
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 59

def risk_level
  @risk_level
end

#risk_scoreFloat

The risk score for the problem

Returns:

  • (Float)


63
64
65
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 63

def risk_score
  @risk_score
end

#target_idString

Unique target identifier associated with the problem

Returns:

  • (String)


111
112
113
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 111

def target_id
  @target_id
end

#time_first_detectedDateTime

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

Returns:

  • (DateTime)


83
84
85
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 83

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)


87
88
89
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 87

def time_last_detected
  @time_last_detected
end

Class Method Details

.attribute_mapObject

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



118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 118

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'compartment_id': :'compartmentId',
    'detector_rule_id': :'detectorRuleId',
    'risk_level': :'riskLevel',
    'risk_score': :'riskScore',
    'resource_id': :'resourceId',
    'resource_name': :'resourceName',
    'resource_type': :'resourceType',
    'labels': :'labels',
    'time_first_detected': :'timeFirstDetected',
    'time_last_detected': :'timeLastDetected',
    'lifecycle_state': :'lifecycleState',
    'lifecycle_detail': :'lifecycleDetail',
    'detector_id': :'detectorId',
    'region': :'region',
    'regions': :'regions',
    'target_id': :'targetId',
    'locks': :'locks'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 144

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'compartment_id': :'String',
    'detector_rule_id': :'String',
    'risk_level': :'String',
    'risk_score': :'Float',
    'resource_id': :'String',
    'resource_name': :'String',
    'resource_type': :'String',
    'labels': :'Array<String>',
    'time_first_detected': :'DateTime',
    'time_last_detected': :'DateTime',
    'lifecycle_state': :'String',
    'lifecycle_detail': :'String',
    'detector_id': :'String',
    'region': :'String',
    'regions': :'Array<String>',
    'target_id': :'String',
    'locks': :'Array<OCI::CloudGuard::Models::ResourceLock>'
    # 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



347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 347

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 &&
    risk_level == other.risk_level &&
    risk_score == other.risk_score &&
    resource_id == other.resource_id &&
    resource_name == other.resource_name &&
    resource_type == other.resource_type &&
    labels == other.labels &&
    time_first_detected == other.time_first_detected &&
    time_last_detected == other.time_last_detected &&
    lifecycle_state == other.lifecycle_state &&
    lifecycle_detail == other.lifecycle_detail &&
    detector_id == other.detector_id &&
    region == other.region &&
    regions == other.regions &&
    target_id == other.target_id &&
    locks == other.locks
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



394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 394

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


374
375
376
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 374

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



383
384
385
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 383

def hash
  [id, compartment_id, detector_rule_id, risk_level, risk_score, resource_id, resource_name, resource_type, labels, time_first_detected, time_last_detected, lifecycle_state, lifecycle_detail, detector_id, region, regions, target_id, locks].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



427
428
429
430
431
432
433
434
435
436
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 427

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



421
422
423
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 421

def to_s
  to_hash.to_s
end