# 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::Storage module Models # # An access key for the storage account. # class StorageAccountKey include MsRestAzure # @return [String] Name of the key. attr_accessor :key_name # @return [String] Base 64 encoded value of the key. attr_accessor :value # @return [KeyPermission] Permissions for the key. Possible values # include: 'READ', 'FULL' attr_accessor :permissions # # Validate the object. Throws ValidationError if validation fails. # def validate 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_name output_object['keyName'] = serialized_property unless serialized_property.nil? serialized_property = object.value output_object['value'] = serialized_property unless serialized_property.nil? serialized_property = object.permissions output_object['permissions'] = 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 [StorageAccountKey] Deserialized object. # def self.deserialize_object(object) return if object.nil? output_object = StorageAccountKey.new deserialized_property = object['keyName'] output_object.key_name = deserialized_property deserialized_property = object['value'] output_object.value = deserialized_property deserialized_property = object['permissions'] if (!deserialized_property.nil? && !deserialized_property.empty?) enum_is_valid = KeyPermission.constants.any? { |e| KeyPermission.const_get(e).to_s.downcase == deserialized_property.downcase } warn 'Enum KeyPermission does not contain ' + deserialized_property.downcase + ', but was received from the server.' unless enum_is_valid end output_object.permissions = deserialized_property output_object end end end end