Class: OCI::CloudMigrations::Models::CreateMigrationAssetDetails

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

Overview

Details of the new migration asset.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ CreateMigrationAssetDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
131
132
133
134
135
136
137
138
139
140
141
142
# File 'lib/oci/cloud_migrations/models/create_migration_asset_details.rb', line 89

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

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

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

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


29
30
31
# File 'lib/oci/cloud_migrations/models/create_migration_asset_details.rb', line 29

def availability_domain
  @availability_domain
end

#depends_onArray<String>

List of migration assets that depends on this asset.

Returns:

  • (Array<String>)


41
42
43
# File 'lib/oci/cloud_migrations/models/create_migration_asset_details.rb', line 41

def depends_on
  @depends_on
end

#display_nameString

A user-friendly name. If empty, then source asset name will be used. Does not have to be unique, and it's changeable. Avoid entering confidential information.

Returns:

  • (String)


13
14
15
# File 'lib/oci/cloud_migrations/models/create_migration_asset_details.rb', line 13

def display_name
  @display_name
end

#inventory_asset_idString

[Required] OCID of an asset for an inventory.

Returns:

  • (String)


17
18
19
# File 'lib/oci/cloud_migrations/models/create_migration_asset_details.rb', line 17

def inventory_asset_id
  @inventory_asset_id
end

#migration_idString

[Required] OCID of the associated migration.

Returns:

  • (String)


21
22
23
# File 'lib/oci/cloud_migrations/models/create_migration_asset_details.rb', line 21

def migration_id
  @migration_id
end

#replication_compartment_idString

[Required] Replication compartment identifier

Returns:

  • (String)


33
34
35
# File 'lib/oci/cloud_migrations/models/create_migration_asset_details.rb', line 33

def replication_compartment_id
  @replication_compartment_id
end

#replication_schedule_idString

Replication schedule identifier

Returns:

  • (String)


25
26
27
# File 'lib/oci/cloud_migrations/models/create_migration_asset_details.rb', line 25

def replication_schedule_id
  @replication_schedule_id
end

#snap_shot_bucket_nameString

[Required] Name of snapshot bucket

Returns:

  • (String)


37
38
39
# File 'lib/oci/cloud_migrations/models/create_migration_asset_details.rb', line 37

def snap_shot_bucket_name
  @snap_shot_bucket_name
end

Class Method Details

.attribute_mapObject

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



44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/oci/cloud_migrations/models/create_migration_asset_details.rb', line 44

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'display_name': :'displayName',
    'inventory_asset_id': :'inventoryAssetId',
    'migration_id': :'migrationId',
    'replication_schedule_id': :'replicationScheduleId',
    'availability_domain': :'availabilityDomain',
    'replication_compartment_id': :'replicationCompartmentId',
    'snap_shot_bucket_name': :'snapShotBucketName',
    'depends_on': :'dependsOn'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/oci/cloud_migrations/models/create_migration_asset_details.rb', line 60

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'display_name': :'String',
    'inventory_asset_id': :'String',
    'migration_id': :'String',
    'replication_schedule_id': :'String',
    'availability_domain': :'String',
    'replication_compartment_id': :'String',
    'snap_shot_bucket_name': :'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



151
152
153
154
155
156
157
158
159
160
161
162
163
# File 'lib/oci/cloud_migrations/models/create_migration_asset_details.rb', line 151

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

  self.class == other.class &&
    display_name == other.display_name &&
    inventory_asset_id == other.inventory_asset_id &&
    migration_id == other.migration_id &&
    replication_schedule_id == other.replication_schedule_id &&
    availability_domain == other.availability_domain &&
    replication_compartment_id == other.replication_compartment_id &&
    snap_shot_bucket_name == other.snap_shot_bucket_name &&
    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



188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
# File 'lib/oci/cloud_migrations/models/create_migration_asset_details.rb', line 188

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


168
169
170
# File 'lib/oci/cloud_migrations/models/create_migration_asset_details.rb', line 168

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



177
178
179
# File 'lib/oci/cloud_migrations/models/create_migration_asset_details.rb', line 177

def hash
  [display_name, inventory_asset_id, migration_id, replication_schedule_id, availability_domain, replication_compartment_id, snap_shot_bucket_name, depends_on].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



221
222
223
224
225
226
227
228
229
230
# File 'lib/oci/cloud_migrations/models/create_migration_asset_details.rb', line 221

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



215
216
217
# File 'lib/oci/cloud_migrations/models/create_migration_asset_details.rb', line 215

def to_s
  to_hash.to_s
end