Class: OCI::Nosql::Models::UpdateRowDetails

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/nosql/models/update_row_details.rb

Overview

Specifications for the putting of a table row.

Constant Summary collapse

OPTION_ENUM =
[
  OPTION_IF_ABSENT = 'IF_ABSENT'.freeze,
  OPTION_IF_PRESENT = 'IF_PRESENT'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ UpdateRowDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :compartment_id (String)

    The value to assign to the #compartment_id property

  • :value (Hash<String, Object>)

    The value to assign to the #value property

  • :option (String)

    The value to assign to the #option property

  • :is_get_return_row (BOOLEAN)

    The value to assign to the #is_get_return_row property

  • :timeout_in_ms (Integer)

    The value to assign to the #timeout_in_ms property

  • :ttl (Integer)

    The value to assign to the #ttl property

  • :is_ttl_use_table_default (BOOLEAN)

    The value to assign to the #is_ttl_use_table_default property

  • :identity_cache_size (Integer)

    The value to assign to the #identity_cache_size property

  • :is_exact_match (BOOLEAN)

    The value to assign to the #is_exact_match property



115
116
117
118
119
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
166
# File 'lib/oci/nosql/models/update_row_details.rb', line 115

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

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

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

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

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

  self.is_get_return_row = attributes[:'isGetReturnRow'] unless attributes[:'isGetReturnRow'].nil?
  self.is_get_return_row = false if is_get_return_row.nil? && !attributes.key?(:'isGetReturnRow') # rubocop:disable Style/StringLiterals

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

  self.is_get_return_row = attributes[:'is_get_return_row'] unless attributes[:'is_get_return_row'].nil?
  self.is_get_return_row = false if is_get_return_row.nil? && !attributes.key?(:'isGetReturnRow') && !attributes.key?(:'is_get_return_row') # rubocop:disable Style/StringLiterals

  self.timeout_in_ms = attributes[:'timeoutInMs'] if attributes[:'timeoutInMs']

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

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

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

  self.is_ttl_use_table_default = attributes[:'isTtlUseTableDefault'] unless attributes[:'isTtlUseTableDefault'].nil?
  self.is_ttl_use_table_default = true if is_ttl_use_table_default.nil? && !attributes.key?(:'isTtlUseTableDefault') # rubocop:disable Style/StringLiterals

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

  self.is_ttl_use_table_default = attributes[:'is_ttl_use_table_default'] unless attributes[:'is_ttl_use_table_default'].nil?
  self.is_ttl_use_table_default = true if is_ttl_use_table_default.nil? && !attributes.key?(:'isTtlUseTableDefault') && !attributes.key?(:'is_ttl_use_table_default') # rubocop:disable Style/StringLiterals

  self.identity_cache_size = attributes[:'identityCacheSize'] if attributes[:'identityCacheSize']

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

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

  self.is_exact_match = attributes[:'isExactMatch'] unless attributes[:'isExactMatch'].nil?

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

  self.is_exact_match = attributes[:'is_exact_match'] unless attributes[:'is_exact_match'].nil?
end

Instance Attribute Details

#compartment_idString

The OCID of the table's compartment. Required if the tableNameOrId path parameter is a table name. Optional if tableNameOrId is an OCID. If tableNameOrId is an OCID, and compartmentId is supplied, the latter must match the identified table's compartmentId.

Returns:

  • (String)


23
24
25
# File 'lib/oci/nosql/models/update_row_details.rb', line 23

def compartment_id
  @compartment_id
end

#identity_cache_sizeInteger

Sets the number of generated identity values that are requested from the server during a put. If present and greater than 0, this value takes precedence over a default value for the table.

Returns:

  • (Integer)


57
58
59
# File 'lib/oci/nosql/models/update_row_details.rb', line 57

def identity_cache_size
  @identity_cache_size
end

#is_exact_matchBOOLEAN

If present and true, the presented row value must exactly match the table's schema. Otherwise, rows with missing non-key fields or extra fields can be written successfully.

Returns:

  • (BOOLEAN)


64
65
66
# File 'lib/oci/nosql/models/update_row_details.rb', line 64

def is_exact_match
  @is_exact_match
end

#is_get_return_rowBOOLEAN

If true, and the put fails due to an option setting, then the existing row will be returned.

Returns:

  • (BOOLEAN)


37
38
39
# File 'lib/oci/nosql/models/update_row_details.rb', line 37

def is_get_return_row
  @is_get_return_row
end

#is_ttl_use_table_defaultBOOLEAN

If true, set time-to-live for this row to the table's default.

Returns:

  • (BOOLEAN)


50
51
52
# File 'lib/oci/nosql/models/update_row_details.rb', line 50

def is_ttl_use_table_default
  @is_ttl_use_table_default
end

#optionString

Specifies a condition for the put operation.

Returns:

  • (String)


31
32
33
# File 'lib/oci/nosql/models/update_row_details.rb', line 31

def option
  @option
end

#timeout_in_msInteger

Timeout setting for the put.

Returns:

  • (Integer)


41
42
43
# File 'lib/oci/nosql/models/update_row_details.rb', line 41

def timeout_in_ms
  @timeout_in_ms
end

#ttlInteger

Time-to-live for the row, in days.

Returns:

  • (Integer)


45
46
47
# File 'lib/oci/nosql/models/update_row_details.rb', line 45

def ttl
  @ttl
end

#valueHash<String, Object>

[Required] The map of values from a row.

Returns:

  • (Hash<String, Object>)


27
28
29
# File 'lib/oci/nosql/models/update_row_details.rb', line 27

def value
  @value
end

Class Method Details

.attribute_mapObject

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



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/oci/nosql/models/update_row_details.rb', line 67

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'compartment_id': :'compartmentId',
    'value': :'value',
    'option': :'option',
    'is_get_return_row': :'isGetReturnRow',
    'timeout_in_ms': :'timeoutInMs',
    'ttl': :'ttl',
    'is_ttl_use_table_default': :'isTtlUseTableDefault',
    'identity_cache_size': :'identityCacheSize',
    'is_exact_match': :'isExactMatch'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/oci/nosql/models/update_row_details.rb', line 84

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'compartment_id': :'String',
    'value': :'Hash<String, Object>',
    'option': :'String',
    'is_get_return_row': :'BOOLEAN',
    'timeout_in_ms': :'Integer',
    'ttl': :'Integer',
    'is_ttl_use_table_default': :'BOOLEAN',
    'identity_cache_size': :'Integer',
    'is_exact_match': :'BOOLEAN'
    # 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



183
184
185
186
187
188
189
190
191
192
193
194
195
196
# File 'lib/oci/nosql/models/update_row_details.rb', line 183

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

  self.class == other.class &&
    compartment_id == other.compartment_id &&
    value == other.value &&
    option == other.option &&
    is_get_return_row == other.is_get_return_row &&
    timeout_in_ms == other.timeout_in_ms &&
    ttl == other.ttl &&
    is_ttl_use_table_default == other.is_ttl_use_table_default &&
    identity_cache_size == other.identity_cache_size &&
    is_exact_match == other.is_exact_match
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



221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
# File 'lib/oci/nosql/models/update_row_details.rb', line 221

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


201
202
203
# File 'lib/oci/nosql/models/update_row_details.rb', line 201

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



210
211
212
# File 'lib/oci/nosql/models/update_row_details.rb', line 210

def hash
  [compartment_id, value, option, is_get_return_row, timeout_in_ms, ttl, is_ttl_use_table_default, identity_cache_size, is_exact_match].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



254
255
256
257
258
259
260
261
262
263
# File 'lib/oci/nosql/models/update_row_details.rb', line 254

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



248
249
250
# File 'lib/oci/nosql/models/update_row_details.rb', line 248

def to_s
  to_hash.to_s
end