Class: OCI::DatabaseManagement::Models::SqlInSqlTuningSet

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

Overview

Sql information in the Sql tuning set.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ SqlInSqlTuningSet

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/oci/database_management/models/sql_in_sql_tuning_set.rb', line 82

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_id = attributes[:'sqlId'] if attributes[:'sqlId']

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

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

  self.sql_text = attributes[:'sqlText'] if attributes[:'sqlText']

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

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

  self.container_database_id = attributes[:'containerDatabaseId'] if attributes[:'containerDatabaseId']

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

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

  self.plan_hash_value = attributes[:'planHashValue'] if attributes[:'planHashValue']

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

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

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

  self._module = attributes[:'module'] if attributes[:'module']

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

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

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

Instance Attribute Details

#_moduleString

The module of the Sql.

Returns:

  • (String)


33
34
35
# File 'lib/oci/database_management/models/sql_in_sql_tuning_set.rb', line 33

def _module
  @_module
end

#container_database_idInteger

The unique container database identifier.

Returns:

  • (Integer)


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

def container_database_id
  @container_database_id
end

#metricsArray<OCI::DatabaseManagement::Models::SqlMetrics>

A list of the Sqls associated with the Sql tuning set.



37
38
39
# File 'lib/oci/database_management/models/sql_in_sql_tuning_set.rb', line 37

def metrics
  @metrics
end

#plan_hash_valueInteger

[Required] Plan hash value of the Sql statement.

Returns:

  • (Integer)


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

def plan_hash_value
  @plan_hash_value
end

#schemaString

The schema name of the Sql.

Returns:

  • (String)


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

def schema
  @schema
end

#sql_idString

[Required] The unique Sql identifier.

Returns:

  • (String)


13
14
15
# File 'lib/oci/database_management/models/sql_in_sql_tuning_set.rb', line 13

def sql_id
  @sql_id
end

#sql_textString

Sql text.

Returns:

  • (String)


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

def sql_text
  @sql_text
end

Class Method Details

.attribute_mapObject

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



40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/oci/database_management/models/sql_in_sql_tuning_set.rb', line 40

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'sql_id': :'sqlId',
    'sql_text': :'sqlText',
    'container_database_id': :'containerDatabaseId',
    'plan_hash_value': :'planHashValue',
    'schema': :'schema',
    '_module': :'module',
    'metrics': :'metrics'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/oci/database_management/models/sql_in_sql_tuning_set.rb', line 55

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'sql_id': :'String',
    'sql_text': :'String',
    'container_database_id': :'Integer',
    'plan_hash_value': :'Integer',
    'schema': :'String',
    '_module': :'String',
    'metrics': :'Array<OCI::DatabaseManagement::Models::SqlMetrics>'
    # 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



130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/oci/database_management/models/sql_in_sql_tuning_set.rb', line 130

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

  self.class == other.class &&
    sql_id == other.sql_id &&
    sql_text == other.sql_text &&
    container_database_id == other.container_database_id &&
    plan_hash_value == other.plan_hash_value &&
    schema == other.schema &&
    _module == other._module &&
    metrics == other.metrics
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



166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
# File 'lib/oci/database_management/models/sql_in_sql_tuning_set.rb', line 166

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


146
147
148
# File 'lib/oci/database_management/models/sql_in_sql_tuning_set.rb', line 146

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



155
156
157
# File 'lib/oci/database_management/models/sql_in_sql_tuning_set.rb', line 155

def hash
  [sql_id, sql_text, container_database_id, plan_hash_value, schema, _module, metrics].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



199
200
201
202
203
204
205
206
207
208
# File 'lib/oci/database_management/models/sql_in_sql_tuning_set.rb', line 199

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



193
194
195
# File 'lib/oci/database_management/models/sql_in_sql_tuning_set.rb', line 193

def to_s
  to_hash.to_s
end