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):



74
75
76
77
78
79
80
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
# File 'lib/oci/data_integration/models/create_import_request_details.rb', line 74

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

#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



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

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.



35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/oci/data_integration/models/create_import_request_details.rb', line 35

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',
    'import_conflict_resolution': :'importConflictResolution'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/oci/data_integration/models/create_import_request_details.rb', line 49

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',
    '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



124
125
126
127
128
129
130
131
132
133
134
# File 'lib/oci/data_integration/models/create_import_request_details.rb', line 124

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 &&
    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



159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# File 'lib/oci/data_integration/models/create_import_request_details.rb', line 159

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


139
140
141
# File 'lib/oci/data_integration/models/create_import_request_details.rb', line 139

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



148
149
150
# File 'lib/oci/data_integration/models/create_import_request_details.rb', line 148

def hash
  [bucket_name, file_name, object_storage_tenancy_id, object_storage_region, object_key_for_import, 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



192
193
194
195
196
197
198
199
200
201
# File 'lib/oci/data_integration/models/create_import_request_details.rb', line 192

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



186
187
188
# File 'lib/oci/data_integration/models/create_import_request_details.rb', line 186

def to_s
  to_hash.to_s
end