Class: OCI::DataIntegration::Models::ScopeReference

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

Overview

The ScopeReference class is a base class for any model object that wraps a scope reference to a TypedObject.

Constant Summary collapse

REFERENCE_TYPE_ENUM =
[
  REFERENCE_TYPE_DIRECT_REF = 'DIRECT_REF'.freeze,
  REFERENCE_TYPE_BOUND_ENTITY_SHAPE = 'BOUND_ENTITY_SHAPE'.freeze,
  REFERENCE_TYPE_BOUND_ENTITY_SHAPE_FIELD = 'BOUND_ENTITY_SHAPE_FIELD'.freeze,
  REFERENCE_TYPE_OCI_FUNCTION_INPUT_SHAPE = 'OCI_FUNCTION_INPUT_SHAPE'.freeze,
  REFERENCE_TYPE_OCI_FUNCTION_OUTPUT_SHAPE = 'OCI_FUNCTION_OUTPUT_SHAPE'.freeze,
  REFERENCE_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ScopeReference

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :reference_object (String)

    The value to assign to the #reference_object property

  • :reference_type (String)

    The value to assign to the #reference_type property

  • :ref_object_name (String)

    The value to assign to the #ref_object_name property



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

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

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

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

  self.reference_type = attributes[:'referenceType'] if attributes[:'referenceType']
  self.reference_type = "DIRECT_REF" if reference_type.nil? && !attributes.key?(:'referenceType') # rubocop:disable Style/StringLiterals

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

  self.reference_type = attributes[:'reference_type'] if attributes[:'reference_type']
  self.reference_type = "DIRECT_REF" if reference_type.nil? && !attributes.key?(:'referenceType') && !attributes.key?(:'reference_type') # rubocop:disable Style/StringLiterals

  self.ref_object_name = attributes[:'refObjectName'] if attributes[:'refObjectName']

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

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

Instance Attribute Details

#ref_object_nameString

The referenced object name for this reference. Set to the field name if the referenceType is BOUND_ENTITY_SHAPE_FIELD, else set to null.

Returns:

  • (String)


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

def ref_object_name
  @ref_object_name
end

#reference_objectString

[Required] A key or shallow reference to an object. For direct reference, it points to the actual scope object. For BOUND_ENTITY_SHAPE or BOUND_ENTITY_SHAPE_FIELD, it points to the source or target operator. For OCI_FUNCTION_INPUT_SHAPE or OCI_FUNCTION_OUTPUT_SHAPE, it points to the OCI Function object.

Returns:

  • (String)


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

def reference_object
  @reference_object
end

#reference_typeString

The reference type for this reference. Set to null for a direct reference, for indirect references set to a type of association such as "BOUND_ENTITY_SHAPE". Current known reference type values are "BOUND_ENTITY_SHAPE", "BOUND_ENTITY_SHAPE_FIELD", "OCI_FUNCTION_INPUT_SHAPE", "OCI_FUNCTION_OUTPUT_SHAPE"

Returns:

  • (String)


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

def reference_type
  @reference_type
end

Class Method Details

.attribute_mapObject

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



34
35
36
37
38
39
40
41
42
# File 'lib/oci/data_integration/models/scope_reference.rb', line 34

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'reference_object': :'referenceObject',
    'reference_type': :'referenceType',
    'ref_object_name': :'refObjectName'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



45
46
47
48
49
50
51
52
53
# File 'lib/oci/data_integration/models/scope_reference.rb', line 45

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'reference_object': :'String',
    'reference_type': :'String',
    'ref_object_name': :'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



111
112
113
114
115
116
117
118
# File 'lib/oci/data_integration/models/scope_reference.rb', line 111

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

  self.class == other.class &&
    reference_object == other.reference_object &&
    reference_type == other.reference_type &&
    ref_object_name == other.ref_object_name
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



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

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


123
124
125
# File 'lib/oci/data_integration/models/scope_reference.rb', line 123

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



132
133
134
# File 'lib/oci/data_integration/models/scope_reference.rb', line 132

def hash
  [reference_object, reference_type, ref_object_name].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



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

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



170
171
172
# File 'lib/oci/data_integration/models/scope_reference.rb', line 170

def to_s
  to_hash.to_s
end