Class: OCI::CloudGuard::Models::ResponderExecution

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

Overview

Responder Execution Object.

Constant Summary collapse

RESPONDER_RULE_TYPE_ENUM =
[
  RESPONDER_RULE_TYPE_REMEDIATION = 'REMEDIATION'.freeze,
  RESPONDER_RULE_TYPE_NOTIFICATION = 'NOTIFICATION'.freeze,
  RESPONDER_RULE_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
RESPONDER_EXECUTION_STATUS_ENUM =
[
  RESPONDER_EXECUTION_STATUS_STARTED = 'STARTED'.freeze,
  RESPONDER_EXECUTION_STATUS_AWAITING_CONFIRMATION = 'AWAITING_CONFIRMATION'.freeze,
  RESPONDER_EXECUTION_STATUS_AWAITING_INPUT = 'AWAITING_INPUT'.freeze,
  RESPONDER_EXECUTION_STATUS_SUCCEEDED = 'SUCCEEDED'.freeze,
  RESPONDER_EXECUTION_STATUS_FAILED = 'FAILED'.freeze,
  RESPONDER_EXECUTION_STATUS_SKIPPED = 'SKIPPED'.freeze,
  RESPONDER_EXECUTION_STATUS_ALL = 'ALL'.freeze,
  RESPONDER_EXECUTION_STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
RESPONDER_EXECUTION_MODE_ENUM =
[
  RESPONDER_EXECUTION_MODE_MANUAL = 'MANUAL'.freeze,
  RESPONDER_EXECUTION_MODE_AUTOMATED = 'AUTOMATED'.freeze,
  RESPONDER_EXECUTION_MODE_ALL = 'ALL'.freeze,
  RESPONDER_EXECUTION_MODE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ResponderExecution

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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

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

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

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

  self.responder_rule_type = attributes[:'responderRuleType'] if attributes[:'responderRuleType']

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

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

  self.responder_rule_name = attributes[:'responderRuleName'] if attributes[:'responderRuleName']

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

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

  self.problem_id = attributes[:'problemId'] if attributes[:'problemId']

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

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

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

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

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

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

  self.time_completed = attributes[:'timeCompleted'] if attributes[:'timeCompleted']

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

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

  self.responder_execution_status = attributes[:'responderExecutionStatus'] if attributes[:'responderExecutionStatus']

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

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

  self.responder_execution_mode = attributes[:'responderExecutionMode'] if attributes[:'responderExecutionMode']

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

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

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

  self.responder_rule_execution_details = attributes[:'responderRuleExecutionDetails'] if attributes[:'responderRuleExecutionDetails']

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

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

Instance Attribute Details

#compartment_idString

**[Required]** compartment id of the responder execution for the problem

Returns:

  • (String)


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

def compartment_id
  @compartment_id
end

#idString

**[Required]** The unique identifier of the responder execution

Returns:

  • (String)


37
38
39
# File 'lib/oci/cloud_guard/models/responder_execution.rb', line 37

def id
  @id
end

#messageString

Message about the responder execution.

Returns:

  • (String)


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

def message
  @message
end

#problem_idString

**[Required]** Problem id associated with the responder execution

Returns:

  • (String)


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

def problem_id
  @problem_id
end

#regionString

**[Required]** region where the problem is found

Returns:

  • (String)


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

def region
  @region
end

#resource_nameString

**[Required]** resource name of the problem for the responder execution. TODO-DOC link to resource definition doc

Returns:

  • (String)


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

def resource_name
  @resource_name
end

#resource_typeString

**[Required]** resource type of the problem for the responder execution

Returns:

  • (String)


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

def resource_type
  @resource_type
end

#responder_execution_modeString

**[Required]** execution mode of the responder

Returns:

  • (String)


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

def responder_execution_mode
  @responder_execution_mode
end

#responder_execution_statusString

**[Required]** current execution status of the responder

Returns:

  • (String)


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

def responder_execution_status
  @responder_execution_status
end

#responder_rule_execution_detailsOCI::CloudGuard::Models::ResponderRuleExecutionDetails



96
97
98
# File 'lib/oci/cloud_guard/models/responder_execution.rb', line 96

def responder_rule_execution_details
  @responder_rule_execution_details
end

#responder_rule_idString

**[Required]** Responder Rule id for the responder execution

Returns:

  • (String)


41
42
43
# File 'lib/oci/cloud_guard/models/responder_execution.rb', line 41

def responder_rule_id
  @responder_rule_id
end

#responder_rule_nameString

**[Required]** Rule name for the responder execution

Returns:

  • (String)


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

def responder_rule_name
  @responder_rule_name
end

#responder_rule_typeString

**[Required]** Rule Type for the responder execution

Returns:

  • (String)


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

def responder_rule_type
  @responder_rule_type
end

#target_idString

**[Required]** targetId of the problem for the responder execution

Returns:

  • (String)


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

def target_id
  @target_id
end

#time_completedDateTime

The date and time the responder execution was updated. Format defined by RFC3339.

Returns:

  • (DateTime)


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

def time_completed
  @time_completed
end

#time_createdDateTime

**[Required]** The date and time the responder execution was created. Format defined by RFC3339.

Returns:

  • (DateTime)


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

def time_created
  @time_created
end

Class Method Details

.attribute_mapObject

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



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'lib/oci/cloud_guard/models/responder_execution.rb', line 99

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'responder_rule_id': :'responderRuleId',
    'responder_rule_type': :'responderRuleType',
    'responder_rule_name': :'responderRuleName',
    'problem_id': :'problemId',
    'region': :'region',
    'target_id': :'targetId',
    'compartment_id': :'compartmentId',
    'resource_type': :'resourceType',
    'resource_name': :'resourceName',
    'time_created': :'timeCreated',
    'time_completed': :'timeCompleted',
    'responder_execution_status': :'responderExecutionStatus',
    'responder_execution_mode': :'responderExecutionMode',
    'message': :'message',
    'responder_rule_execution_details': :'responderRuleExecutionDetails'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# File 'lib/oci/cloud_guard/models/responder_execution.rb', line 123

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'responder_rule_id': :'String',
    'responder_rule_type': :'String',
    'responder_rule_name': :'String',
    'problem_id': :'String',
    'region': :'String',
    'target_id': :'String',
    'compartment_id': :'String',
    'resource_type': :'String',
    'resource_name': :'String',
    'time_created': :'DateTime',
    'time_completed': :'DateTime',
    'responder_execution_status': :'String',
    'responder_execution_mode': :'String',
    'message': :'String',
    'responder_rule_execution_details': :'OCI::CloudGuard::Models::ResponderRuleExecutionDetails'
    # 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



305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
# File 'lib/oci/cloud_guard/models/responder_execution.rb', line 305

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

  self.class == other.class &&
    id == other.id &&
    responder_rule_id == other.responder_rule_id &&
    responder_rule_type == other.responder_rule_type &&
    responder_rule_name == other.responder_rule_name &&
    problem_id == other.problem_id &&
    region == other.region &&
    target_id == other.target_id &&
    compartment_id == other.compartment_id &&
    resource_type == other.resource_type &&
    resource_name == other.resource_name &&
    time_created == other.time_created &&
    time_completed == other.time_completed &&
    responder_execution_status == other.responder_execution_status &&
    responder_execution_mode == other.responder_execution_mode &&
    message == other.message &&
    responder_rule_execution_details == other.responder_rule_execution_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



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

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


330
331
332
# File 'lib/oci/cloud_guard/models/responder_execution.rb', line 330

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



339
340
341
# File 'lib/oci/cloud_guard/models/responder_execution.rb', line 339

def hash
  [id, responder_rule_id, responder_rule_type, responder_rule_name, problem_id, region, target_id, compartment_id, resource_type, resource_name, time_created, time_completed, responder_execution_status, responder_execution_mode, message, responder_rule_execution_details].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



383
384
385
386
387
388
389
390
391
392
# File 'lib/oci/cloud_guard/models/responder_execution.rb', line 383

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



377
378
379
# File 'lib/oci/cloud_guard/models/responder_execution.rb', line 377

def to_s
  to_hash.to_s
end