Class: OCI::DatabaseManagement::Models::OptimizerStatisticsOperationTask

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

Overview

The details of the Optimizer Statistics Collection task.

Constant Summary collapse

TARGET_TYPE_ENUM =
[
  TARGET_TYPE_TABLE = 'TABLE'.freeze,
  TARGET_TYPE_GLOBAL_TABLE = 'GLOBAL_TABLE'.freeze,
  TARGET_TYPE_COORDINATOR_TABLE = 'COORDINATOR_TABLE'.freeze,
  TARGET_TYPE_TABLE_PARTITION = 'TABLE_PARTITION'.freeze,
  TARGET_TYPE_TABLE_SUBPARTITION = 'TABLE_SUBPARTITION'.freeze,
  TARGET_TYPE_INDEX = 'INDEX'.freeze,
  TARGET_TYPE_INDEX_PARTITION = 'INDEX_PARTITION'.freeze,
  TARGET_TYPE_INDEX_SUBPARTITION = 'INDEX_SUBPARTITION'.freeze,
  TARGET_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
STATUS_ENUM =
[
  STATUS_PENDING = 'PENDING'.freeze,
  STATUS_IN_PROGRESS = 'IN_PROGRESS'.freeze,
  STATUS_SKIPPED = 'SKIPPED'.freeze,
  STATUS_TIMED_OUT = 'TIMED_OUT'.freeze,
  STATUS_COMPLETED = 'COMPLETED'.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 = {}) ⇒ OptimizerStatisticsOperationTask

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :target (String)

    The value to assign to the #target property

  • :target_type (String)

    The value to assign to the #target_type property

  • :time_start (DateTime)

    The value to assign to the #time_start property

  • :time_end (DateTime)

    The value to assign to the #time_end property

  • :status (String)

    The value to assign to the #status property



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

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

  self.target_type = attributes[:'targetType'] if attributes[:'targetType']

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

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

  self.time_start = attributes[:'timeStart'] if attributes[:'timeStart']

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

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

  self.time_end = attributes[:'timeEnd'] if attributes[:'timeEnd']

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

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

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

Instance Attribute Details

#statusString

[Required] The status of the Optimizer Statistics Collection task.

Returns:

  • (String)


52
53
54
# File 'lib/oci/database_management/models/optimizer_statistics_operation_task.rb', line 52

def status
  @status
end

#targetString

[Required] The name of the target object for which statistics are gathered.

Returns:

  • (String)


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

def target
  @target
end

#target_typeString

[Required] The type of target object.

Returns:

  • (String)


40
41
42
# File 'lib/oci/database_management/models/optimizer_statistics_operation_task.rb', line 40

def target_type
  @target_type
end

#time_endDateTime

[Required] The end time of the Optimizer Statistics Collection task.

Returns:

  • (DateTime)


48
49
50
# File 'lib/oci/database_management/models/optimizer_statistics_operation_task.rb', line 48

def time_end
  @time_end
end

#time_startDateTime

[Required] The start time of the Optimizer Statistics Collection task.

Returns:

  • (DateTime)


44
45
46
# File 'lib/oci/database_management/models/optimizer_statistics_operation_task.rb', line 44

def time_start
  @time_start
end

Class Method Details

.attribute_mapObject

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



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

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'target': :'target',
    'target_type': :'targetType',
    'time_start': :'timeStart',
    'time_end': :'timeEnd',
    'status': :'status'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



68
69
70
71
72
73
74
75
76
77
78
# File 'lib/oci/database_management/models/optimizer_statistics_operation_task.rb', line 68

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'target': :'String',
    'target_type': :'String',
    'time_start': :'DateTime',
    'time_end': :'DateTime',
    'status': :'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



153
154
155
156
157
158
159
160
161
162
# File 'lib/oci/database_management/models/optimizer_statistics_operation_task.rb', line 153

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

  self.class == other.class &&
    target == other.target &&
    target_type == other.target_type &&
    time_start == other.time_start &&
    time_end == other.time_end &&
    status == other.status
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



187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# File 'lib/oci/database_management/models/optimizer_statistics_operation_task.rb', line 187

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


167
168
169
# File 'lib/oci/database_management/models/optimizer_statistics_operation_task.rb', line 167

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



176
177
178
# File 'lib/oci/database_management/models/optimizer_statistics_operation_task.rb', line 176

def hash
  [target, target_type, time_start, time_end, status].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



220
221
222
223
224
225
226
227
228
229
# File 'lib/oci/database_management/models/optimizer_statistics_operation_task.rb', line 220

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



214
215
216
# File 'lib/oci/database_management/models/optimizer_statistics_operation_task.rb', line 214

def to_s
  to_hash.to_s
end