Class: OCI::DataIntegration::Models::FlattenProjectionPreferences

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

Overview

The preferences for the flatten operation.

Constant Summary collapse

CREATE_ARRAY_INDEX_ENUM =
[
  CREATE_ARRAY_INDEX_ALLOW = 'ALLOW'.freeze,
  CREATE_ARRAY_INDEX_DO_NOT_ALLOW = 'DO_NOT_ALLOW'.freeze,
  CREATE_ARRAY_INDEX_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
RETAIN_ALL_ATTRIBUTES_ENUM =
[
  RETAIN_ALL_ATTRIBUTES_ALLOW = 'ALLOW'.freeze,
  RETAIN_ALL_ATTRIBUTES_DO_NOT_ALLOW = 'DO_NOT_ALLOW'.freeze,
  RETAIN_ALL_ATTRIBUTES_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
IGNORE_NULL_VALUES_ENUM =
[
  IGNORE_NULL_VALUES_ALLOW = 'ALLOW'.freeze,
  IGNORE_NULL_VALUES_DO_NOT_ALLOW = 'DO_NOT_ALLOW'.freeze,
  IGNORE_NULL_VALUES_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
RETAIN_PARENT_NAME_LINEAGE_ENUM =
[
  RETAIN_PARENT_NAME_LINEAGE_ALLOW = 'ALLOW'.freeze,
  RETAIN_PARENT_NAME_LINEAGE_DO_NOT_ALLOW = 'DO_NOT_ALLOW'.freeze,
  RETAIN_PARENT_NAME_LINEAGE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ FlattenProjectionPreferences

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
# File 'lib/oci/data_integration/models/flatten_projection_preferences.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.create_array_index = attributes[:'createArrayIndex'] if attributes[:'createArrayIndex']

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

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

  self.retain_all_attributes = attributes[:'retainAllAttributes'] if attributes[:'retainAllAttributes']

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

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

  self.ignore_null_values = attributes[:'ignoreNullValues'] if attributes[:'ignoreNullValues']

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

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

  self.retain_parent_name_lineage = attributes[:'retainParentNameLineage'] if attributes[:'retainParentNameLineage']

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

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

Instance Attribute Details

#create_array_indexString

[Required] Property defining whether to create array indexes in flattened result.

Returns:

  • (String)


38
39
40
# File 'lib/oci/data_integration/models/flatten_projection_preferences.rb', line 38

def create_array_index
  @create_array_index
end

#ignore_null_valuesString

[Required] Property defining whether to ignore null values in flattened result.

Returns:

  • (String)


46
47
48
# File 'lib/oci/data_integration/models/flatten_projection_preferences.rb', line 46

def ignore_null_values
  @ignore_null_values
end

#retain_all_attributesString

[Required] Property defining whether to retain all attributes in flattened result.

Returns:

  • (String)


42
43
44
# File 'lib/oci/data_integration/models/flatten_projection_preferences.rb', line 42

def retain_all_attributes
  @retain_all_attributes
end

#retain_parent_name_lineageString

[Required] Property defining whether to retain parent name lineage.

Returns:

  • (String)


50
51
52
# File 'lib/oci/data_integration/models/flatten_projection_preferences.rb', line 50

def retain_parent_name_lineage
  @retain_parent_name_lineage
end

Class Method Details

.attribute_mapObject

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



53
54
55
56
57
58
59
60
61
62
# File 'lib/oci/data_integration/models/flatten_projection_preferences.rb', line 53

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'create_array_index': :'createArrayIndex',
    'retain_all_attributes': :'retainAllAttributes',
    'ignore_null_values': :'ignoreNullValues',
    'retain_parent_name_lineage': :'retainParentNameLineage'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



65
66
67
68
69
70
71
72
73
74
# File 'lib/oci/data_integration/models/flatten_projection_preferences.rb', line 65

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'create_array_index': :'String',
    'retain_all_attributes': :'String',
    'ignore_null_values': :'String',
    'retain_parent_name_lineage': :'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



176
177
178
179
180
181
182
183
184
# File 'lib/oci/data_integration/models/flatten_projection_preferences.rb', line 176

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

  self.class == other.class &&
    create_array_index == other.create_array_index &&
    retain_all_attributes == other.retain_all_attributes &&
    ignore_null_values == other.ignore_null_values &&
    retain_parent_name_lineage == other.retain_parent_name_lineage
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



209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
# File 'lib/oci/data_integration/models/flatten_projection_preferences.rb', line 209

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


189
190
191
# File 'lib/oci/data_integration/models/flatten_projection_preferences.rb', line 189

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



198
199
200
# File 'lib/oci/data_integration/models/flatten_projection_preferences.rb', line 198

def hash
  [create_array_index, retain_all_attributes, ignore_null_values, retain_parent_name_lineage].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



242
243
244
245
246
247
248
249
250
251
# File 'lib/oci/data_integration/models/flatten_projection_preferences.rb', line 242

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



236
237
238
# File 'lib/oci/data_integration/models/flatten_projection_preferences.rb', line 236

def to_s
  to_hash.to_s
end