Class: OCI::CloudMigrations::Models::TargetAssetSummary

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

Overview

Summary of the target asset. This class has direct subclasses. If you are using this class as input to a service operations then you should favor using a subclass over the base class

Direct Known Subclasses

VmTargetAssetSummary

Constant Summary collapse

TYPE_ENUM =
[
  TYPE_INSTANCE = 'INSTANCE'.freeze,
  TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ TargetAssetSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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/cloud_migrations/models/target_asset_summary.rb', line 159

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

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

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

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

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

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

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

  self.is_excluded_from_execution = attributes[:'isExcludedFromExecution'] unless attributes[:'isExcludedFromExecution'].nil?

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

  self.is_excluded_from_execution = attributes[:'is_excluded_from_execution'] unless attributes[:'is_excluded_from_execution'].nil?

  self.compatibility_messages = attributes[:'compatibilityMessages'] if attributes[:'compatibilityMessages']

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

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

  self.estimated_cost = attributes[:'estimatedCost'] if attributes[:'estimatedCost']

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

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

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

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

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

  self.migration_asset = attributes[:'migrationAsset'] if attributes[:'migrationAsset']

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

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

Instance Attribute Details

#compartment_idString

Compartment identifier

Returns:

  • (String)


36
37
38
# File 'lib/oci/cloud_migrations/models/target_asset_summary.rb', line 36

def compartment_id
  @compartment_id
end

#compatibility_messagesArray<OCI::CloudMigrations::Models::CompatibilityMessage>

Messages about compatibility issues.



52
53
54
# File 'lib/oci/cloud_migrations/models/target_asset_summary.rb', line 52

def compatibility_messages
  @compatibility_messages
end

#created_resource_idString

Created resource identifier

Returns:

  • (String)


40
41
42
# File 'lib/oci/cloud_migrations/models/target_asset_summary.rb', line 40

def created_resource_id
  @created_resource_id
end

#display_nameString

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

Returns:

  • (String)


24
25
26
# File 'lib/oci/cloud_migrations/models/target_asset_summary.rb', line 24

def display_name
  @display_name
end

#estimated_costOCI::CloudMigrations::Models::CostEstimation

This attribute is required.



56
57
58
# File 'lib/oci/cloud_migrations/models/target_asset_summary.rb', line 56

def estimated_cost
  @estimated_cost
end

#idString

[Required] Unique identifier that is immutable on creation.

Returns:

  • (String)


20
21
22
# File 'lib/oci/cloud_migrations/models/target_asset_summary.rb', line 20

def id
  @id
end

#is_excluded_from_executionBOOLEAN

[Required] A boolean indicating whether the asset should be migrated.

Returns:

  • (BOOLEAN)


48
49
50
# File 'lib/oci/cloud_migrations/models/target_asset_summary.rb', line 48

def is_excluded_from_execution
  @is_excluded_from_execution
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)


64
65
66
# File 'lib/oci/cloud_migrations/models/target_asset_summary.rb', line 64

def lifecycle_details
  @lifecycle_details
end

#lifecycle_stateString

[Required] The current state of the target asset.

Returns:

  • (String)


28
29
30
# File 'lib/oci/cloud_migrations/models/target_asset_summary.rb', line 28

def lifecycle_state
  @lifecycle_state
end

#migration_assetOCI::CloudMigrations::Models::MigrationAssetSummary



75
76
77
# File 'lib/oci/cloud_migrations/models/target_asset_summary.rb', line 75

def migration_asset
  @migration_asset
end

#migration_plan_idString

[Required] OCID of the associated migration plan.

Returns:

  • (String)


32
33
34
# File 'lib/oci/cloud_migrations/models/target_asset_summary.rb', line 32

def migration_plan_id
  @migration_plan_id
end

#time_assessedDateTime

[Required] The time when the assessment was done. An RFC3339 formatted datetime string.

Returns:

  • (DateTime)


72
73
74
# File 'lib/oci/cloud_migrations/models/target_asset_summary.rb', line 72

def time_assessed
  @time_assessed
end

#time_createdDateTime

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

Returns:

  • (DateTime)


60
61
62
# File 'lib/oci/cloud_migrations/models/target_asset_summary.rb', line 60

def time_created
  @time_created
end

#time_updatedDateTime

[Required] The time when the target asset was updated. An RFC3339 formatted datetime string.

Returns:

  • (DateTime)


68
69
70
# File 'lib/oci/cloud_migrations/models/target_asset_summary.rb', line 68

def time_updated
  @time_updated
end

#typeString

[Required] The type of target asset.

Returns:

  • (String)


44
45
46
# File 'lib/oci/cloud_migrations/models/target_asset_summary.rb', line 44

def type
  @type
end

Class Method Details

.attribute_mapObject

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



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/oci/cloud_migrations/models/target_asset_summary.rb', line 78

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'display_name': :'displayName',
    'lifecycle_state': :'lifecycleState',
    'migration_plan_id': :'migrationPlanId',
    'compartment_id': :'compartmentId',
    'created_resource_id': :'createdResourceId',
    'type': :'type',
    'is_excluded_from_execution': :'isExcludedFromExecution',
    'compatibility_messages': :'compatibilityMessages',
    'estimated_cost': :'estimatedCost',
    'time_created': :'timeCreated',
    'lifecycle_details': :'lifecycleDetails',
    'time_updated': :'timeUpdated',
    'time_assessed': :'timeAssessed',
    'migration_asset': :'migrationAsset'
    # rubocop:enable Style/SymbolLiteral
  }
end

.get_subtype(object_hash) ⇒ Object

Given the hash representation of a subtype of this class, use the info in the hash to return the class of the subtype.



128
129
130
131
132
133
134
135
# File 'lib/oci/cloud_migrations/models/target_asset_summary.rb', line 128

def self.get_subtype(object_hash)
  type = object_hash[:'type'] # rubocop:disable Style/SymbolLiteral

  return 'OCI::CloudMigrations::Models::VmTargetAssetSummary' if type == 'INSTANCE'

  # TODO: Log a warning when the subtype is not found.
  'OCI::CloudMigrations::Models::TargetAssetSummary'
end

.swagger_typesObject

Attribute type mapping.



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/oci/cloud_migrations/models/target_asset_summary.rb', line 101

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'display_name': :'String',
    'lifecycle_state': :'String',
    'migration_plan_id': :'String',
    'compartment_id': :'String',
    'created_resource_id': :'String',
    'type': :'String',
    'is_excluded_from_execution': :'BOOLEAN',
    'compatibility_messages': :'Array<OCI::CloudMigrations::Models::CompatibilityMessage>',
    'estimated_cost': :'OCI::CloudMigrations::Models::CostEstimation',
    'time_created': :'DateTime',
    'lifecycle_details': :'String',
    'time_updated': :'DateTime',
    'time_assessed': :'DateTime',
    'migration_asset': :'OCI::CloudMigrations::Models::MigrationAssetSummary'
    # 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
# File 'lib/oci/cloud_migrations/models/target_asset_summary.rb', line 268

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

  self.class == other.class &&
    id == other.id &&
    display_name == other.display_name &&
    lifecycle_state == other.lifecycle_state &&
    migration_plan_id == other.migration_plan_id &&
    compartment_id == other.compartment_id &&
    created_resource_id == other.created_resource_id &&
    type == other.type &&
    is_excluded_from_execution == other.is_excluded_from_execution &&
    compatibility_messages == other.compatibility_messages &&
    estimated_cost == other.estimated_cost &&
    time_created == other.time_created &&
    lifecycle_details == other.lifecycle_details &&
    time_updated == other.time_updated &&
    time_assessed == other.time_assessed &&
    migration_asset == other.migration_asset
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



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

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


292
293
294
# File 'lib/oci/cloud_migrations/models/target_asset_summary.rb', line 292

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



301
302
303
# File 'lib/oci/cloud_migrations/models/target_asset_summary.rb', line 301

def hash
  [id, display_name, lifecycle_state, migration_plan_id, compartment_id, created_resource_id, type, is_excluded_from_execution, compatibility_messages, estimated_cost, time_created, lifecycle_details, time_updated, time_assessed, migration_asset].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



345
346
347
348
349
350
351
352
353
354
# File 'lib/oci/cloud_migrations/models/target_asset_summary.rb', line 345

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



339
340
341
# File 'lib/oci/cloud_migrations/models/target_asset_summary.rb', line 339

def to_s
  to_hash.to_s
end