Class: OCI::DatabaseManagement::Models::SqlTuningSetSummary

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

Overview

The summary information of a SQL tuning set.

Constant Summary collapse

STATUS_ENUM =
[
  STATUS_DISABLED = 'DISABLED'.freeze,
  STATUS_RETRY_SCHEDULED = 'RETRY_SCHEDULED'.freeze,
  STATUS_SCHEDULED = 'SCHEDULED'.freeze,
  STATUS_BLOCKED = 'BLOCKED'.freeze,
  STATUS_RUNNING = 'RUNNING'.freeze,
  STATUS_COMPLETED = 'COMPLETED'.freeze,
  STATUS_BROKEN = 'BROKEN'.freeze,
  STATUS_FAILED = 'FAILED'.freeze,
  STATUS_REMOTE = 'REMOTE'.freeze,
  STATUS_RESOURCE_UNAVAILABLE = 'RESOURCE_UNAVAILABLE'.freeze,
  STATUS_SUCCEEDED = 'SUCCEEDED'.freeze,
  STATUS_CHAIN_STALLED = 'CHAIN_STALLED'.freeze,
  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 = {}) ⇒ SqlTuningSetSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :name (String)

    The value to assign to the #name property

  • :owner (String)

    The value to assign to the #owner property

  • :description (String)

    The value to assign to the #description property

  • :statement_counts (Integer)

    The value to assign to the #statement_counts property

  • :id (Integer)

    The value to assign to the #id property

  • :time_created (DateTime)

    The value to assign to the #time_created property

  • :time_last_modified (DateTime)

    The value to assign to the #time_last_modified property

  • :status (String)

    The value to assign to the #status property

  • :scheduled_job_name (String)

    The value to assign to the #scheduled_job_name property

  • :error_message (String)

    The value to assign to the #error_message property



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

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

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

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

  self.statement_counts = attributes[:'statementCounts'] if attributes[:'statementCounts']

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

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

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

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

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

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

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

  self.scheduled_job_name = attributes[:'scheduledJobName'] if attributes[:'scheduledJobName']

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

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

  self.error_message = attributes[:'errorMessage'] if attributes[:'errorMessage']

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

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

Instance Attribute Details

#descriptionString

The description of the SQL tuning set.

Returns:

  • (String)


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

def description
  @description
end

#error_messageString

Latest execution error of the plsql that was submitted as a scheduler job.

Returns:

  • (String)


66
67
68
# File 'lib/oci/database_management/models/sql_tuning_set_summary.rb', line 66

def error_message
  @error_message
end

#idInteger

The unique Sql tuning set identifier. This is not OCID.

Returns:

  • (Integer)


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

def id
  @id
end

#nameString

[Required] The name of the SQL tuning set.

Returns:

  • (String)


30
31
32
# File 'lib/oci/database_management/models/sql_tuning_set_summary.rb', line 30

def name
  @name
end

#ownerString

[Required] The owner of the SQL tuning set.

Returns:

  • (String)


34
35
36
# File 'lib/oci/database_management/models/sql_tuning_set_summary.rb', line 34

def owner
  @owner
end

#scheduled_job_nameString

Name of the Sql tuning set scheduler job.

Returns:

  • (String)


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

def scheduled_job_name
  @scheduled_job_name
end

#statement_countsInteger

The number of SQL statements in the SQL tuning set.

Returns:

  • (Integer)


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

def statement_counts
  @statement_counts
end

#statusString

Current status of the Sql tuning set.

Returns:

  • (String)


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

def status
  @status
end

#time_createdDateTime

The created time of the Sql tuning set.

Returns:

  • (DateTime)


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

def time_created
  @time_created
end

#time_last_modifiedDateTime

Last modified time of the Sql tuning set.

Returns:

  • (DateTime)


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

def time_last_modified
  @time_last_modified
end

Class Method Details

.attribute_mapObject

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



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

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'name': :'name',
    'owner': :'owner',
    'description': :'description',
    'statement_counts': :'statementCounts',
    'id': :'id',
    'time_created': :'timeCreated',
    'time_last_modified': :'timeLastModified',
    'status': :'status',
    'scheduled_job_name': :'scheduledJobName',
    'error_message': :'errorMessage'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/oci/database_management/models/sql_tuning_set_summary.rb', line 87

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'name': :'String',
    'owner': :'String',
    'description': :'String',
    'statement_counts': :'Integer',
    'id': :'Integer',
    'time_created': :'DateTime',
    'time_last_modified': :'DateTime',
    'status': :'String',
    'scheduled_job_name': :'String',
    'error_message': :'String'
    # 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



187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
# File 'lib/oci/database_management/models/sql_tuning_set_summary.rb', line 187

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

  self.class == other.class &&
    name == other.name &&
    owner == other.owner &&
    description == other.description &&
    statement_counts == other.statement_counts &&
    id == other.id &&
    time_created == other.time_created &&
    time_last_modified == other.time_last_modified &&
    status == other.status &&
    scheduled_job_name == other.scheduled_job_name &&
    error_message == other.error_message
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



226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
# File 'lib/oci/database_management/models/sql_tuning_set_summary.rb', line 226

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


206
207
208
# File 'lib/oci/database_management/models/sql_tuning_set_summary.rb', line 206

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



215
216
217
# File 'lib/oci/database_management/models/sql_tuning_set_summary.rb', line 215

def hash
  [name, owner, description, statement_counts, id, time_created, time_last_modified, status, scheduled_job_name, error_message].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



259
260
261
262
263
264
265
266
267
268
# File 'lib/oci/database_management/models/sql_tuning_set_summary.rb', line 259

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



253
254
255
# File 'lib/oci/database_management/models/sql_tuning_set_summary.rb', line 253

def to_s
  to_hash.to_s
end