Class: OCI::GoldenGate::Models::InitialDataLoad

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/golden_gate/models/initial_data_load.rb

Overview

Options required for the pipeline Initial Data Load. If enabled, copies existing data from source to target before replication.

Constant Summary collapse

IS_INITIAL_LOAD_ENUM =
[
  IS_INITIAL_LOAD_ENABLED = 'ENABLED'.freeze,
  IS_INITIAL_LOAD_DISABLED = 'DISABLED'.freeze,
  IS_INITIAL_LOAD_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
ACTION_ON_EXISTING_TABLE_ENUM =
[
  ACTION_ON_EXISTING_TABLE_TRUNCATE = 'TRUNCATE'.freeze,
  ACTION_ON_EXISTING_TABLE_REPLACE = 'REPLACE'.freeze,
  ACTION_ON_EXISTING_TABLE_APPEND = 'APPEND'.freeze,
  ACTION_ON_EXISTING_TABLE_SKIP = 'SKIP'.freeze,
  ACTION_ON_EXISTING_TABLE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
INITIAL_LOAD_TYPE_ENUM =
[
  INITIAL_LOAD_TYPE_DB_LINK = 'DB_LINK'.freeze,
  INITIAL_LOAD_TYPE_OBJECT_STORAGE = 'OBJECT_STORAGE'.freeze,
  INITIAL_LOAD_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 = {}) ⇒ InitialDataLoad

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# File 'lib/oci/golden_gate/models/initial_data_load.rb', line 119

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.is_initial_load = attributes[:'isInitialLoad'] if attributes[:'isInitialLoad']
  self.is_initial_load = "ENABLED" if is_initial_load.nil? && !attributes.key?(:'isInitialLoad') # rubocop:disable Style/StringLiterals

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

  self.is_initial_load = attributes[:'is_initial_load'] if attributes[:'is_initial_load']
  self.is_initial_load = "ENABLED" if is_initial_load.nil? && !attributes.key?(:'isInitialLoad') && !attributes.key?(:'is_initial_load') # rubocop:disable Style/StringLiterals

  self.action_on_existing_table = attributes[:'actionOnExistingTable'] if attributes[:'actionOnExistingTable']
  self.action_on_existing_table = "REPLACE" if action_on_existing_table.nil? && !attributes.key?(:'actionOnExistingTable') # rubocop:disable Style/StringLiterals

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

  self.action_on_existing_table = attributes[:'action_on_existing_table'] if attributes[:'action_on_existing_table']
  self.action_on_existing_table = "REPLACE" if action_on_existing_table.nil? && !attributes.key?(:'actionOnExistingTable') && !attributes.key?(:'action_on_existing_table') # rubocop:disable Style/StringLiterals

  self.initial_load_type = attributes[:'initialLoadType'] if attributes[:'initialLoadType']
  self.initial_load_type = "DB_LINK" if initial_load_type.nil? && !attributes.key?(:'initialLoadType') # rubocop:disable Style/StringLiterals

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

  self.initial_load_type = attributes[:'initial_load_type'] if attributes[:'initial_load_type']
  self.initial_load_type = "DB_LINK" if initial_load_type.nil? && !attributes.key?(:'initialLoadType') && !attributes.key?(:'initial_load_type') # rubocop:disable Style/StringLiterals

  self.adb_wallet_path = attributes[:'adbWalletPath'] if attributes[:'adbWalletPath']

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

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

  self.source_wallet_path = attributes[:'sourceWalletPath'] if attributes[:'sourceWalletPath']

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

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

  self.target_wallet_path = attributes[:'targetWalletPath'] if attributes[:'targetWalletPath']

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

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

  self.namespace_name = attributes[:'namespaceName'] if attributes[:'namespaceName']

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

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

  self.bucket_name = attributes[:'bucketName'] if attributes[:'bucketName']

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

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

Instance Attribute Details

#action_on_existing_tableString

Action upon existing tables in target when initial Data Load is set i.e., isInitialLoad=true.

Returns:

  • (String)


41
42
43
# File 'lib/oci/golden_gate/models/initial_data_load.rb', line 41

def action_on_existing_table
  @action_on_existing_table
end

#adb_wallet_pathString

Directory path of ADB wallet locally available in Non-ADB target DB. Required for ADB to non-ADB DBLink type initial load only. If not provided the default wallet path "/u01/targetwallet" will be used.

Returns:

  • (String)


51
52
53
# File 'lib/oci/golden_gate/models/initial_data_load.rb', line 51

def adb_wallet_path
  @adb_wallet_path
end

#bucket_nameString

Name of the ObjectStorage bucket. Required only for Objectstorage Initial load.

Returns:

  • (String)


71
72
73
# File 'lib/oci/golden_gate/models/initial_data_load.rb', line 71

def bucket_name
  @bucket_name
end

#initial_load_typeString

Type of Initial load, which can be objectStorage or dbLink.

Returns:

  • (String)


46
47
48
# File 'lib/oci/golden_gate/models/initial_data_load.rb', line 46

def initial_load_type
  @initial_load_type
end

#is_initial_loadString

[Required] If ENABLED, then existing source data is also synchronized to the target when creating or updating the pipeline.

Returns:

  • (String)


36
37
38
# File 'lib/oci/golden_gate/models/initial_data_load.rb', line 36

def is_initial_load
  @is_initial_load
end

#namespace_nameString

Namespace that serves as a container of the ObjectStorage bucket. Required only for Objectstorage Initial load.

Returns:

  • (String)


66
67
68
# File 'lib/oci/golden_gate/models/initial_data_load.rb', line 66

def namespace_name
  @namespace_name
end

#source_wallet_pathString

Directory path of ObjectStorage wallet locally available in Non-ADB source DB. Required for Object Storage type initial load only if source DB is Non-ADB type.

Returns:

  • (String)


56
57
58
# File 'lib/oci/golden_gate/models/initial_data_load.rb', line 56

def source_wallet_path
  @source_wallet_path
end

#target_wallet_pathString

Directory path of ObjectStorage wallet locally available in Non-ADB target DB. Required for Object Storage type initial load only if target DB is Non-ADB type.

Returns:

  • (String)


61
62
63
# File 'lib/oci/golden_gate/models/initial_data_load.rb', line 61

def target_wallet_path
  @target_wallet_path
end

Class Method Details

.attribute_mapObject

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



74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/oci/golden_gate/models/initial_data_load.rb', line 74

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'is_initial_load': :'isInitialLoad',
    'action_on_existing_table': :'actionOnExistingTable',
    'initial_load_type': :'initialLoadType',
    'adb_wallet_path': :'adbWalletPath',
    'source_wallet_path': :'sourceWalletPath',
    'target_wallet_path': :'targetWalletPath',
    'namespace_name': :'namespaceName',
    'bucket_name': :'bucketName'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/oci/golden_gate/models/initial_data_load.rb', line 90

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'is_initial_load': :'String',
    'action_on_existing_table': :'String',
    'initial_load_type': :'String',
    'adb_wallet_path': :'String',
    'source_wallet_path': :'String',
    'target_wallet_path': :'String',
    'namespace_name': :'String',
    'bucket_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



226
227
228
229
230
231
232
233
234
235
236
237
238
# File 'lib/oci/golden_gate/models/initial_data_load.rb', line 226

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

  self.class == other.class &&
    is_initial_load == other.is_initial_load &&
    action_on_existing_table == other.action_on_existing_table &&
    initial_load_type == other.initial_load_type &&
    adb_wallet_path == other.adb_wallet_path &&
    source_wallet_path == other.source_wallet_path &&
    target_wallet_path == other.target_wallet_path &&
    namespace_name == other.namespace_name &&
    bucket_name == other.bucket_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



263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
# File 'lib/oci/golden_gate/models/initial_data_load.rb', line 263

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


243
244
245
# File 'lib/oci/golden_gate/models/initial_data_load.rb', line 243

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



252
253
254
# File 'lib/oci/golden_gate/models/initial_data_load.rb', line 252

def hash
  [is_initial_load, action_on_existing_table, initial_load_type, adb_wallet_path, source_wallet_path, target_wallet_path, namespace_name, bucket_name].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



296
297
298
299
300
301
302
303
304
305
# File 'lib/oci/golden_gate/models/initial_data_load.rb', line 296

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



290
291
292
# File 'lib/oci/golden_gate/models/initial_data_load.rb', line 290

def to_s
  to_hash.to_s
end