Class: OCI::CloudMigrations::Models::OlvmTargetEnvironment

Inherits:
TargetEnvironment show all
Defined in:
lib/oci/cloud_migrations/models/olvm_target_environment.rb

Overview

OLVM target enviroment

Constant Summary

Constants inherited from TargetEnvironment

TargetEnvironment::TARGET_ENVIRONMENT_TYPE_ENUM

Instance Attribute Summary collapse

Attributes inherited from TargetEnvironment

#target_compartment_id, #target_environment_type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from TargetEnvironment

get_subtype

Constructor Details

#initialize(attributes = {}) ⇒ OlvmTargetEnvironment

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



67
68
69
70
71
72
73
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
# File 'lib/oci/cloud_migrations/models/olvm_target_environment.rb', line 67

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  attributes['targetEnvironmentType'] = 'OLVM_TARGET_ENV'

  super(attributes)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  self.cluster_asset_id = attributes[:'clusterAssetId'] if attributes[:'clusterAssetId']

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

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

  self.vnic_profile_asset_id = attributes[:'vnicProfileAssetId'] if attributes[:'vnicProfileAssetId']

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

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

  self.olvm_templates = attributes[:'olvmTemplates'] if attributes[:'olvmTemplates']

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

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

  self.preferred_shape_type = attributes[:'preferredShapeType'] if attributes[:'preferredShapeType']

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

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

Instance Attribute Details

#cluster_asset_idString

[Required] Inventory asset id of the olvm cluster

Returns:

  • (String)


14
15
16
# File 'lib/oci/cloud_migrations/models/olvm_target_environment.rb', line 14

def cluster_asset_id
  @cluster_asset_id
end

#olvm_templatesHash<String, String>

OLVM OS type to inventory asset id of the template

Returns:

  • (Hash<String, String>)


22
23
24
# File 'lib/oci/cloud_migrations/models/olvm_target_environment.rb', line 22

def olvm_templates
  @olvm_templates
end

#preferred_shape_typeString

Preferred VM shape type provided by the customer.

Returns:

  • (String)


26
27
28
# File 'lib/oci/cloud_migrations/models/olvm_target_environment.rb', line 26

def preferred_shape_type
  @preferred_shape_type
end

#vnic_profile_asset_idString

[Required] Inventory asset Id of the vnic profile

Returns:

  • (String)


18
19
20
# File 'lib/oci/cloud_migrations/models/olvm_target_environment.rb', line 18

def vnic_profile_asset_id
  @vnic_profile_asset_id
end

Class Method Details

.attribute_mapObject

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



29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/oci/cloud_migrations/models/olvm_target_environment.rb', line 29

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'target_compartment_id': :'targetCompartmentId',
    'target_environment_type': :'targetEnvironmentType',
    'cluster_asset_id': :'clusterAssetId',
    'vnic_profile_asset_id': :'vnicProfileAssetId',
    'olvm_templates': :'olvmTemplates',
    'preferred_shape_type': :'preferredShapeType'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/oci/cloud_migrations/models/olvm_target_environment.rb', line 43

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'target_compartment_id': :'String',
    'target_environment_type': :'String',
    'cluster_asset_id': :'String',
    'vnic_profile_asset_id': :'String',
    'olvm_templates': :'Hash<String, String>',
    'preferred_shape_type': :'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



109
110
111
112
113
114
115
116
117
118
119
# File 'lib/oci/cloud_migrations/models/olvm_target_environment.rb', line 109

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

  self.class == other.class &&
    target_compartment_id == other.target_compartment_id &&
    target_environment_type == other.target_environment_type &&
    cluster_asset_id == other.cluster_asset_id &&
    vnic_profile_asset_id == other.vnic_profile_asset_id &&
    olvm_templates == other.olvm_templates &&
    preferred_shape_type == other.preferred_shape_type
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



144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# File 'lib/oci/cloud_migrations/models/olvm_target_environment.rb', line 144

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


124
125
126
# File 'lib/oci/cloud_migrations/models/olvm_target_environment.rb', line 124

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



133
134
135
# File 'lib/oci/cloud_migrations/models/olvm_target_environment.rb', line 133

def hash
  [target_compartment_id, target_environment_type, cluster_asset_id, vnic_profile_asset_id, olvm_templates, preferred_shape_type].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



177
178
179
180
181
182
183
184
185
186
# File 'lib/oci/cloud_migrations/models/olvm_target_environment.rb', line 177

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



171
172
173
# File 'lib/oci/cloud_migrations/models/olvm_target_environment.rb', line 171

def to_s
  to_hash.to_s
end