Class: OCI::DataIntegration::Models::CreateImportRequestDetails

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

Overview

Details of import object.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ CreateImportRequestDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



81
82
83
84
85
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# File 'lib/oci/data_integration/models/create_import_request_details.rb', line 81

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.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']

  self.file_name = attributes[:'fileName'] if attributes[:'fileName']

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

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

  self.object_storage_tenancy_id = attributes[:'objectStorageTenancyId'] if attributes[:'objectStorageTenancyId']

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

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

  self.object_storage_region = attributes[:'objectStorageRegion'] if attributes[:'objectStorageRegion']

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

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

  self.object_key_for_import = attributes[:'objectKeyForImport'] if attributes[:'objectKeyForImport']

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

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

  self.are_data_asset_references_included = attributes[:'areDataAssetReferencesIncluded'] unless attributes[:'areDataAssetReferencesIncluded'].nil?
  self.are_data_asset_references_included = true if are_data_asset_references_included.nil? && !attributes.key?(:'areDataAssetReferencesIncluded') # rubocop:disable Style/StringLiterals

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

  self.are_data_asset_references_included = attributes[:'are_data_asset_references_included'] unless attributes[:'are_data_asset_references_included'].nil?
  self.are_data_asset_references_included = true if are_data_asset_references_included.nil? && !attributes.key?(:'areDataAssetReferencesIncluded') && !attributes.key?(:'are_data_asset_references_included') # rubocop:disable Style/StringLiterals

  self.import_conflict_resolution = attributes[:'importConflictResolution'] if attributes[:'importConflictResolution']

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

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

Instance Attribute Details

#are_data_asset_references_includedBOOLEAN

This field controls if the data asset references will be included during import.

Returns:

  • (BOOLEAN)


33
34
35
# File 'lib/oci/data_integration/models/create_import_request_details.rb', line 33

def are_data_asset_references_included
  @are_data_asset_references_included
end

#bucket_nameString

[Required] Name of the Object Storage bucket where the object will be imported from.

Returns:

  • (String)


13
14
15
# File 'lib/oci/data_integration/models/create_import_request_details.rb', line 13

def bucket_name
  @bucket_name
end

#file_nameString

[Required] Name of the zip file to be imported.

Returns:

  • (String)


17
18
19
# File 'lib/oci/data_integration/models/create_import_request_details.rb', line 17

def file_name
  @file_name
end

#import_conflict_resolutionOCI::DataIntegration::Models::ImportConflictResolution



36
37
38
# File 'lib/oci/data_integration/models/create_import_request_details.rb', line 36

def import_conflict_resolution
  @import_conflict_resolution
end

#object_key_for_importString

Key of the object inside which all the objects will be imported

Returns:

  • (String)


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

def object_key_for_import
  @object_key_for_import
end

#object_storage_regionString

Region of the object storage (if using object storage of different region)

Returns:

  • (String)


25
26
27
# File 'lib/oci/data_integration/models/create_import_request_details.rb', line 25

def object_storage_region
  @object_storage_region
end

#object_storage_tenancy_idString

Optional parameter to point to object storage tenancy (if using Object Storage of different tenancy)

Returns:

  • (String)


21
22
23
# File 'lib/oci/data_integration/models/create_import_request_details.rb', line 21

def object_storage_tenancy_id
  @object_storage_tenancy_id
end

Class Method Details

.attribute_mapObject

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



39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/oci/data_integration/models/create_import_request_details.rb', line 39

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'bucket_name': :'bucketName',
    'file_name': :'fileName',
    'object_storage_tenancy_id': :'objectStorageTenancyId',
    'object_storage_region': :'objectStorageRegion',
    'object_key_for_import': :'objectKeyForImport',
    'are_data_asset_references_included': :'areDataAssetReferencesIncluded',
    'import_conflict_resolution': :'importConflictResolution'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



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

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'bucket_name': :'String',
    'file_name': :'String',
    'object_storage_tenancy_id': :'String',
    'object_storage_region': :'String',
    'object_key_for_import': :'String',
    'are_data_asset_references_included': :'BOOLEAN',
    'import_conflict_resolution': :'OCI::DataIntegration::Models::ImportConflictResolution'
    # 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



139
140
141
142
143
144
145
146
147
148
149
150
# File 'lib/oci/data_integration/models/create_import_request_details.rb', line 139

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

  self.class == other.class &&
    bucket_name == other.bucket_name &&
    file_name == other.file_name &&
    object_storage_tenancy_id == other.object_storage_tenancy_id &&
    object_storage_region == other.object_storage_region &&
    object_key_for_import == other.object_key_for_import &&
    are_data_asset_references_included == other.are_data_asset_references_included &&
    import_conflict_resolution == other.import_conflict_resolution
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



175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
# File 'lib/oci/data_integration/models/create_import_request_details.rb', line 175

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


155
156
157
# File 'lib/oci/data_integration/models/create_import_request_details.rb', line 155

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



164
165
166
# File 'lib/oci/data_integration/models/create_import_request_details.rb', line 164

def hash
  [bucket_name, file_name, object_storage_tenancy_id, object_storage_region, object_key_for_import, are_data_asset_references_included, import_conflict_resolution].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



208
209
210
211
212
213
214
215
216
217
# File 'lib/oci/data_integration/models/create_import_request_details.rb', line 208

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



202
203
204
# File 'lib/oci/data_integration/models/create_import_request_details.rb', line 202

def to_s
  to_hash.to_s
end