Class: OCI::DatabaseManagement::Models::AddmTaskSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/database_management/models/addm_task_summary.rb

Overview

The object containing the ADDM task metadata.

Constant Summary collapse

STATUS_ENUM =
[
  STATUS_INITIAL = 'INITIAL'.freeze,
  STATUS_EXECUTING = 'EXECUTING'.freeze,
  STATUS_INTERRUPTED = 'INTERRUPTED'.freeze,
  STATUS_COMPLETED = 'COMPLETED'.freeze,
  STATUS_ERROR = 'ERROR'.freeze,
  STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
HOW_CREATED_ENUM =
[
  HOW_CREATED_AUTO = 'AUTO'.freeze,
  HOW_CREATED_MANUAL = 'MANUAL'.freeze,
  HOW_CREATED_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ AddmTaskSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :task_name (String)

    The value to assign to the #task_name property

  • :task_id (Integer)

    The value to assign to the #task_id property

  • :description (String)

    The value to assign to the #description property

  • :db_user (String)

    The value to assign to the #db_user property

  • :status (String)

    The value to assign to the #status property

  • :time_created (DateTime)

    The value to assign to the #time_created property

  • :how_created (String)

    The value to assign to the #how_created property

  • :start_snapshot_time (DateTime)

    The value to assign to the #start_snapshot_time property

  • :end_snapshot_time (DateTime)

    The value to assign to the #end_snapshot_time property

  • :begin_snapshot_id (Integer)

    The value to assign to the #begin_snapshot_id property

  • :end_snapshot_id (Integer)

    The value to assign to the #end_snapshot_id property

  • :findings (Integer)

    The value to assign to the #findings property



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
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
# File 'lib/oci/database_management/models/addm_task_summary.rb', line 137

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

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

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

  self.task_id = attributes[:'taskId'] if attributes[:'taskId']

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

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

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

  self.db_user = attributes[:'dbUser'] if attributes[:'dbUser']

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

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

  self.status = attributes[:'status'] if attributes[:'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.how_created = attributes[:'howCreated'] if attributes[:'howCreated']

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

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

  self.start_snapshot_time = attributes[:'startSnapshotTime'] if attributes[:'startSnapshotTime']

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

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

  self.end_snapshot_time = attributes[:'endSnapshotTime'] if attributes[:'endSnapshotTime']

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

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

  self.begin_snapshot_id = attributes[:'beginSnapshotId'] if attributes[:'beginSnapshotId']

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

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

  self.end_snapshot_id = attributes[:'endSnapshotId'] if attributes[:'endSnapshotId']

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

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

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

Instance Attribute Details

#begin_snapshot_idInteger

The ID number of the beginning AWR snapshot.

Returns:

  • (Integer)


68
69
70
# File 'lib/oci/database_management/models/addm_task_summary.rb', line 68

def begin_snapshot_id
  @begin_snapshot_id
end

#db_userString

The database user who owns the ADDM task.

Returns:

  • (String)


41
42
43
# File 'lib/oci/database_management/models/addm_task_summary.rb', line 41

def db_user
  @db_user
end

#descriptionString

The description of the ADDM task.

Returns:

  • (String)


37
38
39
# File 'lib/oci/database_management/models/addm_task_summary.rb', line 37

def description
  @description
end

#end_snapshot_idInteger

The ID number of the ending AWR snapshot.

Returns:

  • (Integer)


73
74
75
# File 'lib/oci/database_management/models/addm_task_summary.rb', line 73

def end_snapshot_id
  @end_snapshot_id
end

#end_snapshot_timeDateTime

The timestamp of the ending AWR snapshot used in the ADDM task as defined by date-time RFC3339 format.

Returns:

  • (DateTime)


63
64
65
# File 'lib/oci/database_management/models/addm_task_summary.rb', line 63

def end_snapshot_time
  @end_snapshot_time
end

#findingsInteger

The number of ADDM findings.

Returns:

  • (Integer)


77
78
79
# File 'lib/oci/database_management/models/addm_task_summary.rb', line 77

def findings
  @findings
end

#how_createdString

A description of how the task was created.

Returns:

  • (String)


53
54
55
# File 'lib/oci/database_management/models/addm_task_summary.rb', line 53

def how_created
  @how_created
end

#start_snapshot_timeDateTime

The timestamp of the beginning AWR snapshot used in the ADDM task as defined by date-time RFC3339 format.

Returns:

  • (DateTime)


58
59
60
# File 'lib/oci/database_management/models/addm_task_summary.rb', line 58

def start_snapshot_time
  @start_snapshot_time
end

#statusString

The status of the ADDM task.

Returns:

  • (String)


45
46
47
# File 'lib/oci/database_management/models/addm_task_summary.rb', line 45

def status
  @status
end

#task_idInteger

[Required] The ID number of the ADDM task.

Returns:

  • (Integer)


33
34
35
# File 'lib/oci/database_management/models/addm_task_summary.rb', line 33

def task_id
  @task_id
end

#task_nameString

The name of the ADDM task.

Returns:

  • (String)


29
30
31
# File 'lib/oci/database_management/models/addm_task_summary.rb', line 29

def task_name
  @task_name
end

#time_createdDateTime

[Required] The creation date of the ADDM task.

Returns:

  • (DateTime)


49
50
51
# File 'lib/oci/database_management/models/addm_task_summary.rb', line 49

def time_created
  @time_created
end

Class Method Details

.attribute_mapObject

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



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/oci/database_management/models/addm_task_summary.rb', line 80

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'task_name': :'taskName',
    'task_id': :'taskId',
    'description': :'description',
    'db_user': :'dbUser',
    'status': :'status',
    'time_created': :'timeCreated',
    'how_created': :'howCreated',
    'start_snapshot_time': :'startSnapshotTime',
    'end_snapshot_time': :'endSnapshotTime',
    'begin_snapshot_id': :'beginSnapshotId',
    'end_snapshot_id': :'endSnapshotId',
    'findings': :'findings'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/oci/database_management/models/addm_task_summary.rb', line 100

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'task_name': :'String',
    'task_id': :'Integer',
    'description': :'String',
    'db_user': :'String',
    'status': :'String',
    'time_created': :'DateTime',
    'how_created': :'String',
    'start_snapshot_time': :'DateTime',
    'end_snapshot_time': :'DateTime',
    'begin_snapshot_id': :'Integer',
    'end_snapshot_id': :'Integer',
    'findings': :'Integer'
    # 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



237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
# File 'lib/oci/database_management/models/addm_task_summary.rb', line 237

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

  self.class == other.class &&
    task_name == other.task_name &&
    task_id == other.task_id &&
    description == other.description &&
    db_user == other.db_user &&
    status == other.status &&
    time_created == other.time_created &&
    how_created == other.how_created &&
    start_snapshot_time == other.start_snapshot_time &&
    end_snapshot_time == other.end_snapshot_time &&
    begin_snapshot_id == other.begin_snapshot_id &&
    end_snapshot_id == other.end_snapshot_id &&
    findings == other.findings
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



278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
# File 'lib/oci/database_management/models/addm_task_summary.rb', line 278

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


258
259
260
# File 'lib/oci/database_management/models/addm_task_summary.rb', line 258

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



267
268
269
# File 'lib/oci/database_management/models/addm_task_summary.rb', line 267

def hash
  [task_name, task_id, description, db_user, status, time_created, how_created, start_snapshot_time, end_snapshot_time, begin_snapshot_id, end_snapshot_id, findings].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



311
312
313
314
315
316
317
318
319
320
# File 'lib/oci/database_management/models/addm_task_summary.rb', line 311

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



305
306
307
# File 'lib/oci/database_management/models/addm_task_summary.rb', line 305

def to_s
  to_hash.to_s
end