Class: OCI::DatabaseManagement::Models::StartSqlTuningTaskDetails

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

Overview

The request to start a SQL tuning task.

Constant Summary collapse

SCOPE_ENUM =
[
  SCOPE_LIMITED = 'LIMITED'.freeze,
  SCOPE_COMPREHENSIVE = 'COMPREHENSIVE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ StartSqlTuningTaskDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



116
117
118
119
120
121
122
123
124
125
126
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
# File 'lib/oci/database_management/models/start_sql_tuning_task_details.rb', line 116

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_description = attributes[:'taskDescription'] if attributes[:'taskDescription']

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

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

  self.credential_details = attributes[:'credentialDetails'] if attributes[:'credentialDetails']

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

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

  self.total_time_limit_in_minutes = attributes[:'totalTimeLimitInMinutes'] if attributes[:'totalTimeLimitInMinutes']

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

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

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

  self.statement_time_limit_in_minutes = attributes[:'statementTimeLimitInMinutes'] if attributes[:'statementTimeLimitInMinutes']

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

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

  self.sql_tuning_set = attributes[:'sqlTuningSet'] if attributes[:'sqlTuningSet']

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

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

  self.sql_details = attributes[:'sqlDetails'] if attributes[:'sqlDetails']

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

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

  self.time_started = attributes[:'timeStarted'] if attributes[:'timeStarted']

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

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

  self.time_ended = attributes[:'timeEnded'] if attributes[:'timeEnded']

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

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

Instance Attribute Details

#credential_detailsOCI::DatabaseManagement::Models::SqlTuningTaskCredentialDetails

This attribute is required.



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

def credential_details
  @credential_details
end

#scopeString

[Required] The scope for the SQL tuning task. For LIMITED scope, the SQL profile recommendation is excluded, so the task is executed faster. For COMPREHENSIVE scope, the SQL profile recommendation is included.

Returns:

  • (String)


38
39
40
# File 'lib/oci/database_management/models/start_sql_tuning_task_details.rb', line 38

def scope
  @scope
end

#sql_detailsArray<OCI::DatabaseManagement::Models::SqlTuningTaskSqlDetail>

The details of the SQL statement on which tuning is performed. To obtain the details of the SQL statement, you must provide either the sqlTuningSet or the tuple of sqlDetails/timeStarted/timeEnded.



54
55
56
# File 'lib/oci/database_management/models/start_sql_tuning_task_details.rb', line 54

def sql_details
  @sql_details
end

#sql_tuning_setOCI::DatabaseManagement::Models::SqlTuningSetInput



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

def sql_tuning_set
  @sql_tuning_set
end

#statement_time_limit_in_minutesInteger

The time limit per SQL statement (in minutes). This is for a task with the COMPREHENSIVE scope. The time limit per SQL statement should not be more than the total time limit.

Returns:

  • (Integer)


44
45
46
# File 'lib/oci/database_management/models/start_sql_tuning_task_details.rb', line 44

def statement_time_limit_in_minutes
  @statement_time_limit_in_minutes
end

#task_descriptionString

The description of the SQL tuning task.

Returns:

  • (String)


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

def task_description
  @task_description
end

#task_nameString

[Required] The name of the SQL tuning task. The name is unique per user in a database, and it is case-sensitive.

Returns:

  • (String)


19
20
21
# File 'lib/oci/database_management/models/start_sql_tuning_task_details.rb', line 19

def task_name
  @task_name
end

#time_endedDateTime

The end time of the period in which SQL statements are running.

Returns:

  • (DateTime)


62
63
64
# File 'lib/oci/database_management/models/start_sql_tuning_task_details.rb', line 62

def time_ended
  @time_ended
end

#time_startedDateTime

The start time of the period in which SQL statements are running.

Returns:

  • (DateTime)


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

def time_started
  @time_started
end

#total_time_limit_in_minutesInteger

[Required] The time limit for running the SQL tuning task.

Returns:

  • (Integer)


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

def total_time_limit_in_minutes
  @total_time_limit_in_minutes
end

Class Method Details

.attribute_mapObject

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



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/oci/database_management/models/start_sql_tuning_task_details.rb', line 65

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'task_name': :'taskName',
    'task_description': :'taskDescription',
    'credential_details': :'credentialDetails',
    'total_time_limit_in_minutes': :'totalTimeLimitInMinutes',
    'scope': :'scope',
    'statement_time_limit_in_minutes': :'statementTimeLimitInMinutes',
    'sql_tuning_set': :'sqlTuningSet',
    'sql_details': :'sqlDetails',
    'time_started': :'timeStarted',
    'time_ended': :'timeEnded'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



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

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'task_name': :'String',
    'task_description': :'String',
    'credential_details': :'OCI::DatabaseManagement::Models::SqlTuningTaskCredentialDetails',
    'total_time_limit_in_minutes': :'Integer',
    'scope': :'String',
    'statement_time_limit_in_minutes': :'Integer',
    'sql_tuning_set': :'OCI::DatabaseManagement::Models::SqlTuningSetInput',
    'sql_details': :'Array<OCI::DatabaseManagement::Models::SqlTuningTaskSqlDetail>',
    'time_started': :'DateTime',
    'time_ended': :'DateTime'
    # 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



194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
# File 'lib/oci/database_management/models/start_sql_tuning_task_details.rb', line 194

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

  self.class == other.class &&
    task_name == other.task_name &&
    task_description == other.task_description &&
    credential_details == other.credential_details &&
    total_time_limit_in_minutes == other.total_time_limit_in_minutes &&
    scope == other.scope &&
    statement_time_limit_in_minutes == other.statement_time_limit_in_minutes &&
    sql_tuning_set == other.sql_tuning_set &&
    sql_details == other.sql_details &&
    time_started == other.time_started &&
    time_ended == other.time_ended
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



233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
# File 'lib/oci/database_management/models/start_sql_tuning_task_details.rb', line 233

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


213
214
215
# File 'lib/oci/database_management/models/start_sql_tuning_task_details.rb', line 213

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



222
223
224
# File 'lib/oci/database_management/models/start_sql_tuning_task_details.rb', line 222

def hash
  [task_name, task_description, credential_details, total_time_limit_in_minutes, scope, statement_time_limit_in_minutes, sql_tuning_set, sql_details, time_started, time_ended].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



266
267
268
269
270
271
272
273
274
275
# File 'lib/oci/database_management/models/start_sql_tuning_task_details.rb', line 266

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



260
261
262
# File 'lib/oci/database_management/models/start_sql_tuning_task_details.rb', line 260

def to_s
  to_hash.to_s
end