# encoding: utf-8 # Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::ARM::Compute module Models # # Describes a Encryption Settings for a Disk # class DiskEncryptionSettings include MsRestAzure # @return [KeyVaultSecretReference] Gets or sets the disk encryption key # which is a KeyVault Secret. attr_accessor :disk_encryption_key # @return [KeyVaultKeyReference] Gets or sets the key encryption key # which is KeyVault Key. attr_accessor :key_encryption_key # # Validate the object. Throws ValidationError if validation fails. # def validate fail MsRest::ValidationError, 'property disk_encryption_key is nil' if @disk_encryption_key.nil? @disk_encryption_key.validate unless @disk_encryption_key.nil? @key_encryption_key.validate unless @key_encryption_key.nil? end # # Serializes given Model object into Ruby Hash. # @param object Model object to serialize. # @return [Hash] Serialized object in form of Ruby Hash. # def self.serialize_object(object) object.validate output_object = {} serialized_property = object.disk_encryption_key unless serialized_property.nil? serialized_property = KeyVaultSecretReference.serialize_object(serialized_property) end output_object['diskEncryptionKey'] = serialized_property unless serialized_property.nil? serialized_property = object.key_encryption_key unless serialized_property.nil? serialized_property = KeyVaultKeyReference.serialize_object(serialized_property) end output_object['keyEncryptionKey'] = serialized_property unless serialized_property.nil? output_object end # # Deserializes given Ruby Hash into Model object. # @param object [Hash] Ruby Hash object to deserialize. # @return [DiskEncryptionSettings] Deserialized object. # def self.deserialize_object(object) return if object.nil? output_object = DiskEncryptionSettings.new deserialized_property = object['diskEncryptionKey'] unless deserialized_property.nil? deserialized_property = KeyVaultSecretReference.deserialize_object(deserialized_property) end output_object.disk_encryption_key = deserialized_property deserialized_property = object['keyEncryptionKey'] unless deserialized_property.nil? deserialized_property = KeyVaultKeyReference.deserialize_object(deserialized_property) end output_object.key_encryption_key = deserialized_property output_object end end end end