Method: OCI::Core::Models::ComputeInstanceDetails#initialize

Defined in:
lib/oci/core/models/compute_instance_details.rb

#initialize(attributes = {}) ⇒ ComputeInstanceDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/oci/core/models/compute_instance_details.rb', line 52

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

  attributes['instanceType'] = 'compute'

  super(attributes)

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

  self.block_volumes = attributes[:'blockVolumes'] if attributes[:'blockVolumes']

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

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

  self.launch_details = attributes[:'launchDetails'] if attributes[:'launchDetails']

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

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

  self.secondary_vnics = attributes[:'secondaryVnics'] if attributes[:'secondaryVnics']

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

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