Class: OCI::CloudGuard::Models::ProblemSummary
- Inherits:
-
Object
- Object
- OCI::CloudGuard::Models::ProblemSummary
- Defined in:
- lib/oci/cloud_guard/models/problem_summary.rb
Overview
Summary of the 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_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_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
Instance Attribute Summary collapse
-
#compartment_id ⇒ String
[Required] Compartment Identifier where the resource is created.
-
#detector_id ⇒ String
Id of detector associated with the Problem.
-
#detector_rule_id ⇒ String
Identifier of the rule.
-
#id ⇒ String
[Required] Unique identifier that is immutable on creation.
-
#labels ⇒ Array<String>
user defined labels on the problem.
-
#lifecycle_detail ⇒ String
The lifecycleDetail will give more detail on the substate of the lifecycleState.
-
#lifecycle_state ⇒ String
The current state of the Problem.
-
#region ⇒ String
DEPRECATED.
-
#regions ⇒ Array<String>
Regions where the problem is found.
-
#resource_id ⇒ String
Identifier of the Resource.
-
#resource_name ⇒ String
DisplayName of the Resource.
-
#resource_type ⇒ String
Type of the Resource.
-
#risk_level ⇒ String
The Risk Level.
-
#target_id ⇒ String
targetId associated with the problem.
-
#time_first_detected ⇒ DateTime
The date and time the problem was first detected.
-
#time_last_detected ⇒ DateTime
The date and time the problem was last detected.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ ProblemSummary
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ ProblemSummary
Initializes the object
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 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 |
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 173 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.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'] end |
Instance Attribute Details
#compartment_id ⇒ String
[Required] Compartment Identifier where the resource is created
45 46 47 |
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 45 def compartment_id @compartment_id end |
#detector_id ⇒ String
Id of detector associated with the Problem.
89 90 91 |
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 89 def detector_id @detector_id end |
#detector_rule_id ⇒ String
Identifier of the rule
49 50 51 |
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 49 def detector_rule_id @detector_rule_id end |
#id ⇒ String
[Required] Unique identifier that is immutable on creation
41 42 43 |
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 41 def id @id end |
#labels ⇒ Array<String>
user defined labels on the problem
69 70 71 |
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 69 def labels @labels end |
#lifecycle_detail ⇒ String
The lifecycleDetail will give more detail on the substate of the lifecycleState.
85 86 87 |
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 85 def lifecycle_detail @lifecycle_detail end |
#lifecycle_state ⇒ String
The current state of the Problem.
81 82 83 |
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 81 def lifecycle_state @lifecycle_state end |
#region ⇒ String
DEPRECATED
93 94 95 |
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 93 def region @region end |
#regions ⇒ Array<String>
Regions where the problem is found
97 98 99 |
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 97 def regions @regions end |
#resource_id ⇒ String
Identifier of the Resource
57 58 59 |
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 57 def resource_id @resource_id end |
#resource_name ⇒ String
DisplayName of the Resource
61 62 63 |
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 61 def resource_name @resource_name end |
#resource_type ⇒ String
Type of the Resource
65 66 67 |
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 65 def resource_type @resource_type end |
#risk_level ⇒ String
The Risk Level
53 54 55 |
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 53 def risk_level @risk_level end |
#target_id ⇒ String
targetId associated with the problem.
101 102 103 |
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 101 def target_id @target_id end |
#time_first_detected ⇒ DateTime
The date and time the problem was first detected. Format defined by RFC3339.
73 74 75 |
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 73 def time_first_detected @time_first_detected end |
#time_last_detected ⇒ DateTime
The date and time the problem was last detected. Format defined by RFC3339.
77 78 79 |
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 77 def time_last_detected @time_last_detected end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 104 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'id': :'id', 'compartment_id': :'compartmentId', 'detector_rule_id': :'detectorRuleId', 'risk_level': :'riskLevel', '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' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 128 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'id': :'String', 'compartment_id': :'String', 'detector_rule_id': :'String', 'risk_level': :'String', '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' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 |
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 319 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 && 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 end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 |
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 364 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
344 345 346 |
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 344 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
353 354 355 |
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 353 def hash [id, compartment_id, detector_rule_id, risk_level, resource_id, resource_name, resource_type, labels, time_first_detected, time_last_detected, lifecycle_state, lifecycle_detail, detector_id, region, regions, target_id].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
397 398 399 400 401 402 403 404 405 406 |
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 397 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_s ⇒ String
Returns the string representation of the object
391 392 393 |
# File 'lib/oci/cloud_guard/models/problem_summary.rb', line 391 def to_s to_hash.to_s end |