Class: OCI::DatabaseManagement::Models::SqlTuningSetAdminActionStatus

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

Overview

The status of a Sql tuning set admin action.

Constant Summary collapse

STATUS_ENUM =
[
  STATUS_SUCCEEDED = 'SUCCEEDED'.freeze,
  STATUS_FAILED = 'FAILED'.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 = {}) ⇒ SqlTuningSetAdminActionStatus

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :status (String)

    The value to assign to the #status property

  • :success_message (String)

    The value to assign to the #success_message property

  • :error_code (Integer)

    The value to assign to the #error_code property

  • :error_message (String)

    The value to assign to the #error_message property

  • :show_sql_only (Integer)

    The value to assign to the #show_sql_only property

  • :sql_statement (String)

    The value to assign to the #sql_statement property



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

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

  self.success_message = attributes[:'successMessage'] if attributes[:'successMessage']

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

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

  self.error_code = attributes[:'errorCode'] if attributes[:'errorCode']

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

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

  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']

  self.show_sql_only = attributes[:'showSqlOnly'] if attributes[:'showSqlOnly']

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

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

  self.sql_statement = attributes[:'sqlStatement'] if attributes[:'sqlStatement']

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

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

Instance Attribute Details

#error_codeInteger

The error code that denotes failure if the Sql tuning set admin action is not successful. The error code is "null" if the admin action is successful.

Returns:

  • (Integer)


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

def error_code
  @error_code
end

#error_messageString

The error message that indicates the reason for failure if the Sql tuning set admin action is not successful. The error message is "null" if the admin action is successful.

Returns:

  • (String)


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

def error_message
  @error_message
end

#show_sql_onlyInteger

Flag to indicate whether to create the Sql tuning set or just display the plsql used for the selected user action.

Returns:

  • (Integer)


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

def show_sql_only
  @show_sql_only
end

#sql_statementString

When showSqlOnly is set to 1, this attribute displays the plsql generated for the selected user action. When showSqlOnly is set to 0, this attribute will not be returned.

Returns:

  • (String)


47
48
49
# File 'lib/oci/database_management/models/sql_tuning_set_admin_action_status.rb', line 47

def sql_statement
  @sql_statement
end

#statusString

[Required] The status of a Sql tuning set admin action.

Returns:

  • (String)


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

def status
  @status
end

#success_messageString

The success message of the Sql tuning set admin action. The success message is "null" if the admin action is non successful.

Returns:

  • (String)


26
27
28
# File 'lib/oci/database_management/models/sql_tuning_set_admin_action_status.rb', line 26

def success_message
  @success_message
end

Class Method Details

.attribute_mapObject

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



50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/oci/database_management/models/sql_tuning_set_admin_action_status.rb', line 50

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'status': :'status',
    'success_message': :'successMessage',
    'error_code': :'errorCode',
    'error_message': :'errorMessage',
    'show_sql_only': :'showSqlOnly',
    'sql_statement': :'sqlStatement'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



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

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'status': :'String',
    'success_message': :'String',
    'error_code': :'Integer',
    'error_message': :'String',
    'show_sql_only': :'Integer',
    'sql_statement': :'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



148
149
150
151
152
153
154
155
156
157
158
# File 'lib/oci/database_management/models/sql_tuning_set_admin_action_status.rb', line 148

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

  self.class == other.class &&
    status == other.status &&
    success_message == other.success_message &&
    error_code == other.error_code &&
    error_message == other.error_message &&
    show_sql_only == other.show_sql_only &&
    sql_statement == other.sql_statement
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



183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
# File 'lib/oci/database_management/models/sql_tuning_set_admin_action_status.rb', line 183

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


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

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



172
173
174
# File 'lib/oci/database_management/models/sql_tuning_set_admin_action_status.rb', line 172

def hash
  [status, success_message, error_code, error_message, show_sql_only, sql_statement].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



216
217
218
219
220
221
222
223
224
225
# File 'lib/oci/database_management/models/sql_tuning_set_admin_action_status.rb', line 216

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



210
211
212
# File 'lib/oci/database_management/models/sql_tuning_set_admin_action_status.rb', line 210

def to_s
  to_hash.to_s
end