Class: OCI::DataIntegration::Models::ImportRequest

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

Overview

Import metadata object response.

Constant Summary collapse

STATUS_ENUM =
[
  STATUS_SUCCESSFUL = 'SUCCESSFUL'.freeze,
  STATUS_FAILED = 'FAILED'.freeze,
  STATUS_IN_PROGRESS = 'IN_PROGRESS'.freeze,
  STATUS_TERMINATING = 'TERMINATING'.freeze,
  STATUS_TERMINATED = 'TERMINATED'.freeze,
  STATUS_QUEUED = 'QUEUED'.freeze,
  STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ImportRequest

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
# File 'lib/oci/data_integration/models/import_request.rb', line 155

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

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

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

  self.created_by = attributes[:'createdBy'] if attributes[:'createdBy']

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

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

  self.total_imported_object_count = attributes[:'totalImportedObjectCount'] if attributes[:'totalImportedObjectCount']

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

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

  self.time_started_in_millis = attributes[:'timeStartedInMillis'] if attributes[:'timeStartedInMillis']

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

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

  self.time_ended_in_millis = attributes[:'timeEndedInMillis'] if attributes[:'timeEndedInMillis']

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

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

  self.error_messages = attributes[:'errorMessages'] if attributes[:'errorMessages']

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

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

  self.imported_objects = attributes[:'importedObjects'] if attributes[:'importedObjects']

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

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

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

Instance Attribute Details

#are_data_asset_references_includedBOOLEAN

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

Returns:

  • (BOOLEAN)


48
49
50
# File 'lib/oci/data_integration/models/import_request.rb', line 48

def are_data_asset_references_included
  @are_data_asset_references_included
end

#bucket_nameString

The name of the Object Storage Bucket where the objects will be imported from

Returns:

  • (String)


28
29
30
# File 'lib/oci/data_integration/models/import_request.rb', line 28

def bucket_name
  @bucket_name
end

#created_byString

Name of the user who initiated import request.

Returns:

  • (String)


59
60
61
# File 'lib/oci/data_integration/models/import_request.rb', line 59

def created_by
  @created_by
end

#error_messagesHash<String, String>

Contains key of the error

Returns:

  • (Hash<String, String>)


75
76
77
# File 'lib/oci/data_integration/models/import_request.rb', line 75

def error_messages
  @error_messages
end

#file_nameString

Name of the zip file from which objects will be imported.

Returns:

  • (String)


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

def file_name
  @file_name
end

#import_conflict_resolutionOCI::DataIntegration::Models::ImportConflictResolution



51
52
53
# File 'lib/oci/data_integration/models/import_request.rb', line 51

def import_conflict_resolution
  @import_conflict_resolution
end

#imported_objectsArray<OCI::DataIntegration::Models::ImportObjectMetadataSummary>

The array of imported object details.



79
80
81
# File 'lib/oci/data_integration/models/import_request.rb', line 79

def imported_objects
  @imported_objects
end

#keyString

Import object request key

Returns:

  • (String)


24
25
26
# File 'lib/oci/data_integration/models/import_request.rb', line 24

def key
  @key
end

#nameString

Name of the import request.

Returns:

  • (String)


83
84
85
# File 'lib/oci/data_integration/models/import_request.rb', line 83

def name
  @name
end

#object_key_for_importString

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

Returns:

  • (String)


44
45
46
# File 'lib/oci/data_integration/models/import_request.rb', line 44

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)


40
41
42
# File 'lib/oci/data_integration/models/import_request.rb', line 40

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)


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

def object_storage_tenancy_id
  @object_storage_tenancy_id
end

#statusString

Import Objects request status.

Returns:

  • (String)


55
56
57
# File 'lib/oci/data_integration/models/import_request.rb', line 55

def status
  @status
end

#time_ended_in_millisInteger

Time at which the request was completely processed.

Returns:

  • (Integer)


71
72
73
# File 'lib/oci/data_integration/models/import_request.rb', line 71

def time_ended_in_millis
  @time_ended_in_millis
end

#time_started_in_millisInteger

Time at which the request started getting processed.

Returns:

  • (Integer)


67
68
69
# File 'lib/oci/data_integration/models/import_request.rb', line 67

def time_started_in_millis
  @time_started_in_millis
end

#total_imported_object_countInteger

Number of objects that are imported.

Returns:

  • (Integer)


63
64
65
# File 'lib/oci/data_integration/models/import_request.rb', line 63

def total_imported_object_count
  @total_imported_object_count
end

Class Method Details

.attribute_mapObject

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



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

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'key': :'key',
    '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',
    'status': :'status',
    'created_by': :'createdBy',
    'total_imported_object_count': :'totalImportedObjectCount',
    'time_started_in_millis': :'timeStartedInMillis',
    'time_ended_in_millis': :'timeEndedInMillis',
    'error_messages': :'errorMessages',
    'imported_objects': :'importedObjects',
    'name': :'name'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# File 'lib/oci/data_integration/models/import_request.rb', line 110

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'key': :'String',
    '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',
    'status': :'String',
    'created_by': :'String',
    'total_imported_object_count': :'Integer',
    'time_started_in_millis': :'Integer',
    'time_ended_in_millis': :'Integer',
    'error_messages': :'Hash<String, String>',
    'imported_objects': :'Array<OCI::DataIntegration::Models::ImportObjectMetadataSummary>',
    '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



268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
# File 'lib/oci/data_integration/models/import_request.rb', line 268

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

  self.class == other.class &&
    key == other.key &&
    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 &&
    status == other.status &&
    created_by == other.created_by &&
    total_imported_object_count == other.total_imported_object_count &&
    time_started_in_millis == other.time_started_in_millis &&
    time_ended_in_millis == other.time_ended_in_millis &&
    error_messages == other.error_messages &&
    imported_objects == other.imported_objects &&
    name == other.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



313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
# File 'lib/oci/data_integration/models/import_request.rb', line 313

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


293
294
295
# File 'lib/oci/data_integration/models/import_request.rb', line 293

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



302
303
304
# File 'lib/oci/data_integration/models/import_request.rb', line 302

def hash
  [key, bucket_name, file_name, object_storage_tenancy_id, object_storage_region, object_key_for_import, are_data_asset_references_included, import_conflict_resolution, status, created_by, total_imported_object_count, time_started_in_millis, time_ended_in_millis, error_messages, imported_objects, name].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



346
347
348
349
350
351
352
353
354
355
# File 'lib/oci/data_integration/models/import_request.rb', line 346

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



340
341
342
# File 'lib/oci/data_integration/models/import_request.rb', line 340

def to_s
  to_hash.to_s
end