Method: OCI::ContainerEngine::Models::NodeSourceViaImageOption#initialize

Defined in:
lib/oci/container_engine/models/node_source_via_image_option.rb

#initialize(attributes = {}) ⇒ NodeSourceViaImageOption

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :source_name (String)

    The value to assign to the #source_name proprety

  • :image_id (String)

    The value to assign to the #image_id property



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/oci/container_engine/models/node_source_via_image_option.rb', line 46

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

  attributes['sourceType'] = 'IMAGE'

  super(attributes)

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

  self.image_id = attributes[:'imageId'] if attributes[:'imageId']

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

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