Class: Azure::ARM::Compute::Models::VirtualMachineImageProperties
- Inherits:
-
Object
- Object
- Azure::ARM::Compute::Models::VirtualMachineImageProperties
- Includes:
- MsRestAzure
- Defined in:
- lib/azure_mgmt_compute/models/virtual_machine_image_properties.rb
Overview
Describes the properties of a Virtual Machine Image.
Instance Attribute Summary collapse
Class Method Summary collapse
-
.deserialize_object(object) ⇒ VirtualMachineImageProperties
Deserializes given Ruby Hash into Model object.
-
.serialize_object(object) ⇒ Hash
Serializes given Model object into Ruby Hash.
Instance Method Summary collapse
-
#validate ⇒ Object
Validate the object.
Instance Attribute Details
#data_disk_images ⇒ Array<DataDiskImage>
22 23 24 |
# File 'lib/azure_mgmt_compute/models/virtual_machine_image_properties.rb', line 22 def data_disk_images @data_disk_images end |
#os_disk_image ⇒ OSDiskImage
19 20 21 |
# File 'lib/azure_mgmt_compute/models/virtual_machine_image_properties.rb', line 19 def os_disk_image @os_disk_image end |
#plan ⇒ PurchasePlan
16 17 18 |
# File 'lib/azure_mgmt_compute/models/virtual_machine_image_properties.rb', line 16 def plan @plan end |
Class Method Details
.deserialize_object(object) ⇒ VirtualMachineImageProperties
Deserializes given Ruby Hash into Model object.
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 101 102 103 104 105 106 107 |
# File 'lib/azure_mgmt_compute/models/virtual_machine_image_properties.rb', line 75 def self.deserialize_object(object) return if object.nil? output_object = VirtualMachineImageProperties.new deserialized_property = object['plan'] unless deserialized_property.nil? deserialized_property = PurchasePlan.deserialize_object(deserialized_property) end output_object.plan = deserialized_property deserialized_property = object['osDiskImage'] unless deserialized_property.nil? deserialized_property = OSDiskImage.deserialize_object(deserialized_property) end output_object.os_disk_image = deserialized_property deserialized_property = object['dataDiskImages'] unless deserialized_property.nil? deserializedArray = []; deserialized_property.each do |element1| unless element1.nil? element1 = DataDiskImage.deserialize_object(element1) end deserializedArray.push(element1); end deserialized_property = deserializedArray; end output_object.data_disk_images = deserialized_property output_object.validate output_object end |
.serialize_object(object) ⇒ Hash
Serializes given Model object into Ruby Hash.
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/azure_mgmt_compute/models/virtual_machine_image_properties.rb', line 38 def self.serialize_object(object) object.validate output_object = {} serialized_property = object.plan unless serialized_property.nil? serialized_property = PurchasePlan.serialize_object(serialized_property) end output_object['plan'] = serialized_property unless serialized_property.nil? serialized_property = object.os_disk_image unless serialized_property.nil? serialized_property = OSDiskImage.serialize_object(serialized_property) end output_object['osDiskImage'] = serialized_property unless serialized_property.nil? serialized_property = object.data_disk_images unless serialized_property.nil? serializedArray = [] serialized_property.each do |element| unless element.nil? element = DataDiskImage.serialize_object(element) end serializedArray.push(element) end serialized_property = serializedArray end output_object['dataDiskImages'] = serialized_property unless serialized_property.nil? output_object end |
Instance Method Details
#validate ⇒ Object
Validate the object. Throws ValidationError if validation fails.
27 28 29 30 31 |
# File 'lib/azure_mgmt_compute/models/virtual_machine_image_properties.rb', line 27 def validate @plan.validate unless @plan.nil? @os_disk_image.validate unless @os_disk_image.nil? @data_disk_images.each{ |e| e.validate if e.respond_to?(:validate) } unless @data_disk_images.nil? end |