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):



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

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.



25
26
27
# File 'lib/oci/database_management/models/start_sql_tuning_task_details.rb', line 25

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)


36
37
38
# File 'lib/oci/database_management/models/start_sql_tuning_task_details.rb', line 36

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.



52
53
54
# File 'lib/oci/database_management/models/start_sql_tuning_task_details.rb', line 52

def sql_details
  @sql_details
end

#sql_tuning_setOCI::DatabaseManagement::Models::SqlTuningSetInput



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

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)


42
43
44
# File 'lib/oci/database_management/models/start_sql_tuning_task_details.rb', line 42

def statement_time_limit_in_minutes
  @statement_time_limit_in_minutes
end

#task_descriptionString

The description of the SQL tuning task.

Returns:

  • (String)


21
22
23
# File 'lib/oci/database_management/models/start_sql_tuning_task_details.rb', line 21

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)


17
18
19
# File 'lib/oci/database_management/models/start_sql_tuning_task_details.rb', line 17

def task_name
  @task_name
end

#time_endedDateTime

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

Returns:

  • (DateTime)


60
61
62
# File 'lib/oci/database_management/models/start_sql_tuning_task_details.rb', line 60

def time_ended
  @time_ended
end

#time_startedDateTime

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

Returns:

  • (DateTime)


56
57
58
# File 'lib/oci/database_management/models/start_sql_tuning_task_details.rb', line 56

def time_started
  @time_started
end

#total_time_limit_in_minutesInteger

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

Returns:

  • (Integer)


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

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.



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

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.



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

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



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

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



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

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


211
212
213
# File 'lib/oci/database_management/models/start_sql_tuning_task_details.rb', line 211

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



220
221
222
# File 'lib/oci/database_management/models/start_sql_tuning_task_details.rb', line 220

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



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

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



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

def to_s
  to_hash.to_s
end