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



105
106
107
108
109
110
111
112
113
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
# File 'lib/oci/database_management/models/start_sql_tuning_task_details.rb', line 105

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_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>

[Required] The array of the details of SQL statement on which tuning is performed.



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

def sql_details
  @sql_details
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

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

Returns:

  • (DateTime)


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

def time_ended
  @time_ended
end

#time_startedDateTime

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

Returns:

  • (DateTime)


50
51
52
# File 'lib/oci/database_management/models/start_sql_tuning_task_details.rb', line 50

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.



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/oci/database_management/models/start_sql_tuning_task_details.rb', line 57

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_details': :'sqlDetails',
    'time_started': :'timeStarted',
    'time_ended': :'timeEnded'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/oci/database_management/models/start_sql_tuning_task_details.rb', line 74

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_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



177
178
179
180
181
182
183
184
185
186
187
188
189
190
# File 'lib/oci/database_management/models/start_sql_tuning_task_details.rb', line 177

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_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



215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
# File 'lib/oci/database_management/models/start_sql_tuning_task_details.rb', line 215

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


195
196
197
# File 'lib/oci/database_management/models/start_sql_tuning_task_details.rb', line 195

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



204
205
206
# File 'lib/oci/database_management/models/start_sql_tuning_task_details.rb', line 204

def hash
  [task_name, task_description, credential_details, total_time_limit_in_minutes, scope, statement_time_limit_in_minutes, 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



248
249
250
251
252
253
254
255
256
257
# File 'lib/oci/database_management/models/start_sql_tuning_task_details.rb', line 248

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



242
243
244
# File 'lib/oci/database_management/models/start_sql_tuning_task_details.rb', line 242

def to_s
  to_hash.to_s
end