Class: OCI::CloudGuard::Models::ProblemHistorySummary

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

Overview

Problem History Definition.

Constant Summary collapse

ACTOR_TYPE_ENUM =
[
  ACTOR_TYPE_CLOUD_GUARD_SERVICE = 'CLOUD_GUARD_SERVICE'.freeze,
  ACTOR_TYPE_CORRELATION = 'CORRELATION'.freeze,
  ACTOR_TYPE_RESPONDER = 'RESPONDER'.freeze,
  ACTOR_TYPE_USER = 'USER'.freeze,
  ACTOR_TYPE_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
EVENT_STATUS_ENUM =
[
  EVENT_STATUS_REOPEN = 'REOPEN'.freeze,
  EVENT_STATUS_OPEN = 'OPEN'.freeze,
  EVENT_STATUS_UPDATE = 'UPDATE'.freeze,
  EVENT_STATUS_RESOLVE = 'RESOLVE'.freeze,
  EVENT_STATUS_DISMISS = 'DISMISS'.freeze,
  EVENT_STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ProblemHistorySummary

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

  • :problem_id (String)

    The value to assign to the #problem_id property

  • :actor_type (String)

    The value to assign to the #actor_type property

  • :actor_name (String)

    The value to assign to the #actor_name property

  • :explanation (String)

    The value to assign to the #explanation property

  • :lifecycle_detail (String)

    The value to assign to the #lifecycle_detail property

  • :event_status (String)

    The value to assign to the #event_status property

  • :time_created (DateTime)

    The value to assign to the #time_created property

  • :delta (String)

    The value to assign to the #delta property

  • :comment (String)

    The value to assign to the #comment property



127
128
129
130
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
# File 'lib/oci/cloud_guard/models/problem_history_summary.rb', line 127

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

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

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

  self.actor_name = attributes[:'actorName'] if attributes[:'actorName']

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

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

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

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

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

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

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

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

Instance Attribute Details

#actor_nameString

[Required] Resource Name who performed activity

Returns:

  • (String)


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

def actor_name
  @actor_name
end

#actor_typeString

[Required] Actor type who performed the operation

Returns:

  • (String)


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

def actor_type
  @actor_type
end

#commentString

User Defined Comments

Returns:

  • (String)


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

def comment
  @comment
end

#deltaString

[Required] Impacted Resource Names in a comma-separated string.

Returns:

  • (String)


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

def delta
  @delta
end

#event_statusString

Event status

Returns:

  • (String)


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

def event_status
  @event_status
end

#explanationString

[Required] Activity explanation details

Returns:

  • (String)


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

def explanation
  @explanation
end

#idString

[Required] Unique identifier for the history record

Returns:

  • (String)


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

def id
  @id
end

#lifecycle_detailString

[Required] Problem Lifecycle Detail Status

Returns:

  • (String)


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

def lifecycle_detail
  @lifecycle_detail
end

#problem_idString

[Required] problemId for which history is associated to.

Returns:

  • (String)


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

def problem_id
  @problem_id
end

#time_createdDateTime

[Required] Type of the Entity

Returns:

  • (DateTime)


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

def time_created
  @time_created
end

Class Method Details

.attribute_mapObject

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



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/oci/cloud_guard/models/problem_history_summary.rb', line 76

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'problem_id': :'problemId',
    'actor_type': :'actorType',
    'actor_name': :'actorName',
    'explanation': :'explanation',
    'lifecycle_detail': :'lifecycleDetail',
    'event_status': :'eventStatus',
    'time_created': :'timeCreated',
    'delta': :'delta',
    'comment': :'comment'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/oci/cloud_guard/models/problem_history_summary.rb', line 94

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'problem_id': :'String',
    'actor_type': :'String',
    'actor_name': :'String',
    'explanation': :'String',
    'lifecycle_detail': :'String',
    'event_status': :'String',
    'time_created': :'DateTime',
    'delta': :'String',
    'comment': :'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



224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
# File 'lib/oci/cloud_guard/models/problem_history_summary.rb', line 224

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

  self.class == other.class &&
    id == other.id &&
    problem_id == other.problem_id &&
    actor_type == other.actor_type &&
    actor_name == other.actor_name &&
    explanation == other.explanation &&
    lifecycle_detail == other.lifecycle_detail &&
    event_status == other.event_status &&
    time_created == other.time_created &&
    delta == other.delta &&
    comment == other.comment
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



263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
# File 'lib/oci/cloud_guard/models/problem_history_summary.rb', line 263

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


243
244
245
# File 'lib/oci/cloud_guard/models/problem_history_summary.rb', line 243

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



252
253
254
# File 'lib/oci/cloud_guard/models/problem_history_summary.rb', line 252

def hash
  [id, problem_id, actor_type, actor_name, explanation, lifecycle_detail, event_status, time_created, delta, comment].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



296
297
298
299
300
301
302
303
304
305
# File 'lib/oci/cloud_guard/models/problem_history_summary.rb', line 296

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



290
291
292
# File 'lib/oci/cloud_guard/models/problem_history_summary.rb', line 290

def to_s
  to_hash.to_s
end