Class: Azure::ARM::Storage::Models::StorageAccountCreateParameters

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

Overview

The parameters to provide for the account.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#kindKind

Possible values include: ‘Storage’, ‘BlobStorage’

Returns:

  • (Kind)

    Required. Indicates the type of storage account.



20
21
22
# File 'lib/azure_mgmt_storage/models/storage_account_create_parameters.rb', line 20

def kind
  @kind
end

#locationString

This will be one of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but if an identical geo region is specified on update the request will succeed.

Returns:

  • (String)

    Required. Gets or sets the location of the resource.



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

def location
  @location
end

#propertiesStorageAccountPropertiesCreateParameters



37
38
39
# File 'lib/azure_mgmt_storage/models/storage_account_create_parameters.rb', line 37

def properties
  @properties
end

#skuSku

Returns Required. Gets or sets the sku type.

Returns:

  • (Sku)

    Required. Gets or sets the sku type.



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

def sku
  @sku
end

#tagsHash{String => String}

pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters.

Returns:

  • (Hash{String => String})

    Gets or sets a list of key value



34
35
36
# File 'lib/azure_mgmt_storage/models/storage_account_create_parameters.rb', line 34

def tags
  @tags
end

Class Method Details

.deserialize_object(object) ⇒ StorageAccountCreateParameters

Deserializes given Ruby Hash into Model object.

Parameters:

  • object (Hash)

    Ruby Hash object to deserialize.

Returns:



89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# File 'lib/azure_mgmt_storage/models/storage_account_create_parameters.rb', line 89

def self.deserialize_object(object)
  return if object.nil?
  output_object = StorageAccountCreateParameters.new

  deserialized_property = object['sku']
  unless deserialized_property.nil?
    deserialized_property = Sku.deserialize_object(deserialized_property)
  end
  output_object.sku = deserialized_property

  deserialized_property = object['kind']
  if (!deserialized_property.nil? && !deserialized_property.empty?)
    enum_is_valid = Kind.constants.any? { |e| Kind.const_get(e).to_s.downcase == deserialized_property.downcase }
    warn 'Enum Kind does not contain ' + deserialized_property.downcase + ', but was received from the server.' unless enum_is_valid
  end
  output_object.kind = deserialized_property

  deserialized_property = object['location']
  output_object.location = deserialized_property

  deserialized_property = object['tags']
  output_object.tags = deserialized_property

  deserialized_property = object['properties']
  unless deserialized_property.nil?
    deserialized_property = StorageAccountPropertiesCreateParameters.deserialize_object(deserialized_property)
  end
  output_object.properties = 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.



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/azure_mgmt_storage/models/storage_account_create_parameters.rb', line 56

def self.serialize_object(object)
  object.validate
  output_object = {}

  serialized_property = object.sku
  unless serialized_property.nil?
    serialized_property = Sku.serialize_object(serialized_property)
  end
  output_object['sku'] = serialized_property unless serialized_property.nil?

  serialized_property = object.kind
  output_object['kind'] = serialized_property unless serialized_property.nil?

  serialized_property = object.location
  output_object['location'] = serialized_property unless serialized_property.nil?

  serialized_property = object.tags
  output_object['tags'] = serialized_property unless serialized_property.nil?

  serialized_property = object.properties
  unless serialized_property.nil?
    serialized_property = StorageAccountPropertiesCreateParameters.serialize_object(serialized_property)
  end
  output_object['properties'] = serialized_property unless serialized_property.nil?

  output_object
end

Instance Method Details

#validateObject

Validate the object. Throws ValidationError if validation fails.



42
43
44
45
46
47
48
49
# File 'lib/azure_mgmt_storage/models/storage_account_create_parameters.rb', line 42

def validate
  fail MsRest::ValidationError, 'property sku is nil' if @sku.nil?
  fail MsRest::ValidationError, 'property kind is nil' if @kind.nil?
  fail MsRest::ValidationError, 'property location is nil' if @location.nil?
  @sku.validate unless @sku.nil?
  @tags.each{ |e| e.validate if e.respond_to?(:validate) } unless @tags.nil?
  @properties.validate unless @properties.nil?
end