Class: OCI::DatabaseManagement::Models::SqlTuningAdvisorTaskSummary

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

Overview

The summary of a SQL Tuning Advisor task.

Constant Summary collapse

TASK_STATUS_ENUM =
[
  TASK_STATUS_COMPLETED = 'COMPLETED'.freeze,
  TASK_STATUS_INITIAL = 'INITIAL'.freeze,
  TASK_STATUS_EXECUTING = 'EXECUTING'.freeze,
  TASK_STATUS_INTERRUPTED = 'INTERRUPTED'.freeze,
  TASK_STATUS_ERROR = 'ERROR'.freeze,
  TASK_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 = {}) ⇒ SqlTuningAdvisorTaskSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :sql_tuning_advisor_task_id (Integer)

    The value to assign to the #sql_tuning_advisor_task_id property

  • :instance_id (Integer)

    The value to assign to the #instance_id property

  • :name (String)

    The value to assign to the #name property

  • :description (String)

    The value to assign to the #description property

  • :owner (String)

    The value to assign to the #owner property

  • :time_created (DateTime)

    The value to assign to the #time_created property

  • :task_status (String)

    The value to assign to the #task_status property

  • :days_to_expire (Integer)

    The value to assign to the #days_to_expire property

  • :time_execution_started (DateTime)

    The value to assign to the #time_execution_started property

  • :time_execution_ended (DateTime)

    The value to assign to the #time_execution_ended property

  • :total_sql_statements (Integer)

    The value to assign to the #total_sql_statements property

  • :recommendation_count (Integer)

    The value to assign to the #recommendation_count 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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# File 'lib/oci/database_management/models/sql_tuning_advisor_task_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.sql_tuning_advisor_task_id = attributes[:'sqlTuningAdvisorTaskId'] if attributes[:'sqlTuningAdvisorTaskId']

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

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

  self.instance_id = attributes[:'instanceId'] if attributes[:'instanceId']

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

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

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

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

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

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

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

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

  self.days_to_expire = attributes[:'daysToExpire'] if attributes[:'daysToExpire']

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

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

  self.time_execution_started = attributes[:'timeExecutionStarted'] if attributes[:'timeExecutionStarted']

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

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

  self.time_execution_ended = attributes[:'timeExecutionEnded'] if attributes[:'timeExecutionEnded']

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

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

  self.total_sql_statements = attributes[:'totalSqlStatements'] if attributes[:'totalSqlStatements']

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

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

  self.recommendation_count = attributes[:'recommendationCount'] if attributes[:'recommendationCount']

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

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

Instance Attribute Details

#days_to_expireInteger

The number of days left before the task expires. If the value equals -1, then the task has no expiration time (UNLIMITED).

Returns:

  • (Integer)


51
52
53
# File 'lib/oci/database_management/models/sql_tuning_advisor_task_summary.rb', line 51

def days_to_expire
  @days_to_expire
end

#descriptionString

The description of the SQL Tuning Advisor task.

Returns:

  • (String)


35
36
37
# File 'lib/oci/database_management/models/sql_tuning_advisor_task_summary.rb', line 35

def description
  @description
end

#instance_idInteger

The instance ID of the SQL Tuning Advisor task. This is not the OCID.

Returns:

  • (Integer)


27
28
29
# File 'lib/oci/database_management/models/sql_tuning_advisor_task_summary.rb', line 27

def instance_id
  @instance_id
end

#nameString

The name of the SQL Tuning Advisor task.

Returns:

  • (String)


31
32
33
# File 'lib/oci/database_management/models/sql_tuning_advisor_task_summary.rb', line 31

def name
  @name
end

#ownerString

The owner of the SQL Tuning Advisor task.

Returns:

  • (String)


39
40
41
# File 'lib/oci/database_management/models/sql_tuning_advisor_task_summary.rb', line 39

def owner
  @owner
end

#recommendation_countInteger

The number of recommendations provided for the SQL Tuning Advisor task.

Returns:

  • (Integer)


67
68
69
# File 'lib/oci/database_management/models/sql_tuning_advisor_task_summary.rb', line 67

def recommendation_count
  @recommendation_count
end

#sql_tuning_advisor_task_idInteger

[Required] The unique identifier of the SQL Tuning Advisor task. This is not the OCID.

Returns:

  • (Integer)


23
24
25
# File 'lib/oci/database_management/models/sql_tuning_advisor_task_summary.rb', line 23

def sql_tuning_advisor_task_id
  @sql_tuning_advisor_task_id
end

#task_statusString

The status of the SQL Tuning Advisor task.

Returns:

  • (String)


47
48
49
# File 'lib/oci/database_management/models/sql_tuning_advisor_task_summary.rb', line 47

def task_status
  @task_status
end

#time_createdDateTime

The Creation date of the SQL Tuning Advisor task.

Returns:

  • (DateTime)


43
44
45
# File 'lib/oci/database_management/models/sql_tuning_advisor_task_summary.rb', line 43

def time_created
  @time_created
end

#time_execution_endedDateTime

The end time of the task execution.

Returns:

  • (DateTime)


59
60
61
# File 'lib/oci/database_management/models/sql_tuning_advisor_task_summary.rb', line 59

def time_execution_ended
  @time_execution_ended
end

#time_execution_startedDateTime

The start time of the task execution.

Returns:

  • (DateTime)


55
56
57
# File 'lib/oci/database_management/models/sql_tuning_advisor_task_summary.rb', line 55

def time_execution_started
  @time_execution_started
end

#total_sql_statementsInteger

The total number of SQL statements related to the SQL Tuning Advisor task.

Returns:

  • (Integer)


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

def total_sql_statements
  @total_sql_statements
end

Class Method Details

.attribute_mapObject

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



70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/oci/database_management/models/sql_tuning_advisor_task_summary.rb', line 70

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'sql_tuning_advisor_task_id': :'sqlTuningAdvisorTaskId',
    'instance_id': :'instanceId',
    'name': :'name',
    'description': :'description',
    'owner': :'owner',
    'time_created': :'timeCreated',
    'task_status': :'taskStatus',
    'days_to_expire': :'daysToExpire',
    'time_execution_started': :'timeExecutionStarted',
    'time_execution_ended': :'timeExecutionEnded',
    'total_sql_statements': :'totalSqlStatements',
    'recommendation_count': :'recommendationCount'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/oci/database_management/models/sql_tuning_advisor_task_summary.rb', line 90

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'sql_tuning_advisor_task_id': :'Integer',
    'instance_id': :'Integer',
    'name': :'String',
    'description': :'String',
    'owner': :'String',
    'time_created': :'DateTime',
    'task_status': :'String',
    'days_to_expire': :'Integer',
    'time_execution_started': :'DateTime',
    'time_execution_ended': :'DateTime',
    'total_sql_statements': :'Integer',
    'recommendation_count': :'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



214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
# File 'lib/oci/database_management/models/sql_tuning_advisor_task_summary.rb', line 214

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

  self.class == other.class &&
    sql_tuning_advisor_task_id == other.sql_tuning_advisor_task_id &&
    instance_id == other.instance_id &&
    name == other.name &&
    description == other.description &&
    owner == other.owner &&
    time_created == other.time_created &&
    task_status == other.task_status &&
    days_to_expire == other.days_to_expire &&
    time_execution_started == other.time_execution_started &&
    time_execution_ended == other.time_execution_ended &&
    total_sql_statements == other.total_sql_statements &&
    recommendation_count == other.recommendation_count
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



255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
# File 'lib/oci/database_management/models/sql_tuning_advisor_task_summary.rb', line 255

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


235
236
237
# File 'lib/oci/database_management/models/sql_tuning_advisor_task_summary.rb', line 235

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



244
245
246
# File 'lib/oci/database_management/models/sql_tuning_advisor_task_summary.rb', line 244

def hash
  [sql_tuning_advisor_task_id, instance_id, name, description, owner, time_created, task_status, days_to_expire, time_execution_started, time_execution_ended, total_sql_statements, recommendation_count].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



288
289
290
291
292
293
294
295
296
297
# File 'lib/oci/database_management/models/sql_tuning_advisor_task_summary.rb', line 288

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



282
283
284
# File 'lib/oci/database_management/models/sql_tuning_advisor_task_summary.rb', line 282

def to_s
  to_hash.to_s
end