Class: OCI::CloudMigrations::Models::MigrationAsset

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/cloud_migrations/models/migration_asset.rb

Overview

Description of the migration asset.

Constant Summary collapse

LIFECYCLE_STATE_ENUM =
[
  LIFECYCLE_STATE_CREATING = 'CREATING'.freeze,
  LIFECYCLE_STATE_UPDATING = 'UPDATING'.freeze,
  LIFECYCLE_STATE_NEEDS_ATTENTION = 'NEEDS_ATTENTION'.freeze,
  LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze,
  LIFECYCLE_STATE_DELETING = 'DELETING'.freeze,
  LIFECYCLE_STATE_DELETED = 'DELETED'.freeze,
  LIFECYCLE_STATE_FAILED = 'FAILED'.freeze,
  LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
NOTIFICATIONS_ENUM =
[
  NOTIFICATIONS_OUT_OF_DATE = 'OUT_OF_DATE'.freeze,
  NOTIFICATIONS_SOURCE_REMOVED = 'SOURCE_REMOVED'.freeze,
  NOTIFICATIONS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ MigrationAsset

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :id (String)

    The value to assign to the #id property

  • :type (String)

    The value to assign to the #type property

  • :display_name (String)

    The value to assign to the #display_name property

  • :compartment_id (String)

    The value to assign to the #compartment_id property

  • :lifecycle_state (String)

    The value to assign to the #lifecycle_state property

  • :lifecycle_details (String)

    The value to assign to the #lifecycle_details property

  • :time_created (DateTime)

    The value to assign to the #time_created property

  • :time_updated (DateTime)

    The value to assign to the #time_updated property

  • :migration_id (String)

    The value to assign to the #migration_id property

  • :snapshots (Hash<String, OCI::CloudMigrations::Models::HydratedVolume>)

    The value to assign to the #snapshots property

  • :parent_snapshot (String)

    The value to assign to the #parent_snapshot property

  • :source_asset_data (Hash<String, Object>)

    The value to assign to the #source_asset_data property

  • :notifications (Array<String>)

    The value to assign to the #notifications property

  • :source_asset_id (String)

    The value to assign to the #source_asset_id property

  • :replication_schedule_id (String)

    The value to assign to the #replication_schedule_id property

  • :availability_domain (String)

    The value to assign to the #availability_domain property

  • :replication_compartment_id (String)

    The value to assign to the #replication_compartment_id property

  • :tenancy_id (String)

    The value to assign to the #tenancy_id property

  • :snap_shot_bucket_name (String)

    The value to assign to the #snap_shot_bucket_name property

  • :depended_on_by (Array<String>)

    The value to assign to the #depended_on_by property

  • :depends_on (Array<String>)

    The value to assign to the #depends_on property



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
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
# File 'lib/oci/cloud_migrations/models/migration_asset.rb', line 202

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

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

  self.display_name = attributes[:'displayName'] if attributes[:'displayName']

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

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

  self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']

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

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

  self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState']

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

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

  self.lifecycle_details = attributes[:'lifecycleDetails'] if attributes[:'lifecycleDetails']

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

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

  self.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated']

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

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

  self.time_updated = attributes[:'timeUpdated'] if attributes[:'timeUpdated']

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

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

  self.migration_id = attributes[:'migrationId'] if attributes[:'migrationId']

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

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

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

  self.parent_snapshot = attributes[:'parentSnapshot'] if attributes[:'parentSnapshot']

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

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

  self.source_asset_data = attributes[:'sourceAssetData'] if attributes[:'sourceAssetData']

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

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

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

  self.source_asset_id = attributes[:'sourceAssetId'] if attributes[:'sourceAssetId']

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

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

  self.replication_schedule_id = attributes[:'replicationScheduleId'] if attributes[:'replicationScheduleId']

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

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

  self.availability_domain = attributes[:'availabilityDomain'] if attributes[:'availabilityDomain']

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

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

  self.replication_compartment_id = attributes[:'replicationCompartmentId'] if attributes[:'replicationCompartmentId']

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

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

  self.tenancy_id = attributes[:'tenancyId'] if attributes[:'tenancyId']

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

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

  self.snap_shot_bucket_name = attributes[:'snapShotBucketName'] if attributes[:'snapShotBucketName']

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

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

  self.depended_on_by = attributes[:'dependedOnBy'] if attributes[:'dependedOnBy']

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

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

  self.depends_on = attributes[:'dependsOn'] if attributes[:'dependsOn']

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

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

Instance Attribute Details

#availability_domainString

[Required] Availability domain

Returns:

  • (String)


95
96
97
# File 'lib/oci/cloud_migrations/models/migration_asset.rb', line 95

def availability_domain
  @availability_domain
end

#compartment_idString

Compartment Identifier

Returns:

  • (String)


43
44
45
# File 'lib/oci/cloud_migrations/models/migration_asset.rb', line 43

def compartment_id
  @compartment_id
end

#depended_on_byArray<String>

List of migration assets that depend on the asset.

Returns:

  • (Array<String>)


111
112
113
# File 'lib/oci/cloud_migrations/models/migration_asset.rb', line 111

def depended_on_by
  @depended_on_by
end

#depends_onArray<String>

List of migration assets that depends on the asset.

Returns:

  • (Array<String>)


115
116
117
# File 'lib/oci/cloud_migrations/models/migration_asset.rb', line 115

def depends_on
  @depends_on
end

#display_nameString

A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.

Returns:

  • (String)


39
40
41
# File 'lib/oci/cloud_migrations/models/migration_asset.rb', line 39

def display_name
  @display_name
end

#idString

[Required] Asset ID generated by mirgration service. It is used in the mirgration service pipeline.

Returns:

  • (String)


31
32
33
# File 'lib/oci/cloud_migrations/models/migration_asset.rb', line 31

def id
  @id
end

#lifecycle_detailsString

A message describing the current state in more detail. For example, it can be used to provide actionable information for a resource in Failed state.

Returns:

  • (String)


51
52
53
# File 'lib/oci/cloud_migrations/models/migration_asset.rb', line 51

def lifecycle_details
  @lifecycle_details
end

#lifecycle_stateString

[Required] The current state of the migration asset.

Returns:

  • (String)


47
48
49
# File 'lib/oci/cloud_migrations/models/migration_asset.rb', line 47

def lifecycle_state
  @lifecycle_state
end

#migration_idString

[Required] OCID of the associated migration.

Returns:

  • (String)


63
64
65
# File 'lib/oci/cloud_migrations/models/migration_asset.rb', line 63

def migration_id
  @migration_id
end

#notificationsArray<String>

List of notifications

Returns:

  • (Array<String>)


83
84
85
# File 'lib/oci/cloud_migrations/models/migration_asset.rb', line 83

def notifications
  @notifications
end

#parent_snapshotString

The parent snapshot of the migration asset to be used by the replication task.

Returns:

  • (String)


73
74
75
# File 'lib/oci/cloud_migrations/models/migration_asset.rb', line 73

def parent_snapshot
  @parent_snapshot
end

#replication_compartment_idString

[Required] Replication compartment identifier

Returns:

  • (String)


99
100
101
# File 'lib/oci/cloud_migrations/models/migration_asset.rb', line 99

def replication_compartment_id
  @replication_compartment_id
end

#replication_schedule_idString

Replication schedule identifier

Returns:

  • (String)


91
92
93
# File 'lib/oci/cloud_migrations/models/migration_asset.rb', line 91

def replication_schedule_id
  @replication_schedule_id
end

#snap_shot_bucket_nameString

[Required] Name of snapshot bucket

Returns:

  • (String)


107
108
109
# File 'lib/oci/cloud_migrations/models/migration_asset.rb', line 107

def snap_shot_bucket_name
  @snap_shot_bucket_name
end

#snapshotsHash<String, OCI::CloudMigrations::Models::HydratedVolume>

Key-value pair representing disks ID mapped to the OCIDs of replicated or hydration server volume snapshots. Example: {\"bar-key\": \"value\"}



69
70
71
# File 'lib/oci/cloud_migrations/models/migration_asset.rb', line 69

def snapshots
  @snapshots
end

#source_asset_dataHash<String, Object>

Key-value pair representing asset metadata keys and values scoped to a namespace. Example: {\"bar-key\": \"value\"}

Returns:

  • (Hash<String, Object>)


79
80
81
# File 'lib/oci/cloud_migrations/models/migration_asset.rb', line 79

def source_asset_data
  @source_asset_data
end

#source_asset_idString

OCID that is referenced to an asset for an inventory.

Returns:

  • (String)


87
88
89
# File 'lib/oci/cloud_migrations/models/migration_asset.rb', line 87

def source_asset_id
  @source_asset_id
end

#tenancy_idString

Tenancy identifier

Returns:

  • (String)


103
104
105
# File 'lib/oci/cloud_migrations/models/migration_asset.rb', line 103

def tenancy_id
  @tenancy_id
end

#time_createdDateTime

[Required] The time when the migration asset was created. An RFC3339 formatted datetime string.

Returns:

  • (DateTime)


55
56
57
# File 'lib/oci/cloud_migrations/models/migration_asset.rb', line 55

def time_created
  @time_created
end

#time_updatedDateTime

The time when the migration asset was updated. An RFC3339 formatted datetime string.

Returns:

  • (DateTime)


59
60
61
# File 'lib/oci/cloud_migrations/models/migration_asset.rb', line 59

def time_updated
  @time_updated
end

#typeString

[Required] The type of asset referenced for inventory.

Returns:

  • (String)


35
36
37
# File 'lib/oci/cloud_migrations/models/migration_asset.rb', line 35

def type
  @type
end

Class Method Details

.attribute_mapObject

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



118
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
# File 'lib/oci/cloud_migrations/models/migration_asset.rb', line 118

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'type': :'type',
    'display_name': :'displayName',
    'compartment_id': :'compartmentId',
    'lifecycle_state': :'lifecycleState',
    'lifecycle_details': :'lifecycleDetails',
    'time_created': :'timeCreated',
    'time_updated': :'timeUpdated',
    'migration_id': :'migrationId',
    'snapshots': :'snapshots',
    'parent_snapshot': :'parentSnapshot',
    'source_asset_data': :'sourceAssetData',
    'notifications': :'notifications',
    'source_asset_id': :'sourceAssetId',
    'replication_schedule_id': :'replicationScheduleId',
    'availability_domain': :'availabilityDomain',
    'replication_compartment_id': :'replicationCompartmentId',
    'tenancy_id': :'tenancyId',
    'snap_shot_bucket_name': :'snapShotBucketName',
    'depended_on_by': :'dependedOnBy',
    'depends_on': :'dependsOn'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



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
# File 'lib/oci/cloud_migrations/models/migration_asset.rb', line 147

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'type': :'String',
    'display_name': :'String',
    'compartment_id': :'String',
    'lifecycle_state': :'String',
    'lifecycle_details': :'String',
    'time_created': :'DateTime',
    'time_updated': :'DateTime',
    'migration_id': :'String',
    'snapshots': :'Hash<String, OCI::CloudMigrations::Models::HydratedVolume>',
    'parent_snapshot': :'String',
    'source_asset_data': :'Hash<String, Object>',
    'notifications': :'Array<String>',
    'source_asset_id': :'String',
    'replication_schedule_id': :'String',
    'availability_domain': :'String',
    'replication_compartment_id': :'String',
    'tenancy_id': :'String',
    'snap_shot_bucket_name': :'String',
    'depended_on_by': :'Array<String>',
    'depends_on': :'Array<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



359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
# File 'lib/oci/cloud_migrations/models/migration_asset.rb', line 359

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

  self.class == other.class &&
    id == other.id &&
    type == other.type &&
    display_name == other.display_name &&
    compartment_id == other.compartment_id &&
    lifecycle_state == other.lifecycle_state &&
    lifecycle_details == other.lifecycle_details &&
    time_created == other.time_created &&
    time_updated == other.time_updated &&
    migration_id == other.migration_id &&
    snapshots == other.snapshots &&
    parent_snapshot == other.parent_snapshot &&
    source_asset_data == other.source_asset_data &&
    notifications == other.notifications &&
    source_asset_id == other.source_asset_id &&
    replication_schedule_id == other.replication_schedule_id &&
    availability_domain == other.availability_domain &&
    replication_compartment_id == other.replication_compartment_id &&
    tenancy_id == other.tenancy_id &&
    snap_shot_bucket_name == other.snap_shot_bucket_name &&
    depended_on_by == other.depended_on_by &&
    depends_on == other.depends_on
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



409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
# File 'lib/oci/cloud_migrations/models/migration_asset.rb', line 409

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


389
390
391
# File 'lib/oci/cloud_migrations/models/migration_asset.rb', line 389

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



398
399
400
# File 'lib/oci/cloud_migrations/models/migration_asset.rb', line 398

def hash
  [id, type, display_name, compartment_id, lifecycle_state, lifecycle_details, time_created, time_updated, migration_id, snapshots, parent_snapshot, source_asset_data, notifications, source_asset_id, replication_schedule_id, availability_domain, replication_compartment_id, tenancy_id, snap_shot_bucket_name, depended_on_by, depends_on].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



442
443
444
445
446
447
448
449
450
451
# File 'lib/oci/cloud_migrations/models/migration_asset.rb', line 442

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



436
437
438
# File 'lib/oci/cloud_migrations/models/migration_asset.rb', line 436

def to_s
  to_hash.to_s
end