# encoding: utf-8 # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::ARM::Compute module Models # # Describes a reference to Key Vault Key # class KeyVaultKeyReference include MsRestAzure # @return [String] Gets or sets the URL referencing a key in a Key Vault. attr_accessor :key_url # @return [SubResource] Gets or sets the Relative URL of the Key Vault # containing the key attr_accessor :source_vault # # Validate the object. Throws ValidationError if validation fails. # def validate fail MsRest::ValidationError, 'property key_url is nil' if @key_url.nil? fail MsRest::ValidationError, 'property source_vault is nil' if @source_vault.nil? @source_vault.validate unless @source_vault.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.key_url output_object['keyUrl'] = serialized_property unless serialized_property.nil? serialized_property = object.source_vault unless serialized_property.nil? serialized_property = MsRestAzure::SubResource.serialize_object(serialized_property) end output_object['sourceVault'] = 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 [KeyVaultKeyReference] Deserialized object. # def self.deserialize_object(object) return if object.nil? output_object = KeyVaultKeyReference.new deserialized_property = object['keyUrl'] output_object.key_url = deserialized_property deserialized_property = object['sourceVault'] unless deserialized_property.nil? deserialized_property = MsRestAzure::SubResource.deserialize_object(deserialized_property) end output_object.source_vault = deserialized_property output_object end end end end