Class: OCI::DataIntegration::Models::ConditionalOutputPort

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

Overview

The conditional output port details, used in operators such as split.

Constant Summary collapse

PORT_TYPE_ENUM =
[
  PORT_TYPE_DATA = 'DATA'.freeze,
  PORT_TYPE_CONTROL = 'CONTROL'.freeze,
  PORT_TYPE_MODEL = 'MODEL'.freeze,
  PORT_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Constants inherited from TypedObject

TypedObject::MODEL_TYPE_ENUM

Instance Attribute Summary collapse

Attributes inherited from TypedObject

#config_values, #description, #key, #model_type, #model_version, #name, #object_status, #parent_ref

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from TypedObject

get_subtype

Constructor Details

#initialize(attributes = {}) ⇒ ConditionalOutputPort

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/oci/data_integration/models/conditional_output_port.rb', line 85

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

  attributes['modelType'] = 'CONDITIONAL_OUTPUT_PORT'

  super(attributes)

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

  self.port_type = attributes[:'portType'] if attributes[:'portType']

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

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

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

  self.split_condition = attributes[:'splitCondition'] if attributes[:'splitCondition']

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

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

Instance Attribute Details

#fieldsArray<OCI::DataIntegration::Models::TypedObject>

An array of fields.



26
27
28
# File 'lib/oci/data_integration/models/conditional_output_port.rb', line 26

def fields
  @fields
end

#port_typeString

The port details for the data asset.Type.

Returns:

  • (String)


22
23
24
# File 'lib/oci/data_integration/models/conditional_output_port.rb', line 22

def port_type
  @port_type
end

#split_conditionOCI::DataIntegration::Models::Expression



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

def split_condition
  @split_condition
end

Class Method Details

.attribute_mapObject

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



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/oci/data_integration/models/conditional_output_port.rb', line 32

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'model_type': :'modelType',
    'key': :'key',
    'model_version': :'modelVersion',
    'parent_ref': :'parentRef',
    'config_values': :'configValues',
    'object_status': :'objectStatus',
    'name': :'name',
    'description': :'description',
    'port_type': :'portType',
    'fields': :'fields',
    'split_condition': :'splitCondition'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/oci/data_integration/models/conditional_output_port.rb', line 51

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'model_type': :'String',
    'key': :'String',
    'model_version': :'String',
    'parent_ref': :'OCI::DataIntegration::Models::ParentReference',
    'config_values': :'OCI::DataIntegration::Models::ConfigValues',
    'object_status': :'Integer',
    'name': :'String',
    'description': :'String',
    'port_type': :'String',
    'fields': :'Array<OCI::DataIntegration::Models::TypedObject>',
    'split_condition': :'OCI::DataIntegration::Models::Expression'
    # 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



130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# File 'lib/oci/data_integration/models/conditional_output_port.rb', line 130

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 &&
    config_values == other.config_values &&
    object_status == other.object_status &&
    name == other.name &&
    description == other.description &&
    port_type == other.port_type &&
    fields == other.fields &&
    split_condition == other.split_condition
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



170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# File 'lib/oci/data_integration/models/conditional_output_port.rb', line 170

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


150
151
152
# File 'lib/oci/data_integration/models/conditional_output_port.rb', line 150

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



159
160
161
# File 'lib/oci/data_integration/models/conditional_output_port.rb', line 159

def hash
  [model_type, key, model_version, parent_ref, config_values, object_status, name, description, port_type, fields, split_condition].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



203
204
205
206
207
208
209
210
211
212
# File 'lib/oci/data_integration/models/conditional_output_port.rb', line 203

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



197
198
199
# File 'lib/oci/data_integration/models/conditional_output_port.rb', line 197

def to_s
  to_hash.to_s
end