Class: OCI::CloudMigrations::Models::VmTargetEnvironment

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

Overview

Description of the VM target environment.

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 = {}) ⇒ VmTargetEnvironment

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :target_compartment_id (String)

    The value to assign to the #target_compartment_id proprety

  • :availability_domain (String)

    The value to assign to the #availability_domain property

  • :fault_domain (String)

    The value to assign to the #fault_domain property

  • :vcn (String)

    The value to assign to the #vcn property

  • :subnet (String)

    The value to assign to the #subnet property

  • :dedicated_vm_host (String)

    The value to assign to the #dedicated_vm_host property

  • :ms_license (String)

    The value to assign to the #ms_license property

  • :preferred_shape_type (String)

    The value to assign to the #preferred_shape_type property



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

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

  attributes['targetEnvironmentType'] = 'VM_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.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.fault_domain = attributes[:'faultDomain'] if attributes[:'faultDomain']

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

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

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

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

  self.dedicated_vm_host = attributes[:'dedicatedVmHost'] if attributes[:'dedicatedVmHost']

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

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

  self.ms_license = attributes[:'msLicense'] if attributes[:'msLicense']

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

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

  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

#availability_domainString

Availability Domain of the VM configuration.

Returns:

  • (String)


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

def availability_domain
  @availability_domain
end

#dedicated_vm_hostString

OCID of the dedicated VM configuration host.

Returns:

  • (String)


30
31
32
# File 'lib/oci/cloud_migrations/models/vm_target_environment.rb', line 30

def dedicated_vm_host
  @dedicated_vm_host
end

#fault_domainString

Fault domain of the VM configuration.

Returns:

  • (String)


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

def fault_domain
  @fault_domain
end

#ms_licenseString

Microsoft license for the VM configuration.

Returns:

  • (String)


34
35
36
# File 'lib/oci/cloud_migrations/models/vm_target_environment.rb', line 34

def ms_license
  @ms_license
end

#preferred_shape_typeString

Preferred VM shape type provided by the customer.

Returns:

  • (String)


38
39
40
# File 'lib/oci/cloud_migrations/models/vm_target_environment.rb', line 38

def preferred_shape_type
  @preferred_shape_type
end

#subnetString

[Required] OCID of the VM configuration subnet.

Returns:

  • (String)


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

def subnet
  @subnet
end

#vcnString

[Required] OCID of the VM configuration VCN.

Returns:

  • (String)


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

def vcn
  @vcn
end

Class Method Details

.attribute_mapObject

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



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

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'target_compartment_id': :'targetCompartmentId',
    'target_environment_type': :'targetEnvironmentType',
    'availability_domain': :'availabilityDomain',
    'fault_domain': :'faultDomain',
    'vcn': :'vcn',
    'subnet': :'subnet',
    'dedicated_vm_host': :'dedicatedVmHost',
    'ms_license': :'msLicense',
    'preferred_shape_type': :'preferredShapeType'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



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

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'target_compartment_id': :'String',
    'target_environment_type': :'String',
    'availability_domain': :'String',
    'fault_domain': :'String',
    'vcn': :'String',
    'subnet': :'String',
    'dedicated_vm_host': :'String',
    'ms_license': :'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



140
141
142
143
144
145
146
147
148
149
150
151
152
153
# File 'lib/oci/cloud_migrations/models/vm_target_environment.rb', line 140

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 &&
    availability_domain == other.availability_domain &&
    fault_domain == other.fault_domain &&
    vcn == other.vcn &&
    subnet == other.subnet &&
    dedicated_vm_host == other.dedicated_vm_host &&
    ms_license == other.ms_license &&
    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



178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
# File 'lib/oci/cloud_migrations/models/vm_target_environment.rb', line 178

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


158
159
160
# File 'lib/oci/cloud_migrations/models/vm_target_environment.rb', line 158

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



167
168
169
# File 'lib/oci/cloud_migrations/models/vm_target_environment.rb', line 167

def hash
  [target_compartment_id, target_environment_type, availability_domain, fault_domain, vcn, subnet, dedicated_vm_host, ms_license, 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



211
212
213
214
215
216
217
218
219
220
# File 'lib/oci/cloud_migrations/models/vm_target_environment.rb', line 211

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



205
206
207
# File 'lib/oci/cloud_migrations/models/vm_target_environment.rb', line 205

def to_s
  to_hash.to_s
end