Class: OCI::DataIntegration::Models::Lookup

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

Overview

The information about the lookup operator. The lookup operator has two input links, a primary input, and a lookup source input. It has an output link, fields of the lookup input are appended to the primary input and projected as the output fields.

Constant Summary collapse

MULTI_MATCH_STRATEGY_ENUM =
[
  MULTI_MATCH_STRATEGY_RETURN_ANY = 'RETURN_ANY'.freeze,
  MULTI_MATCH_STRATEGY_RETURN_FIRST = 'RETURN_FIRST'.freeze,
  MULTI_MATCH_STRATEGY_RETURN_LAST = 'RETURN_LAST'.freeze,
  MULTI_MATCH_STRATEGY_RETURN_ALL = 'RETURN_ALL'.freeze,
  MULTI_MATCH_STRATEGY_RETURN_ERROR = 'RETURN_ERROR'.freeze,
  MULTI_MATCH_STRATEGY_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Constants inherited from Operator

Operator::MODEL_TYPE_ENUM

Instance Attribute Summary collapse

Attributes inherited from Operator

#description, #identifier, #input_ports, #key, #model_type, #model_version, #name, #object_status, #object_version, #op_config_values, #output_ports, #parameters, #parent_ref

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Operator

get_subtype

Constructor Details

#initialize(attributes = {}) ⇒ Lookup

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



109
110
111
112
113
114
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
# File 'lib/oci/data_integration/models/lookup.rb', line 109

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  attributes['modelType'] = 'LOOKUP_OPERATOR'

  super(attributes)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  self.lookup_condition = attributes[:'lookupCondition'] if attributes[:'lookupCondition']

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

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

  self.is_skip_no_match = attributes[:'isSkipNoMatch'] unless attributes[:'isSkipNoMatch'].nil?

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

  self.is_skip_no_match = attributes[:'is_skip_no_match'] unless attributes[:'is_skip_no_match'].nil?

  self.multi_match_strategy = attributes[:'multiMatchStrategy'] if attributes[:'multiMatchStrategy']

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

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

  self.null_fill_values = attributes[:'nullFillValues'] if attributes[:'nullFillValues']

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

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

Instance Attribute Details

#is_skip_no_matchBOOLEAN

For the rows for which lookup condition does not satisfy, if set to true - do not return those rows of primary Input source and if set to false - create a row with primary input fields values and lookup field values as NULL.

Returns:

  • (BOOLEAN)


27
28
29
# File 'lib/oci/data_integration/models/lookup.rb', line 27

def is_skip_no_match
  @is_skip_no_match
end

#lookup_conditionOCI::DataIntegration::Models::Expression



23
24
25
# File 'lib/oci/data_integration/models/lookup.rb', line 23

def lookup_condition
  @lookup_condition
end

#multi_match_strategyString

if there are multiple records found in the lookup input what action should be performed. The default value for this field is RETURN_ANY.

Returns:

  • (String)


31
32
33
# File 'lib/oci/data_integration/models/lookup.rb', line 31

def multi_match_strategy
  @multi_match_strategy
end

#null_fill_valuesHash<String, Object>

this map is used for replacing NULL values in the record. Key is the column name and value is the NULL replacement.

Returns:

  • (Hash<String, Object>)


35
36
37
# File 'lib/oci/data_integration/models/lookup.rb', line 35

def null_fill_values
  @null_fill_values
end

Class Method Details

.attribute_mapObject

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



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/oci/data_integration/models/lookup.rb', line 38

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'model_type': :'modelType',
    'key': :'key',
    'model_version': :'modelVersion',
    'parent_ref': :'parentRef',
    'name': :'name',
    'description': :'description',
    'object_version': :'objectVersion',
    'input_ports': :'inputPorts',
    'output_ports': :'outputPorts',
    'object_status': :'objectStatus',
    'identifier': :'identifier',
    'parameters': :'parameters',
    'op_config_values': :'opConfigValues',
    'lookup_condition': :'lookupCondition',
    'is_skip_no_match': :'isSkipNoMatch',
    'multi_match_strategy': :'multiMatchStrategy',
    'null_fill_values': :'nullFillValues'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/oci/data_integration/models/lookup.rb', line 63

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'model_type': :'String',
    'key': :'String',
    'model_version': :'String',
    'parent_ref': :'OCI::DataIntegration::Models::ParentReference',
    'name': :'String',
    'description': :'String',
    'object_version': :'Integer',
    'input_ports': :'Array<OCI::DataIntegration::Models::InputPort>',
    'output_ports': :'Array<OCI::DataIntegration::Models::TypedObject>',
    'object_status': :'Integer',
    'identifier': :'String',
    'parameters': :'Array<OCI::DataIntegration::Models::Parameter>',
    'op_config_values': :'OCI::DataIntegration::Models::ConfigValues',
    'lookup_condition': :'OCI::DataIntegration::Models::Expression',
    'is_skip_no_match': :'BOOLEAN',
    'multi_match_strategy': :'String',
    'null_fill_values': :'Hash<String, Object>'
    # 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



164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# File 'lib/oci/data_integration/models/lookup.rb', line 164

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

  self.class == other.class &&
    model_type == other.model_type &&
    key == other.key &&
    model_version == other.model_version &&
    parent_ref == other.parent_ref &&
    name == other.name &&
    description == other.description &&
    object_version == other.object_version &&
    input_ports == other.input_ports &&
    output_ports == other.output_ports &&
    object_status == other.object_status &&
    identifier == other.identifier &&
    parameters == other.parameters &&
    op_config_values == other.op_config_values &&
    lookup_condition == other.lookup_condition &&
    is_skip_no_match == other.is_skip_no_match &&
    multi_match_strategy == other.multi_match_strategy &&
    null_fill_values == other.null_fill_values
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



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

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


190
191
192
# File 'lib/oci/data_integration/models/lookup.rb', line 190

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



199
200
201
# File 'lib/oci/data_integration/models/lookup.rb', line 199

def hash
  [model_type, key, model_version, parent_ref, name, description, object_version, input_ports, output_ports, object_status, identifier, parameters, op_config_values, lookup_condition, is_skip_no_match, multi_match_strategy, null_fill_values].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



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

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



237
238
239
# File 'lib/oci/data_integration/models/lookup.rb', line 237

def to_s
  to_hash.to_s
end