Class: OCI::DataIntegration::Models::IncrementalFieldClause

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/data_integration/models/incremental_field_clause.rb

Overview

Field clause for incremental read operation.

Constant Summary collapse

INCREMENTAL_COMPARATOR_ENUM =
[
  INCREMENTAL_COMPARATOR_LESSTHAN = 'LESSTHAN'.freeze,
  INCREMENTAL_COMPARATOR_GREATERTHAN = 'GREATERTHAN'.freeze,
  INCREMENTAL_COMPARATOR_EQUALS = 'EQUALS'.freeze,
  INCREMENTAL_COMPARATOR_LESSTHANEQUALS = 'LESSTHANEQUALS'.freeze,
  INCREMENTAL_COMPARATOR_GREATERTHANEQUALS = 'GREATERTHANEQUALS'.freeze,
  INCREMENTAL_COMPARATOR_STARTSWITH = 'STARTSWITH'.freeze,
  INCREMENTAL_COMPARATOR_CONTAINS = 'CONTAINS'.freeze,
  INCREMENTAL_COMPARATOR_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ IncrementalFieldClause

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/oci/data_integration/models/incremental_field_clause.rb', line 66

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

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

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

  self.incremental_field_value = attributes[:'incrementalFieldValue'] if attributes[:'incrementalFieldValue']

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

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

  self.incremental_comparator = attributes[:'incrementalComparator'] if attributes[:'incrementalComparator']
  self.incremental_comparator = "GREATERTHAN" if incremental_comparator.nil? && !attributes.key?(:'incrementalComparator') # rubocop:disable Style/StringLiterals

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

  self.incremental_comparator = attributes[:'incremental_comparator'] if attributes[:'incremental_comparator']
  self.incremental_comparator = "GREATERTHAN" if incremental_comparator.nil? && !attributes.key?(:'incrementalComparator') && !attributes.key?(:'incremental_comparator') # rubocop:disable Style/StringLiterals
end

Instance Attribute Details

#incremental_comparatorString

[Required] Incremental comparator symbol.

Returns:

  • (String)


33
34
35
# File 'lib/oci/data_integration/models/incremental_field_clause.rb', line 33

def incremental_comparator
  @incremental_comparator
end

#incremental_field_nameString

[Required] Name of incremental field filter.

Returns:

  • (String)


25
26
27
# File 'lib/oci/data_integration/models/incremental_field_clause.rb', line 25

def incremental_field_name
  @incremental_field_name
end

#incremental_field_valueHash<String, String>

[Required] Value of incremental field filter.

Returns:

  • (Hash<String, String>)


29
30
31
# File 'lib/oci/data_integration/models/incremental_field_clause.rb', line 29

def incremental_field_value
  @incremental_field_value
end

Class Method Details

.attribute_mapObject

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



36
37
38
39
40
41
42
43
44
# File 'lib/oci/data_integration/models/incremental_field_clause.rb', line 36

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'incremental_field_name': :'incrementalFieldName',
    'incremental_field_value': :'incrementalFieldValue',
    'incremental_comparator': :'incrementalComparator'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



47
48
49
50
51
52
53
54
55
# File 'lib/oci/data_integration/models/incremental_field_clause.rb', line 47

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'incremental_field_name': :'String',
    'incremental_field_value': :'Hash<String, String>',
    'incremental_comparator': :'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



113
114
115
116
117
118
119
120
# File 'lib/oci/data_integration/models/incremental_field_clause.rb', line 113

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

  self.class == other.class &&
    incremental_field_name == other.incremental_field_name &&
    incremental_field_value == other.incremental_field_value &&
    incremental_comparator == other.incremental_comparator
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



145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# File 'lib/oci/data_integration/models/incremental_field_clause.rb', line 145

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


125
126
127
# File 'lib/oci/data_integration/models/incremental_field_clause.rb', line 125

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



134
135
136
# File 'lib/oci/data_integration/models/incremental_field_clause.rb', line 134

def hash
  [incremental_field_name, incremental_field_value, incremental_comparator].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



178
179
180
181
182
183
184
185
186
187
# File 'lib/oci/data_integration/models/incremental_field_clause.rb', line 178

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



172
173
174
# File 'lib/oci/data_integration/models/incremental_field_clause.rb', line 172

def to_s
  to_hash.to_s
end