Class: OCI::DatabaseManagement::Models::ChangeSqlPlanBaselinesAttributesDetails

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

Overview

The details required to change SQL plan baseline attributes. It takes either credentials or databaseCredential. It's recommended to provide databaseCredential

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ChangeSqlPlanBaselinesAttributesDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
122
123
124
125
126
127
128
129
# File 'lib/oci/database_management/models/change_sql_plan_baselines_attributes_details.rb', line 86

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_handle = attributes[:'sqlHandle'] if attributes[:'sqlHandle']

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

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

  self.plan_name = attributes[:'planName'] if attributes[:'planName']

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

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

  self.is_enabled = attributes[:'isEnabled'] unless attributes[:'isEnabled'].nil?

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

  self.is_enabled = attributes[:'is_enabled'] unless attributes[:'is_enabled'].nil?

  self.is_fixed = attributes[:'isFixed'] unless attributes[:'isFixed'].nil?

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

  self.is_fixed = attributes[:'is_fixed'] unless attributes[:'is_fixed'].nil?

  self.is_auto_purged = attributes[:'isAutoPurged'] unless attributes[:'isAutoPurged'].nil?

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

  self.is_auto_purged = attributes[:'is_auto_purged'] unless attributes[:'is_auto_purged'].nil?

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

  self.database_credential = attributes[:'databaseCredential'] if attributes[:'databaseCredential']

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

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

Instance Attribute Details

#credentialsOCI::DatabaseManagement::Models::ManagedDatabaseCredential



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

def credentials
  @credentials
end

#database_credentialOCI::DatabaseManagement::Models::DatabaseCredentialDetails



41
42
43
# File 'lib/oci/database_management/models/change_sql_plan_baselines_attributes_details.rb', line 41

def database_credential
  @database_credential
end

#is_auto_purgedBOOLEAN

Indicates whether the plan is purged if it is not used for a time period.

Returns:

  • (BOOLEAN)


35
36
37
# File 'lib/oci/database_management/models/change_sql_plan_baselines_attributes_details.rb', line 35

def is_auto_purged
  @is_auto_purged
end

#is_enabledBOOLEAN

Indicates whether the plan is available for use by the optimizer.

Returns:

  • (BOOLEAN)


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

def is_enabled
  @is_enabled
end

#is_fixedBOOLEAN

Indicates whether the plan baseline is fixed. A fixed plan takes precedence over a non-fixed plan.

Returns:

  • (BOOLEAN)


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

def is_fixed
  @is_fixed
end

#plan_nameString

Then plan name. It identifies a specific plan. If null' then all plans associated with a SQL statement identified bysqlHandle' are considered for attribute changes.

Returns:

  • (String)


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

def plan_name
  @plan_name
end

#sql_handleString

The SQL statement handle. It identifies plans associated with a SQL statement for attribute changes. If null then planName must be specified.

Returns:

  • (String)


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

def sql_handle
  @sql_handle
end

Class Method Details

.attribute_mapObject

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



44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/oci/database_management/models/change_sql_plan_baselines_attributes_details.rb', line 44

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'sql_handle': :'sqlHandle',
    'plan_name': :'planName',
    'is_enabled': :'isEnabled',
    'is_fixed': :'isFixed',
    'is_auto_purged': :'isAutoPurged',
    'credentials': :'credentials',
    'database_credential': :'databaseCredential'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



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

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'sql_handle': :'String',
    'plan_name': :'String',
    'is_enabled': :'BOOLEAN',
    'is_fixed': :'BOOLEAN',
    'is_auto_purged': :'BOOLEAN',
    'credentials': :'OCI::DatabaseManagement::Models::ManagedDatabaseCredential',
    'database_credential': :'OCI::DatabaseManagement::Models::DatabaseCredentialDetails'
    # 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



138
139
140
141
142
143
144
145
146
147
148
149
# File 'lib/oci/database_management/models/change_sql_plan_baselines_attributes_details.rb', line 138

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

  self.class == other.class &&
    sql_handle == other.sql_handle &&
    plan_name == other.plan_name &&
    is_enabled == other.is_enabled &&
    is_fixed == other.is_fixed &&
    is_auto_purged == other.is_auto_purged &&
    credentials == other.credentials &&
    database_credential == other.database_credential
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



174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
# File 'lib/oci/database_management/models/change_sql_plan_baselines_attributes_details.rb', line 174

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


154
155
156
# File 'lib/oci/database_management/models/change_sql_plan_baselines_attributes_details.rb', line 154

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



163
164
165
# File 'lib/oci/database_management/models/change_sql_plan_baselines_attributes_details.rb', line 163

def hash
  [sql_handle, plan_name, is_enabled, is_fixed, is_auto_purged, credentials, database_credential].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



207
208
209
210
211
212
213
214
215
216
# File 'lib/oci/database_management/models/change_sql_plan_baselines_attributes_details.rb', line 207

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



201
202
203
# File 'lib/oci/database_management/models/change_sql_plan_baselines_attributes_details.rb', line 201

def to_s
  to_hash.to_s
end