azure_mgmt_storage 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/azure_mgmt_storage.gemspec +4 -5
- data/lib/azure_mgmt_storage.rb +3 -57
- data/lib/generated/azure_mgmt_storage.rb +56 -0
- data/lib/{azure_mgmt_storage → generated/azure_mgmt_storage}/models/access_tier.rb +0 -0
- data/lib/{azure_mgmt_storage → generated/azure_mgmt_storage}/models/account_status.rb +0 -0
- data/lib/generated/azure_mgmt_storage/models/check_name_availability_result.rb +73 -0
- data/lib/generated/azure_mgmt_storage/models/custom_domain.rb +57 -0
- data/lib/generated/azure_mgmt_storage/models/encryption.rb +59 -0
- data/lib/generated/azure_mgmt_storage/models/encryption_service.rb +60 -0
- data/lib/generated/azure_mgmt_storage/models/encryption_services.rb +45 -0
- data/lib/generated/azure_mgmt_storage/models/endpoints.rb +79 -0
- data/lib/{azure_mgmt_storage → generated/azure_mgmt_storage}/models/key_permission.rb +0 -0
- data/lib/{azure_mgmt_storage → generated/azure_mgmt_storage}/models/kind.rb +0 -0
- data/lib/{azure_mgmt_storage → generated/azure_mgmt_storage}/models/provisioning_state.rb +0 -0
- data/lib/{azure_mgmt_storage → generated/azure_mgmt_storage}/models/reason.rb +0 -0
- data/lib/generated/azure_mgmt_storage/models/sku.rb +61 -0
- data/lib/{azure_mgmt_storage → generated/azure_mgmt_storage}/models/sku_name.rb +0 -0
- data/lib/{azure_mgmt_storage → generated/azure_mgmt_storage}/models/sku_tier.rb +0 -0
- data/lib/generated/azure_mgmt_storage/models/storage_account.rb +269 -0
- data/lib/generated/azure_mgmt_storage/models/storage_account_check_name_availability_parameters.rb +57 -0
- data/lib/generated/azure_mgmt_storage/models/storage_account_create_parameters.rb +134 -0
- data/lib/generated/azure_mgmt_storage/models/storage_account_key.rb +69 -0
- data/lib/generated/azure_mgmt_storage/models/storage_account_list_keys_result.rb +54 -0
- data/lib/generated/azure_mgmt_storage/models/storage_account_list_result.rb +54 -0
- data/lib/generated/azure_mgmt_storage/models/storage_account_regenerate_key_parameters.rb +44 -0
- data/lib/generated/azure_mgmt_storage/models/storage_account_update_parameters.rb +108 -0
- data/lib/generated/azure_mgmt_storage/models/usage.rb +84 -0
- data/lib/generated/azure_mgmt_storage/models/usage_list_result.rb +52 -0
- data/lib/generated/azure_mgmt_storage/models/usage_name.rb +56 -0
- data/lib/{azure_mgmt_storage → generated/azure_mgmt_storage}/models/usage_unit.rb +0 -0
- data/lib/{azure_mgmt_storage → generated/azure_mgmt_storage}/module_definition.rb +0 -0
- data/lib/{azure_mgmt_storage → generated/azure_mgmt_storage}/storage_accounts.rb +81 -66
- data/lib/{azure_mgmt_storage → generated/azure_mgmt_storage}/storage_management_client.rb +4 -4
- data/lib/{azure_mgmt_storage → generated/azure_mgmt_storage}/usage_operations.rb +4 -4
- data/lib/{azure_mgmt_storage → generated/azure_mgmt_storage}/version.rb +1 -1
- metadata +54 -77
- data/lib/azure_mgmt_storage/models/check_name_availability_result.rb +0 -82
- data/lib/azure_mgmt_storage/models/custom_domain.rb +0 -68
- data/lib/azure_mgmt_storage/models/encryption.rb +0 -73
- data/lib/azure_mgmt_storage/models/encryption_service.rb +0 -72
- data/lib/azure_mgmt_storage/models/encryption_services.rb +0 -62
- data/lib/azure_mgmt_storage/models/endpoints.rb +0 -84
- data/lib/azure_mgmt_storage/models/sku.rb +0 -77
- data/lib/azure_mgmt_storage/models/storage_account.rb +0 -122
- data/lib/azure_mgmt_storage/models/storage_account_check_name_availability_parameters.rb +0 -67
- data/lib/azure_mgmt_storage/models/storage_account_create_parameters.rb +0 -122
- data/lib/azure_mgmt_storage/models/storage_account_key.rb +0 -78
- data/lib/azure_mgmt_storage/models/storage_account_list_keys_result.rb +0 -77
- data/lib/azure_mgmt_storage/models/storage_account_list_result.rb +0 -77
- data/lib/azure_mgmt_storage/models/storage_account_properties.rb +0 -227
- data/lib/azure_mgmt_storage/models/storage_account_properties_create_parameters.rb +0 -100
- data/lib/azure_mgmt_storage/models/storage_account_properties_update_parameters.rb +0 -98
- data/lib/azure_mgmt_storage/models/storage_account_regenerate_key_parameters.rb +0 -56
- data/lib/azure_mgmt_storage/models/storage_account_update_parameters.rb +0 -94
- data/lib/azure_mgmt_storage/models/usage.rb +0 -99
- data/lib/azure_mgmt_storage/models/usage_list_result.rb +0 -76
- data/lib/azure_mgmt_storage/models/usage_name.rb +0 -65
@@ -1,100 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
# Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
|
3
|
-
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
-
# regenerated.
|
5
|
-
|
6
|
-
module Azure::ARM::Storage
|
7
|
-
module Models
|
8
|
-
#
|
9
|
-
# Model object.
|
10
|
-
#
|
11
|
-
class StorageAccountPropertiesCreateParameters
|
12
|
-
|
13
|
-
include MsRestAzure
|
14
|
-
|
15
|
-
# @return [CustomDomain] User domain assigned to the storage account.
|
16
|
-
# Name is the CNAME source. Only one custom domain is supported per
|
17
|
-
# storage account at this time. To clear the existing custom domain,
|
18
|
-
# use an empty string for the custom domain name property.
|
19
|
-
attr_accessor :custom_domain
|
20
|
-
|
21
|
-
# @return [Encryption] Provides the encryption settings on the account.
|
22
|
-
# If left unspecified the account encryption settings will remain. The
|
23
|
-
# default setting is unencrypted.
|
24
|
-
attr_accessor :encryption
|
25
|
-
|
26
|
-
# @return [AccessTier] Required for StandardBlob accounts. The access
|
27
|
-
# tier used for billing. Access tier cannot be changed more than once
|
28
|
-
# every 7 days (168 hours). Access tier cannot be set for StandardLRS,
|
29
|
-
# StandardGRS, StandardRAGRS, or PremiumLRS account types. Possible
|
30
|
-
# values include: 'Hot', 'Cool'
|
31
|
-
attr_accessor :access_tier
|
32
|
-
|
33
|
-
#
|
34
|
-
# Validate the object. Throws ValidationError if validation fails.
|
35
|
-
#
|
36
|
-
def validate
|
37
|
-
@custom_domain.validate unless @custom_domain.nil?
|
38
|
-
@encryption.validate unless @encryption.nil?
|
39
|
-
end
|
40
|
-
|
41
|
-
#
|
42
|
-
# Serializes given Model object into Ruby Hash.
|
43
|
-
# @param object Model object to serialize.
|
44
|
-
# @return [Hash] Serialized object in form of Ruby Hash.
|
45
|
-
#
|
46
|
-
def self.serialize_object(object)
|
47
|
-
object.validate
|
48
|
-
output_object = {}
|
49
|
-
|
50
|
-
serialized_property = object.custom_domain
|
51
|
-
unless serialized_property.nil?
|
52
|
-
serialized_property = CustomDomain.serialize_object(serialized_property)
|
53
|
-
end
|
54
|
-
output_object['customDomain'] = serialized_property unless serialized_property.nil?
|
55
|
-
|
56
|
-
serialized_property = object.encryption
|
57
|
-
unless serialized_property.nil?
|
58
|
-
serialized_property = Encryption.serialize_object(serialized_property)
|
59
|
-
end
|
60
|
-
output_object['encryption'] = serialized_property unless serialized_property.nil?
|
61
|
-
|
62
|
-
serialized_property = object.access_tier
|
63
|
-
output_object['accessTier'] = serialized_property unless serialized_property.nil?
|
64
|
-
|
65
|
-
output_object
|
66
|
-
end
|
67
|
-
|
68
|
-
#
|
69
|
-
# Deserializes given Ruby Hash into Model object.
|
70
|
-
# @param object [Hash] Ruby Hash object to deserialize.
|
71
|
-
# @return [StorageAccountPropertiesCreateParameters] Deserialized object.
|
72
|
-
#
|
73
|
-
def self.deserialize_object(object)
|
74
|
-
return if object.nil?
|
75
|
-
output_object = StorageAccountPropertiesCreateParameters.new
|
76
|
-
|
77
|
-
deserialized_property = object['customDomain']
|
78
|
-
unless deserialized_property.nil?
|
79
|
-
deserialized_property = CustomDomain.deserialize_object(deserialized_property)
|
80
|
-
end
|
81
|
-
output_object.custom_domain = deserialized_property
|
82
|
-
|
83
|
-
deserialized_property = object['encryption']
|
84
|
-
unless deserialized_property.nil?
|
85
|
-
deserialized_property = Encryption.deserialize_object(deserialized_property)
|
86
|
-
end
|
87
|
-
output_object.encryption = deserialized_property
|
88
|
-
|
89
|
-
deserialized_property = object['accessTier']
|
90
|
-
if (!deserialized_property.nil? && !deserialized_property.empty?)
|
91
|
-
enum_is_valid = AccessTier.constants.any? { |e| AccessTier.const_get(e).to_s.downcase == deserialized_property.downcase }
|
92
|
-
warn 'Enum AccessTier does not contain ' + deserialized_property.downcase + ', but was received from the server.' unless enum_is_valid
|
93
|
-
end
|
94
|
-
output_object.access_tier = deserialized_property
|
95
|
-
|
96
|
-
output_object
|
97
|
-
end
|
98
|
-
end
|
99
|
-
end
|
100
|
-
end
|
@@ -1,98 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
# Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
|
3
|
-
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
-
# regenerated.
|
5
|
-
|
6
|
-
module Azure::ARM::Storage
|
7
|
-
module Models
|
8
|
-
#
|
9
|
-
# Model object.
|
10
|
-
#
|
11
|
-
class StorageAccountPropertiesUpdateParameters
|
12
|
-
|
13
|
-
include MsRestAzure
|
14
|
-
|
15
|
-
# @return [CustomDomain] User domain assigned to the storage account.
|
16
|
-
# Name is the CNAME source. Only one custom domain is supported per
|
17
|
-
# storage account at this time. To clear the existing custom domain,
|
18
|
-
# use an empty string for the custom domain name property.
|
19
|
-
attr_accessor :custom_domain
|
20
|
-
|
21
|
-
# @return [Encryption] Provides the encryption settings on the account.
|
22
|
-
# The default setting is unencrypted.
|
23
|
-
attr_accessor :encryption
|
24
|
-
|
25
|
-
# @return [AccessTier] The access tier used for billing. Access tier
|
26
|
-
# cannot be changed more than once every 7 days (168 hours). Access
|
27
|
-
# tier cannot be set for StandardLRS, StandardGRS, StandardRAGRS, or
|
28
|
-
# PremiumLRS account types. Possible values include: 'Hot', 'Cool'
|
29
|
-
attr_accessor :access_tier
|
30
|
-
|
31
|
-
#
|
32
|
-
# Validate the object. Throws ValidationError if validation fails.
|
33
|
-
#
|
34
|
-
def validate
|
35
|
-
@custom_domain.validate unless @custom_domain.nil?
|
36
|
-
@encryption.validate unless @encryption.nil?
|
37
|
-
end
|
38
|
-
|
39
|
-
#
|
40
|
-
# Serializes given Model object into Ruby Hash.
|
41
|
-
# @param object Model object to serialize.
|
42
|
-
# @return [Hash] Serialized object in form of Ruby Hash.
|
43
|
-
#
|
44
|
-
def self.serialize_object(object)
|
45
|
-
object.validate
|
46
|
-
output_object = {}
|
47
|
-
|
48
|
-
serialized_property = object.custom_domain
|
49
|
-
unless serialized_property.nil?
|
50
|
-
serialized_property = CustomDomain.serialize_object(serialized_property)
|
51
|
-
end
|
52
|
-
output_object['customDomain'] = serialized_property unless serialized_property.nil?
|
53
|
-
|
54
|
-
serialized_property = object.encryption
|
55
|
-
unless serialized_property.nil?
|
56
|
-
serialized_property = Encryption.serialize_object(serialized_property)
|
57
|
-
end
|
58
|
-
output_object['encryption'] = serialized_property unless serialized_property.nil?
|
59
|
-
|
60
|
-
serialized_property = object.access_tier
|
61
|
-
output_object['accessTier'] = serialized_property unless serialized_property.nil?
|
62
|
-
|
63
|
-
output_object
|
64
|
-
end
|
65
|
-
|
66
|
-
#
|
67
|
-
# Deserializes given Ruby Hash into Model object.
|
68
|
-
# @param object [Hash] Ruby Hash object to deserialize.
|
69
|
-
# @return [StorageAccountPropertiesUpdateParameters] Deserialized object.
|
70
|
-
#
|
71
|
-
def self.deserialize_object(object)
|
72
|
-
return if object.nil?
|
73
|
-
output_object = StorageAccountPropertiesUpdateParameters.new
|
74
|
-
|
75
|
-
deserialized_property = object['customDomain']
|
76
|
-
unless deserialized_property.nil?
|
77
|
-
deserialized_property = CustomDomain.deserialize_object(deserialized_property)
|
78
|
-
end
|
79
|
-
output_object.custom_domain = deserialized_property
|
80
|
-
|
81
|
-
deserialized_property = object['encryption']
|
82
|
-
unless deserialized_property.nil?
|
83
|
-
deserialized_property = Encryption.deserialize_object(deserialized_property)
|
84
|
-
end
|
85
|
-
output_object.encryption = deserialized_property
|
86
|
-
|
87
|
-
deserialized_property = object['accessTier']
|
88
|
-
if (!deserialized_property.nil? && !deserialized_property.empty?)
|
89
|
-
enum_is_valid = AccessTier.constants.any? { |e| AccessTier.const_get(e).to_s.downcase == deserialized_property.downcase }
|
90
|
-
warn 'Enum AccessTier does not contain ' + deserialized_property.downcase + ', but was received from the server.' unless enum_is_valid
|
91
|
-
end
|
92
|
-
output_object.access_tier = deserialized_property
|
93
|
-
|
94
|
-
output_object
|
95
|
-
end
|
96
|
-
end
|
97
|
-
end
|
98
|
-
end
|
@@ -1,56 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
# Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
|
3
|
-
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
-
# regenerated.
|
5
|
-
|
6
|
-
module Azure::ARM::Storage
|
7
|
-
module Models
|
8
|
-
#
|
9
|
-
# Model object.
|
10
|
-
#
|
11
|
-
class StorageAccountRegenerateKeyParameters
|
12
|
-
|
13
|
-
include MsRestAzure
|
14
|
-
|
15
|
-
# @return [String]
|
16
|
-
attr_accessor :key_name
|
17
|
-
|
18
|
-
#
|
19
|
-
# Validate the object. Throws ValidationError if validation fails.
|
20
|
-
#
|
21
|
-
def validate
|
22
|
-
fail MsRest::ValidationError, 'property key_name is nil' if @key_name.nil?
|
23
|
-
end
|
24
|
-
|
25
|
-
#
|
26
|
-
# Serializes given Model object into Ruby Hash.
|
27
|
-
# @param object Model object to serialize.
|
28
|
-
# @return [Hash] Serialized object in form of Ruby Hash.
|
29
|
-
#
|
30
|
-
def self.serialize_object(object)
|
31
|
-
object.validate
|
32
|
-
output_object = {}
|
33
|
-
|
34
|
-
serialized_property = object.key_name
|
35
|
-
output_object['keyName'] = serialized_property unless serialized_property.nil?
|
36
|
-
|
37
|
-
output_object
|
38
|
-
end
|
39
|
-
|
40
|
-
#
|
41
|
-
# Deserializes given Ruby Hash into Model object.
|
42
|
-
# @param object [Hash] Ruby Hash object to deserialize.
|
43
|
-
# @return [StorageAccountRegenerateKeyParameters] Deserialized object.
|
44
|
-
#
|
45
|
-
def self.deserialize_object(object)
|
46
|
-
return if object.nil?
|
47
|
-
output_object = StorageAccountRegenerateKeyParameters.new
|
48
|
-
|
49
|
-
deserialized_property = object['keyName']
|
50
|
-
output_object.key_name = deserialized_property
|
51
|
-
|
52
|
-
output_object
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
@@ -1,94 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
# Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
|
3
|
-
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
-
# regenerated.
|
5
|
-
|
6
|
-
module Azure::ARM::Storage
|
7
|
-
module Models
|
8
|
-
#
|
9
|
-
# The parameters to provide for the account.
|
10
|
-
#
|
11
|
-
class StorageAccountUpdateParameters
|
12
|
-
|
13
|
-
include MsRestAzure
|
14
|
-
|
15
|
-
# @return [Sku] Gets or sets the sku type. Note that sku cannot be
|
16
|
-
# updated to StandardZRS or ProvisionedLRS, nor can accounts of that
|
17
|
-
# sku type be updated to any other value.
|
18
|
-
attr_accessor :sku
|
19
|
-
|
20
|
-
# @return [Hash{String => String}] Gets or sets a list of key value
|
21
|
-
# pairs that describe the resource. These tags can be used in viewing
|
22
|
-
# and grouping this resource (across resource groups). A maximum of 15
|
23
|
-
# tags can be provided for a resource. Each tag must have a key no
|
24
|
-
# greater than 128 characters and value no greater than 256 characters.
|
25
|
-
attr_accessor :tags
|
26
|
-
|
27
|
-
# @return [StorageAccountPropertiesUpdateParameters]
|
28
|
-
attr_accessor :properties
|
29
|
-
|
30
|
-
#
|
31
|
-
# Validate the object. Throws ValidationError if validation fails.
|
32
|
-
#
|
33
|
-
def validate
|
34
|
-
@sku.validate unless @sku.nil?
|
35
|
-
@tags.each{ |e| e.validate if e.respond_to?(:validate) } unless @tags.nil?
|
36
|
-
@properties.validate unless @properties.nil?
|
37
|
-
end
|
38
|
-
|
39
|
-
#
|
40
|
-
# Serializes given Model object into Ruby Hash.
|
41
|
-
# @param object Model object to serialize.
|
42
|
-
# @return [Hash] Serialized object in form of Ruby Hash.
|
43
|
-
#
|
44
|
-
def self.serialize_object(object)
|
45
|
-
object.validate
|
46
|
-
output_object = {}
|
47
|
-
|
48
|
-
serialized_property = object.sku
|
49
|
-
unless serialized_property.nil?
|
50
|
-
serialized_property = Sku.serialize_object(serialized_property)
|
51
|
-
end
|
52
|
-
output_object['sku'] = serialized_property unless serialized_property.nil?
|
53
|
-
|
54
|
-
serialized_property = object.tags
|
55
|
-
output_object['tags'] = serialized_property unless serialized_property.nil?
|
56
|
-
|
57
|
-
serialized_property = object.properties
|
58
|
-
unless serialized_property.nil?
|
59
|
-
serialized_property = StorageAccountPropertiesUpdateParameters.serialize_object(serialized_property)
|
60
|
-
end
|
61
|
-
output_object['properties'] = serialized_property unless serialized_property.nil?
|
62
|
-
|
63
|
-
output_object
|
64
|
-
end
|
65
|
-
|
66
|
-
#
|
67
|
-
# Deserializes given Ruby Hash into Model object.
|
68
|
-
# @param object [Hash] Ruby Hash object to deserialize.
|
69
|
-
# @return [StorageAccountUpdateParameters] Deserialized object.
|
70
|
-
#
|
71
|
-
def self.deserialize_object(object)
|
72
|
-
return if object.nil?
|
73
|
-
output_object = StorageAccountUpdateParameters.new
|
74
|
-
|
75
|
-
deserialized_property = object['sku']
|
76
|
-
unless deserialized_property.nil?
|
77
|
-
deserialized_property = Sku.deserialize_object(deserialized_property)
|
78
|
-
end
|
79
|
-
output_object.sku = deserialized_property
|
80
|
-
|
81
|
-
deserialized_property = object['tags']
|
82
|
-
output_object.tags = deserialized_property
|
83
|
-
|
84
|
-
deserialized_property = object['properties']
|
85
|
-
unless deserialized_property.nil?
|
86
|
-
deserialized_property = StorageAccountPropertiesUpdateParameters.deserialize_object(deserialized_property)
|
87
|
-
end
|
88
|
-
output_object.properties = deserialized_property
|
89
|
-
|
90
|
-
output_object
|
91
|
-
end
|
92
|
-
end
|
93
|
-
end
|
94
|
-
end
|
@@ -1,99 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
# Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
|
3
|
-
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
-
# regenerated.
|
5
|
-
|
6
|
-
module Azure::ARM::Storage
|
7
|
-
module Models
|
8
|
-
#
|
9
|
-
# Describes Storage Resource Usage.
|
10
|
-
#
|
11
|
-
class Usage
|
12
|
-
|
13
|
-
include MsRestAzure
|
14
|
-
|
15
|
-
# @return [UsageUnit] Gets the unit of measurement. Possible values
|
16
|
-
# include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond',
|
17
|
-
# 'BytesPerSecond'
|
18
|
-
attr_accessor :unit
|
19
|
-
|
20
|
-
# @return [Integer] Gets the current count of the allocated resources in
|
21
|
-
# the subscription.
|
22
|
-
attr_accessor :current_value
|
23
|
-
|
24
|
-
# @return [Integer] Gets the maximum count of the resources that can be
|
25
|
-
# allocated in the subscription.
|
26
|
-
attr_accessor :limit
|
27
|
-
|
28
|
-
# @return [UsageName] Gets the name of the type of usage.
|
29
|
-
attr_accessor :name
|
30
|
-
|
31
|
-
#
|
32
|
-
# Validate the object. Throws ValidationError if validation fails.
|
33
|
-
#
|
34
|
-
def validate
|
35
|
-
@name.validate unless @name.nil?
|
36
|
-
end
|
37
|
-
|
38
|
-
#
|
39
|
-
# Serializes given Model object into Ruby Hash.
|
40
|
-
# @param object Model object to serialize.
|
41
|
-
# @return [Hash] Serialized object in form of Ruby Hash.
|
42
|
-
#
|
43
|
-
def self.serialize_object(object)
|
44
|
-
object.validate
|
45
|
-
output_object = {}
|
46
|
-
|
47
|
-
serialized_property = object.unit
|
48
|
-
output_object['unit'] = serialized_property unless serialized_property.nil?
|
49
|
-
|
50
|
-
serialized_property = object.current_value
|
51
|
-
output_object['currentValue'] = serialized_property unless serialized_property.nil?
|
52
|
-
|
53
|
-
serialized_property = object.limit
|
54
|
-
output_object['limit'] = serialized_property unless serialized_property.nil?
|
55
|
-
|
56
|
-
serialized_property = object.name
|
57
|
-
unless serialized_property.nil?
|
58
|
-
serialized_property = UsageName.serialize_object(serialized_property)
|
59
|
-
end
|
60
|
-
output_object['name'] = serialized_property unless serialized_property.nil?
|
61
|
-
|
62
|
-
output_object
|
63
|
-
end
|
64
|
-
|
65
|
-
#
|
66
|
-
# Deserializes given Ruby Hash into Model object.
|
67
|
-
# @param object [Hash] Ruby Hash object to deserialize.
|
68
|
-
# @return [Usage] Deserialized object.
|
69
|
-
#
|
70
|
-
def self.deserialize_object(object)
|
71
|
-
return if object.nil?
|
72
|
-
output_object = Usage.new
|
73
|
-
|
74
|
-
deserialized_property = object['unit']
|
75
|
-
if (!deserialized_property.nil? && !deserialized_property.empty?)
|
76
|
-
enum_is_valid = UsageUnit.constants.any? { |e| UsageUnit.const_get(e).to_s.downcase == deserialized_property.downcase }
|
77
|
-
warn 'Enum UsageUnit does not contain ' + deserialized_property.downcase + ', but was received from the server.' unless enum_is_valid
|
78
|
-
end
|
79
|
-
output_object.unit = deserialized_property
|
80
|
-
|
81
|
-
deserialized_property = object['currentValue']
|
82
|
-
deserialized_property = Integer(deserialized_property) unless deserialized_property.to_s.empty?
|
83
|
-
output_object.current_value = deserialized_property
|
84
|
-
|
85
|
-
deserialized_property = object['limit']
|
86
|
-
deserialized_property = Integer(deserialized_property) unless deserialized_property.to_s.empty?
|
87
|
-
output_object.limit = deserialized_property
|
88
|
-
|
89
|
-
deserialized_property = object['name']
|
90
|
-
unless deserialized_property.nil?
|
91
|
-
deserialized_property = UsageName.deserialize_object(deserialized_property)
|
92
|
-
end
|
93
|
-
output_object.name = deserialized_property
|
94
|
-
|
95
|
-
output_object
|
96
|
-
end
|
97
|
-
end
|
98
|
-
end
|
99
|
-
end
|