Class: Azure::ARM::Storage::Models::StorageAccountKey

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/azure_mgmt_storage/models/storage_account_key.rb

Overview

An access key for the storage account.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#key_nameString

Returns Name of the key.

Returns:

  • (String)

    Name of the key.



16
17
18
# File 'lib/azure_mgmt_storage/models/storage_account_key.rb', line 16

def key_name
  @key_name
end

#permissionsKeyPermission

include: ‘READ’, ‘FULL’

Returns:



23
24
25
# File 'lib/azure_mgmt_storage/models/storage_account_key.rb', line 23

def permissions
  @permissions
end

#valueString

Returns Base 64 encoded value of the key.

Returns:

  • (String)

    Base 64 encoded value of the key.



19
20
21
# File 'lib/azure_mgmt_storage/models/storage_account_key.rb', line 19

def value
  @value
end

Class Method Details

.deserialize_object(object) ⇒ StorageAccountKey

Deserializes given Ruby Hash into Model object.

Parameters:

  • object (Hash)

    Ruby Hash object to deserialize.

Returns:



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/azure_mgmt_storage/models/storage_account_key.rb', line 57

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

.serialize_object(object) ⇒ Hash

Serializes given Model object into Ruby Hash.

Parameters:

  • object

    Model object to serialize.

Returns:

  • (Hash)

    Serialized object in form of Ruby Hash.



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/azure_mgmt_storage/models/storage_account_key.rb', line 36

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

Instance Method Details

#validateObject

Validate the object. Throws ValidationError if validation fails.



28
29
# File 'lib/azure_mgmt_storage/models/storage_account_key.rb', line 28

def validate
end