azure_mgmt_storage 0.15.1 → 0.15.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (193) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2015-05-01-preview/generated/azure_mgmt_storage/models/check_name_availability_result.rb +4 -0
  3. data/lib/2015-05-01-preview/generated/azure_mgmt_storage/models/custom_domain.rb +3 -0
  4. data/lib/2015-05-01-preview/generated/azure_mgmt_storage/models/endpoints.rb +4 -0
  5. data/lib/2015-05-01-preview/generated/azure_mgmt_storage/models/resource.rb +7 -0
  6. data/lib/2015-05-01-preview/generated/azure_mgmt_storage/models/storage_account.rb +18 -0
  7. data/lib/2015-05-01-preview/generated/azure_mgmt_storage/models/storage_account_check_name_availability_parameters.rb +3 -0
  8. data/lib/2015-05-01-preview/generated/azure_mgmt_storage/models/storage_account_create_parameters.rb +8 -0
  9. data/lib/2015-05-01-preview/generated/azure_mgmt_storage/models/storage_account_keys.rb +3 -0
  10. data/lib/2015-05-01-preview/generated/azure_mgmt_storage/models/storage_account_list_result.rb +4 -0
  11. data/lib/2015-05-01-preview/generated/azure_mgmt_storage/models/storage_account_regenerate_key_parameters.rb +2 -0
  12. data/lib/2015-05-01-preview/generated/azure_mgmt_storage/models/storage_account_update_parameters.rb +9 -0
  13. data/lib/2015-05-01-preview/generated/azure_mgmt_storage/models/sub_resource.rb +2 -0
  14. data/lib/2015-05-01-preview/generated/azure_mgmt_storage/models/usage.rb +5 -0
  15. data/lib/2015-05-01-preview/generated/azure_mgmt_storage/models/usage_list_result.rb +3 -0
  16. data/lib/2015-05-01-preview/generated/azure_mgmt_storage/models/usage_name.rb +3 -0
  17. data/lib/2015-05-01-preview/generated/azure_mgmt_storage/storage_management_client.rb +1 -3
  18. data/lib/2015-06-15/generated/azure_mgmt_storage/models/check_name_availability_result.rb +4 -0
  19. data/lib/2015-06-15/generated/azure_mgmt_storage/models/custom_domain.rb +3 -0
  20. data/lib/2015-06-15/generated/azure_mgmt_storage/models/endpoints.rb +5 -0
  21. data/lib/2015-06-15/generated/azure_mgmt_storage/models/resource.rb +7 -0
  22. data/lib/2015-06-15/generated/azure_mgmt_storage/models/storage_account.rb +18 -0
  23. data/lib/2015-06-15/generated/azure_mgmt_storage/models/storage_account_check_name_availability_parameters.rb +3 -0
  24. data/lib/2015-06-15/generated/azure_mgmt_storage/models/storage_account_create_parameters.rb +5 -0
  25. data/lib/2015-06-15/generated/azure_mgmt_storage/models/storage_account_keys.rb +3 -0
  26. data/lib/2015-06-15/generated/azure_mgmt_storage/models/storage_account_list_result.rb +3 -0
  27. data/lib/2015-06-15/generated/azure_mgmt_storage/models/storage_account_regenerate_key_parameters.rb +2 -0
  28. data/lib/2015-06-15/generated/azure_mgmt_storage/models/storage_account_update_parameters.rb +5 -0
  29. data/lib/2015-06-15/generated/azure_mgmt_storage/models/usage.rb +5 -0
  30. data/lib/2015-06-15/generated/azure_mgmt_storage/models/usage_list_result.rb +3 -0
  31. data/lib/2015-06-15/generated/azure_mgmt_storage/models/usage_name.rb +3 -0
  32. data/lib/2015-06-15/generated/azure_mgmt_storage/storage_accounts.rb +33 -0
  33. data/lib/2015-06-15/generated/azure_mgmt_storage/storage_management_client.rb +1 -3
  34. data/lib/2016-01-01/generated/azure_mgmt_storage/models/check_name_availability_result.rb +4 -0
  35. data/lib/2016-01-01/generated/azure_mgmt_storage/models/custom_domain.rb +3 -0
  36. data/lib/2016-01-01/generated/azure_mgmt_storage/models/encryption.rb +3 -0
  37. data/lib/2016-01-01/generated/azure_mgmt_storage/models/encryption_service.rb +3 -0
  38. data/lib/2016-01-01/generated/azure_mgmt_storage/models/encryption_services.rb +2 -0
  39. data/lib/2016-01-01/generated/azure_mgmt_storage/models/endpoints.rb +5 -0
  40. data/lib/2016-01-01/generated/azure_mgmt_storage/models/resource.rb +7 -0
  41. data/lib/2016-01-01/generated/azure_mgmt_storage/models/sku.rb +3 -0
  42. data/lib/2016-01-01/generated/azure_mgmt_storage/models/storage_account.rb +21 -0
  43. data/lib/2016-01-01/generated/azure_mgmt_storage/models/storage_account_check_name_availability_parameters.rb +3 -0
  44. data/lib/2016-01-01/generated/azure_mgmt_storage/models/storage_account_create_parameters.rb +9 -0
  45. data/lib/2016-01-01/generated/azure_mgmt_storage/models/storage_account_key.rb +4 -0
  46. data/lib/2016-01-01/generated/azure_mgmt_storage/models/storage_account_list_keys_result.rb +3 -0
  47. data/lib/2016-01-01/generated/azure_mgmt_storage/models/storage_account_list_result.rb +3 -0
  48. data/lib/2016-01-01/generated/azure_mgmt_storage/models/storage_account_regenerate_key_parameters.rb +2 -0
  49. data/lib/2016-01-01/generated/azure_mgmt_storage/models/storage_account_update_parameters.rb +7 -0
  50. data/lib/2016-01-01/generated/azure_mgmt_storage/models/usage.rb +5 -0
  51. data/lib/2016-01-01/generated/azure_mgmt_storage/models/usage_list_result.rb +3 -0
  52. data/lib/2016-01-01/generated/azure_mgmt_storage/models/usage_name.rb +3 -0
  53. data/lib/2016-01-01/generated/azure_mgmt_storage/storage_accounts.rb +12 -0
  54. data/lib/2016-01-01/generated/azure_mgmt_storage/storage_management_client.rb +1 -3
  55. data/lib/2016-12-01/generated/azure_mgmt_storage/models/account_sas_parameters.rb +9 -0
  56. data/lib/2016-12-01/generated/azure_mgmt_storage/models/check_name_availability_result.rb +4 -0
  57. data/lib/2016-12-01/generated/azure_mgmt_storage/models/custom_domain.rb +3 -0
  58. data/lib/2016-12-01/generated/azure_mgmt_storage/models/encryption.rb +3 -0
  59. data/lib/2016-12-01/generated/azure_mgmt_storage/models/encryption_service.rb +3 -0
  60. data/lib/2016-12-01/generated/azure_mgmt_storage/models/encryption_services.rb +5 -0
  61. data/lib/2016-12-01/generated/azure_mgmt_storage/models/endpoints.rb +5 -0
  62. data/lib/2016-12-01/generated/azure_mgmt_storage/models/list_account_sas_response.rb +2 -0
  63. data/lib/2016-12-01/generated/azure_mgmt_storage/models/list_service_sas_response.rb +2 -0
  64. data/lib/2016-12-01/generated/azure_mgmt_storage/models/resource.rb +7 -0
  65. data/lib/2016-12-01/generated/azure_mgmt_storage/models/service_sas_parameters.rb +19 -0
  66. data/lib/2016-12-01/generated/azure_mgmt_storage/models/sku.rb +3 -0
  67. data/lib/2016-12-01/generated/azure_mgmt_storage/models/storage_account.rb +22 -0
  68. data/lib/2016-12-01/generated/azure_mgmt_storage/models/storage_account_check_name_availability_parameters.rb +3 -0
  69. data/lib/2016-12-01/generated/azure_mgmt_storage/models/storage_account_create_parameters.rb +10 -0
  70. data/lib/2016-12-01/generated/azure_mgmt_storage/models/storage_account_key.rb +4 -0
  71. data/lib/2016-12-01/generated/azure_mgmt_storage/models/storage_account_list_keys_result.rb +3 -0
  72. data/lib/2016-12-01/generated/azure_mgmt_storage/models/storage_account_list_result.rb +3 -0
  73. data/lib/2016-12-01/generated/azure_mgmt_storage/models/storage_account_regenerate_key_parameters.rb +2 -0
  74. data/lib/2016-12-01/generated/azure_mgmt_storage/models/storage_account_update_parameters.rb +8 -0
  75. data/lib/2016-12-01/generated/azure_mgmt_storage/models/usage.rb +5 -0
  76. data/lib/2016-12-01/generated/azure_mgmt_storage/models/usage_list_result.rb +3 -0
  77. data/lib/2016-12-01/generated/azure_mgmt_storage/models/usage_name.rb +3 -0
  78. data/lib/2016-12-01/generated/azure_mgmt_storage/storage_accounts.rb +43 -0
  79. data/lib/2016-12-01/generated/azure_mgmt_storage/storage_management_client.rb +1 -3
  80. data/lib/2017-06-01/generated/azure_mgmt_storage/models/account_sas_parameters.rb +9 -0
  81. data/lib/2017-06-01/generated/azure_mgmt_storage/models/check_name_availability_result.rb +4 -0
  82. data/lib/2017-06-01/generated/azure_mgmt_storage/models/custom_domain.rb +3 -0
  83. data/lib/2017-06-01/generated/azure_mgmt_storage/models/dimension.rb +3 -0
  84. data/lib/2017-06-01/generated/azure_mgmt_storage/models/encryption.rb +4 -0
  85. data/lib/2017-06-01/generated/azure_mgmt_storage/models/encryption_service.rb +3 -0
  86. data/lib/2017-06-01/generated/azure_mgmt_storage/models/encryption_services.rb +5 -0
  87. data/lib/2017-06-01/generated/azure_mgmt_storage/models/endpoints.rb +5 -0
  88. data/lib/2017-06-01/generated/azure_mgmt_storage/models/identity.rb +4 -0
  89. data/lib/2017-06-01/generated/azure_mgmt_storage/models/iprule.rb +3 -0
  90. data/lib/2017-06-01/generated/azure_mgmt_storage/models/key_vault_properties.rb +4 -0
  91. data/lib/2017-06-01/generated/azure_mgmt_storage/models/list_account_sas_response.rb +2 -0
  92. data/lib/2017-06-01/generated/azure_mgmt_storage/models/list_service_sas_response.rb +2 -0
  93. data/lib/2017-06-01/generated/azure_mgmt_storage/models/metric_specification.rb +11 -0
  94. data/lib/2017-06-01/generated/azure_mgmt_storage/models/network_rule_set.rb +7 -0
  95. data/lib/2017-06-01/generated/azure_mgmt_storage/models/operation.rb +5 -0
  96. data/lib/2017-06-01/generated/azure_mgmt_storage/models/operation_display.rb +4 -0
  97. data/lib/2017-06-01/generated/azure_mgmt_storage/models/operation_list_result.rb +3 -0
  98. data/lib/2017-06-01/generated/azure_mgmt_storage/models/resource.rb +7 -0
  99. data/lib/2017-06-01/generated/azure_mgmt_storage/models/restriction.rb +5 -0
  100. data/lib/2017-06-01/generated/azure_mgmt_storage/models/service_sas_parameters.rb +19 -0
  101. data/lib/2017-06-01/generated/azure_mgmt_storage/models/service_specification.rb +3 -0
  102. data/lib/2017-06-01/generated/azure_mgmt_storage/models/sku.rb +11 -0
  103. data/lib/2017-06-01/generated/azure_mgmt_storage/models/skucapability.rb +3 -0
  104. data/lib/2017-06-01/generated/azure_mgmt_storage/models/storage_account.rb +24 -0
  105. data/lib/2017-06-01/generated/azure_mgmt_storage/models/storage_account_check_name_availability_parameters.rb +3 -0
  106. data/lib/2017-06-01/generated/azure_mgmt_storage/models/storage_account_create_parameters.rb +12 -0
  107. data/lib/2017-06-01/generated/azure_mgmt_storage/models/storage_account_key.rb +4 -0
  108. data/lib/2017-06-01/generated/azure_mgmt_storage/models/storage_account_list_keys_result.rb +3 -0
  109. data/lib/2017-06-01/generated/azure_mgmt_storage/models/storage_account_list_result.rb +3 -0
  110. data/lib/2017-06-01/generated/azure_mgmt_storage/models/storage_account_regenerate_key_parameters.rb +2 -0
  111. data/lib/2017-06-01/generated/azure_mgmt_storage/models/storage_account_update_parameters.rb +10 -0
  112. data/lib/2017-06-01/generated/azure_mgmt_storage/models/storage_sku_list_result.rb +3 -0
  113. data/lib/2017-06-01/generated/azure_mgmt_storage/models/usage.rb +5 -0
  114. data/lib/2017-06-01/generated/azure_mgmt_storage/models/usage_list_result.rb +3 -0
  115. data/lib/2017-06-01/generated/azure_mgmt_storage/models/usage_name.rb +3 -0
  116. data/lib/2017-06-01/generated/azure_mgmt_storage/models/virtual_network_rule.rb +4 -0
  117. data/lib/2017-06-01/generated/azure_mgmt_storage/storage_accounts.rb +43 -0
  118. data/lib/2017-06-01/generated/azure_mgmt_storage/storage_management_client.rb +1 -3
  119. data/lib/2017-10-01/generated/azure_mgmt_storage.rb +88 -0
  120. data/lib/2017-10-01/generated/azure_mgmt_storage/models/access_tier.rb +16 -0
  121. data/lib/2017-10-01/generated/azure_mgmt_storage/models/account_sas_parameters.rb +136 -0
  122. data/lib/2017-10-01/generated/azure_mgmt_storage/models/account_status.rb +16 -0
  123. data/lib/{2015-06-15/generated/azure_mgmt_storage/version.rb → 2017-10-01/generated/azure_mgmt_storage/models/action.rb} +9 -2
  124. data/lib/2017-10-01/generated/azure_mgmt_storage/models/bypass.rb +18 -0
  125. data/lib/2017-10-01/generated/azure_mgmt_storage/models/check_name_availability_result.rb +77 -0
  126. data/lib/2017-10-01/generated/azure_mgmt_storage/models/custom_domain.rb +60 -0
  127. data/lib/2017-10-01/generated/azure_mgmt_storage/models/default_action.rb +16 -0
  128. data/lib/2017-10-01/generated/azure_mgmt_storage/models/dimension.rb +57 -0
  129. data/lib/2017-10-01/generated/azure_mgmt_storage/models/encryption.rb +74 -0
  130. data/lib/2017-10-01/generated/azure_mgmt_storage/models/encryption_service.rb +62 -0
  131. data/lib/2017-10-01/generated/azure_mgmt_storage/models/encryption_services.rb +89 -0
  132. data/lib/2017-10-01/generated/azure_mgmt_storage/models/endpoints.rb +84 -0
  133. data/lib/2017-10-01/generated/azure_mgmt_storage/models/http_protocol.rb +16 -0
  134. data/lib/2017-10-01/generated/azure_mgmt_storage/models/identity.rb +72 -0
  135. data/lib/2017-10-01/generated/azure_mgmt_storage/models/iprule.rb +61 -0
  136. data/lib/2017-10-01/generated/azure_mgmt_storage/models/key_permission.rb +16 -0
  137. data/lib/2017-10-01/generated/azure_mgmt_storage/models/key_source.rb +16 -0
  138. data/lib/2017-10-01/generated/azure_mgmt_storage/models/key_vault_properties.rb +68 -0
  139. data/lib/2017-10-01/generated/azure_mgmt_storage/models/kind.rb +17 -0
  140. data/lib/2017-10-01/generated/azure_mgmt_storage/models/list_account_sas_response.rb +47 -0
  141. data/lib/2017-10-01/generated/azure_mgmt_storage/models/list_service_sas_response.rb +47 -0
  142. data/lib/2017-10-01/generated/azure_mgmt_storage/models/metric_specification.rb +145 -0
  143. data/lib/2017-10-01/generated/azure_mgmt_storage/models/network_rule_set.rb +106 -0
  144. data/lib/2017-10-01/generated/azure_mgmt_storage/models/operation.rb +83 -0
  145. data/lib/2017-10-01/generated/azure_mgmt_storage/models/operation_display.rb +68 -0
  146. data/lib/2017-10-01/generated/azure_mgmt_storage/models/operation_list_result.rb +57 -0
  147. data/lib/2017-10-01/generated/azure_mgmt_storage/models/permissions.rb +22 -0
  148. data/lib/2017-10-01/generated/azure_mgmt_storage/models/provisioning_state.rb +17 -0
  149. data/lib/2017-10-01/generated/azure_mgmt_storage/models/reason.rb +16 -0
  150. data/lib/2017-10-01/generated/azure_mgmt_storage/models/reason_code.rb +16 -0
  151. data/lib/2017-10-01/generated/azure_mgmt_storage/models/resource.rb +102 -0
  152. data/lib/2017-10-01/generated/azure_mgmt_storage/models/restriction.rb +85 -0
  153. data/lib/2017-10-01/generated/azure_mgmt_storage/models/service_sas_parameters.rb +247 -0
  154. data/lib/2017-10-01/generated/azure_mgmt_storage/models/service_specification.rb +56 -0
  155. data/lib/2017-10-01/generated/azure_mgmt_storage/models/services.rb +18 -0
  156. data/lib/2017-10-01/generated/azure_mgmt_storage/models/signed_resource.rb +18 -0
  157. data/lib/2017-10-01/generated/azure_mgmt_storage/models/signed_resource_types.rb +17 -0
  158. data/lib/2017-10-01/generated/azure_mgmt_storage/models/sku.rb +157 -0
  159. data/lib/2017-10-01/generated/azure_mgmt_storage/models/sku_name.rb +19 -0
  160. data/lib/2017-10-01/generated/azure_mgmt_storage/models/sku_tier.rb +16 -0
  161. data/lib/2017-10-01/generated/azure_mgmt_storage/models/skucapability.rb +63 -0
  162. data/lib/2017-10-01/generated/azure_mgmt_storage/models/state.rb +19 -0
  163. data/lib/2017-10-01/generated/azure_mgmt_storage/models/storage_account.rb +326 -0
  164. data/lib/2017-10-01/generated/azure_mgmt_storage/models/storage_account_check_name_availability_parameters.rb +62 -0
  165. data/lib/2017-10-01/generated/azure_mgmt_storage/models/storage_account_create_parameters.rb +179 -0
  166. data/lib/2017-10-01/generated/azure_mgmt_storage/models/storage_account_key.rb +73 -0
  167. data/lib/2017-10-01/generated/azure_mgmt_storage/models/storage_account_list_keys_result.rb +57 -0
  168. data/lib/2017-10-01/generated/azure_mgmt_storage/models/storage_account_list_result.rb +57 -0
  169. data/lib/2017-10-01/generated/azure_mgmt_storage/models/storage_account_regenerate_key_parameters.rb +47 -0
  170. data/lib/2017-10-01/generated/azure_mgmt_storage/models/storage_account_update_parameters.rb +167 -0
  171. data/lib/2017-10-01/generated/azure_mgmt_storage/models/storage_sku_list_result.rb +57 -0
  172. data/lib/2017-10-01/generated/azure_mgmt_storage/models/usage.rb +89 -0
  173. data/lib/2017-10-01/generated/azure_mgmt_storage/models/usage_list_result.rb +56 -0
  174. data/lib/2017-10-01/generated/azure_mgmt_storage/models/usage_name.rb +59 -0
  175. data/lib/2017-10-01/generated/azure_mgmt_storage/models/usage_unit.rb +20 -0
  176. data/lib/2017-10-01/generated/azure_mgmt_storage/models/virtual_network_rule.rb +75 -0
  177. data/lib/{2015-05-01-preview/generated/azure_mgmt_storage/version.rb → 2017-10-01/generated/azure_mgmt_storage/module_definition.rb} +4 -3
  178. data/lib/2017-10-01/generated/azure_mgmt_storage/operations.rb +106 -0
  179. data/lib/2017-10-01/generated/azure_mgmt_storage/skus.rb +111 -0
  180. data/lib/2017-10-01/generated/azure_mgmt_storage/storage_accounts.rb +1319 -0
  181. data/lib/2017-10-01/generated/azure_mgmt_storage/storage_management_client.rb +141 -0
  182. data/lib/2017-10-01/generated/azure_mgmt_storage/usage_operations.rb +111 -0
  183. data/lib/azure_mgmt_storage.rb +1 -0
  184. data/lib/profiles/latest/modules/storage_profile_module.rb +119 -119
  185. data/lib/profiles/latest/storage_latest_profile_client.rb +1 -3
  186. data/lib/profiles/v2017_03_09/storage_v2017_03_09_profile_client.rb +1 -3
  187. data/lib/version.rb +1 -1
  188. metadata +74 -12
  189. data/lib/2016-01-01/generated/azure_mgmt_storage/version.rb +0 -8
  190. data/lib/2016-12-01/generated/azure_mgmt_storage/version.rb +0 -8
  191. data/lib/2017-06-01/generated/azure_mgmt_storage/version.rb +0 -8
  192. data/lib/profiles/common/configurable.rb +0 -86
  193. data/lib/profiles/common/default.rb +0 -57
@@ -0,0 +1,75 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::Storage::Mgmt::V2017_10_01
7
+ module Models
8
+ #
9
+ # Virtual Network rule.
10
+ #
11
+ class VirtualNetworkRule
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [String] Resource ID of a subnet, for example:
16
+ # /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}.
17
+ attr_accessor :virtual_network_resource_id
18
+
19
+ # @return [Action] The action of virtual network rule. Possible values
20
+ # include: 'Allow'. Default value: 'Allow' .
21
+ attr_accessor :action
22
+
23
+ # @return [State] Gets the state of virtual network rule. Possible values
24
+ # include: 'provisioning', 'deprovisioning', 'succeeded', 'failed',
25
+ # 'networkSourceDeleted'
26
+ attr_accessor :state
27
+
28
+
29
+ #
30
+ # Mapper for VirtualNetworkRule class as Ruby Hash.
31
+ # This will be used for serialization/deserialization.
32
+ #
33
+ def self.mapper()
34
+ {
35
+ client_side_validation: true,
36
+ required: false,
37
+ serialized_name: 'VirtualNetworkRule',
38
+ type: {
39
+ name: 'Composite',
40
+ class_name: 'VirtualNetworkRule',
41
+ model_properties: {
42
+ virtual_network_resource_id: {
43
+ client_side_validation: true,
44
+ required: true,
45
+ serialized_name: 'id',
46
+ type: {
47
+ name: 'String'
48
+ }
49
+ },
50
+ action: {
51
+ client_side_validation: true,
52
+ required: false,
53
+ serialized_name: 'action',
54
+ default_value: 'Allow',
55
+ type: {
56
+ name: 'Enum',
57
+ module: 'Action'
58
+ }
59
+ },
60
+ state: {
61
+ client_side_validation: true,
62
+ required: false,
63
+ serialized_name: 'state',
64
+ type: {
65
+ name: 'Enum',
66
+ module: 'State'
67
+ }
68
+ }
69
+ }
70
+ }
71
+ }
72
+ end
73
+ end
74
+ end
75
+ end
@@ -3,6 +3,7 @@
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
6
- module Azure::Storage::Mgmt::V2015_05_01_preview
7
- VERSION = '0.15.1'
8
- end
6
+ module Azure end
7
+ module Azure::Storage end
8
+ module Azure::Storage::Mgmt end
9
+ module Azure::Storage::Mgmt::V2017_10_01 end
@@ -0,0 +1,106 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::Storage::Mgmt::V2017_10_01
7
+ #
8
+ # The Azure Storage Management API.
9
+ #
10
+ class Operations
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Operations class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [StorageManagementClient] reference to the StorageManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Lists all of the available Storage Rest API operations.
26
+ #
27
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
28
+ # will be added to the HTTP request.
29
+ #
30
+ # @return [OperationListResult] operation results.
31
+ #
32
+ def list(custom_headers = nil)
33
+ response = list_async(custom_headers).value!
34
+ response.body unless response.nil?
35
+ end
36
+
37
+ #
38
+ # Lists all of the available Storage Rest API operations.
39
+ #
40
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
41
+ # will be added to the HTTP request.
42
+ #
43
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
44
+ #
45
+ def list_with_http_info(custom_headers = nil)
46
+ list_async(custom_headers).value!
47
+ end
48
+
49
+ #
50
+ # Lists all of the available Storage Rest API operations.
51
+ #
52
+ # @param [Hash{String => String}] A hash of custom headers that will be added
53
+ # to the HTTP request.
54
+ #
55
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
56
+ #
57
+ def list_async(custom_headers = nil)
58
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
59
+
60
+
61
+ request_headers = {}
62
+
63
+ # Set Headers
64
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
65
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
66
+ path_template = 'providers/Microsoft.Storage/operations'
67
+
68
+ request_url = @base_url || @client.base_url
69
+
70
+ options = {
71
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
72
+ query_params: {'api-version' => @client.api_version},
73
+ headers: request_headers.merge(custom_headers || {}),
74
+ base_url: request_url
75
+ }
76
+ promise = @client.make_request_async(:get, path_template, options)
77
+
78
+ promise = promise.then do |result|
79
+ http_response = result.response
80
+ status_code = http_response.status
81
+ response_content = http_response.body
82
+ unless status_code == 200
83
+ error_model = JSON.load(response_content)
84
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
85
+ end
86
+
87
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
88
+ # Deserialize Response
89
+ if status_code == 200
90
+ begin
91
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
92
+ result_mapper = Azure::Storage::Mgmt::V2017_10_01::Models::OperationListResult.mapper()
93
+ result.body = @client.deserialize(result_mapper, parsed_response)
94
+ rescue Exception => e
95
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
96
+ end
97
+ end
98
+
99
+ result
100
+ end
101
+
102
+ promise.execute
103
+ end
104
+
105
+ end
106
+ end
@@ -0,0 +1,111 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::Storage::Mgmt::V2017_10_01
7
+ #
8
+ # The Azure Storage Management API.
9
+ #
10
+ class Skus
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Skus class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [StorageManagementClient] reference to the StorageManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Lists the available SKUs supported by Microsoft.Storage for given
26
+ # subscription.
27
+ #
28
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
29
+ # will be added to the HTTP request.
30
+ #
31
+ # @return [StorageSkuListResult] operation results.
32
+ #
33
+ def list(custom_headers = nil)
34
+ response = list_async(custom_headers).value!
35
+ response.body unless response.nil?
36
+ end
37
+
38
+ #
39
+ # Lists the available SKUs supported by Microsoft.Storage for given
40
+ # subscription.
41
+ #
42
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
43
+ # will be added to the HTTP request.
44
+ #
45
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
46
+ #
47
+ def list_with_http_info(custom_headers = nil)
48
+ list_async(custom_headers).value!
49
+ end
50
+
51
+ #
52
+ # Lists the available SKUs supported by Microsoft.Storage for given
53
+ # subscription.
54
+ #
55
+ # @param [Hash{String => String}] A hash of custom headers that will be added
56
+ # to the HTTP request.
57
+ #
58
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
59
+ #
60
+ def list_async(custom_headers = nil)
61
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
62
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
63
+
64
+
65
+ request_headers = {}
66
+
67
+ # Set Headers
68
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
69
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
70
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus'
71
+
72
+ request_url = @base_url || @client.base_url
73
+
74
+ options = {
75
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
76
+ path_params: {'subscriptionId' => @client.subscription_id},
77
+ query_params: {'api-version' => @client.api_version},
78
+ headers: request_headers.merge(custom_headers || {}),
79
+ base_url: request_url
80
+ }
81
+ promise = @client.make_request_async(:get, path_template, options)
82
+
83
+ promise = promise.then do |result|
84
+ http_response = result.response
85
+ status_code = http_response.status
86
+ response_content = http_response.body
87
+ unless status_code == 200
88
+ error_model = JSON.load(response_content)
89
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
90
+ end
91
+
92
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
93
+ # Deserialize Response
94
+ if status_code == 200
95
+ begin
96
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
97
+ result_mapper = Azure::Storage::Mgmt::V2017_10_01::Models::StorageSkuListResult.mapper()
98
+ result.body = @client.deserialize(result_mapper, parsed_response)
99
+ rescue Exception => e
100
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
101
+ end
102
+ end
103
+
104
+ result
105
+ end
106
+
107
+ promise.execute
108
+ end
109
+
110
+ end
111
+ end
@@ -0,0 +1,1319 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::Storage::Mgmt::V2017_10_01
7
+ #
8
+ # The Azure Storage Management API.
9
+ #
10
+ class StorageAccounts
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the StorageAccounts class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [StorageManagementClient] reference to the StorageManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Checks that the storage account name is valid and is not already in use.
26
+ #
27
+ # @param account_name [StorageAccountCheckNameAvailabilityParameters] The name
28
+ # of the storage account within the specified resource group. Storage account
29
+ # names must be between 3 and 24 characters in length and use numbers and
30
+ # lower-case letters only.
31
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
32
+ # will be added to the HTTP request.
33
+ #
34
+ # @return [CheckNameAvailabilityResult] operation results.
35
+ #
36
+ def check_name_availability(account_name, custom_headers = nil)
37
+ response = check_name_availability_async(account_name, custom_headers).value!
38
+ response.body unless response.nil?
39
+ end
40
+
41
+ #
42
+ # Checks that the storage account name is valid and is not already in use.
43
+ #
44
+ # @param account_name [StorageAccountCheckNameAvailabilityParameters] The name
45
+ # of the storage account within the specified resource group. Storage account
46
+ # names must be between 3 and 24 characters in length and use numbers and
47
+ # lower-case letters only.
48
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
49
+ # will be added to the HTTP request.
50
+ #
51
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
52
+ #
53
+ def check_name_availability_with_http_info(account_name, custom_headers = nil)
54
+ check_name_availability_async(account_name, custom_headers).value!
55
+ end
56
+
57
+ #
58
+ # Checks that the storage account name is valid and is not already in use.
59
+ #
60
+ # @param account_name [StorageAccountCheckNameAvailabilityParameters] The name
61
+ # of the storage account within the specified resource group. Storage account
62
+ # names must be between 3 and 24 characters in length and use numbers and
63
+ # lower-case letters only.
64
+ # @param [Hash{String => String}] A hash of custom headers that will be added
65
+ # to the HTTP request.
66
+ #
67
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
68
+ #
69
+ def check_name_availability_async(account_name, custom_headers = nil)
70
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
71
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
72
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
73
+
74
+
75
+ request_headers = {}
76
+
77
+ # Set Headers
78
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
79
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
80
+
81
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
82
+
83
+ # Serialize Request
84
+ request_mapper = Azure::Storage::Mgmt::V2017_10_01::Models::StorageAccountCheckNameAvailabilityParameters.mapper()
85
+ request_content = @client.serialize(request_mapper, account_name)
86
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
87
+
88
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability'
89
+
90
+ request_url = @base_url || @client.base_url
91
+
92
+ options = {
93
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
94
+ path_params: {'subscriptionId' => @client.subscription_id},
95
+ query_params: {'api-version' => @client.api_version},
96
+ body: request_content,
97
+ headers: request_headers.merge(custom_headers || {}),
98
+ base_url: request_url
99
+ }
100
+ promise = @client.make_request_async(:post, path_template, options)
101
+
102
+ promise = promise.then do |result|
103
+ http_response = result.response
104
+ status_code = http_response.status
105
+ response_content = http_response.body
106
+ unless status_code == 200
107
+ error_model = JSON.load(response_content)
108
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
109
+ end
110
+
111
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
112
+ # Deserialize Response
113
+ if status_code == 200
114
+ begin
115
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
116
+ result_mapper = Azure::Storage::Mgmt::V2017_10_01::Models::CheckNameAvailabilityResult.mapper()
117
+ result.body = @client.deserialize(result_mapper, parsed_response)
118
+ rescue Exception => e
119
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
120
+ end
121
+ end
122
+
123
+ result
124
+ end
125
+
126
+ promise.execute
127
+ end
128
+
129
+ #
130
+ # Asynchronously creates a new storage account with the specified parameters.
131
+ # If an account is already created and a subsequent create request is issued
132
+ # with different properties, the account properties will be updated. If an
133
+ # account is already created and a subsequent create or update request is
134
+ # issued with the exact same set of properties, the request will succeed.
135
+ #
136
+ # @param resource_group_name [String] The name of the resource group within the
137
+ # user's subscription. The name is case insensitive.
138
+ # @param account_name [String] The name of the storage account within the
139
+ # specified resource group. Storage account names must be between 3 and 24
140
+ # characters in length and use numbers and lower-case letters only.
141
+ # @param parameters [StorageAccountCreateParameters] The parameters to provide
142
+ # for the created account.
143
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
144
+ # will be added to the HTTP request.
145
+ #
146
+ # @return [StorageAccount] operation results.
147
+ #
148
+ def create(resource_group_name, account_name, parameters, custom_headers = nil)
149
+ response = create_async(resource_group_name, account_name, parameters, custom_headers).value!
150
+ response.body unless response.nil?
151
+ end
152
+
153
+ #
154
+ # @param resource_group_name [String] The name of the resource group within the
155
+ # user's subscription. The name is case insensitive.
156
+ # @param account_name [String] The name of the storage account within the
157
+ # specified resource group. Storage account names must be between 3 and 24
158
+ # characters in length and use numbers and lower-case letters only.
159
+ # @param parameters [StorageAccountCreateParameters] The parameters to provide
160
+ # for the created account.
161
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
162
+ # will be added to the HTTP request.
163
+ #
164
+ # @return [Concurrent::Promise] promise which provides async access to http
165
+ # response.
166
+ #
167
+ def create_async(resource_group_name, account_name, parameters, custom_headers = nil)
168
+ # Send request
169
+ promise = begin_create_async(resource_group_name, account_name, parameters, custom_headers)
170
+
171
+ promise = promise.then do |response|
172
+ # Defining deserialization method.
173
+ deserialize_method = lambda do |parsed_response|
174
+ result_mapper = Azure::Storage::Mgmt::V2017_10_01::Models::StorageAccount.mapper()
175
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
176
+ end
177
+
178
+ # Waiting for response.
179
+ @client.get_long_running_operation_result(response, deserialize_method)
180
+ end
181
+
182
+ promise
183
+ end
184
+
185
+ #
186
+ # Deletes a storage account in Microsoft Azure.
187
+ #
188
+ # @param resource_group_name [String] The name of the resource group within the
189
+ # user's subscription. The name is case insensitive.
190
+ # @param account_name [String] The name of the storage account within the
191
+ # specified resource group. Storage account names must be between 3 and 24
192
+ # characters in length and use numbers and lower-case letters only.
193
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
194
+ # will be added to the HTTP request.
195
+ #
196
+ #
197
+ def delete(resource_group_name, account_name, custom_headers = nil)
198
+ response = delete_async(resource_group_name, account_name, custom_headers).value!
199
+ nil
200
+ end
201
+
202
+ #
203
+ # Deletes a storage account in Microsoft Azure.
204
+ #
205
+ # @param resource_group_name [String] The name of the resource group within the
206
+ # user's subscription. The name is case insensitive.
207
+ # @param account_name [String] The name of the storage account within the
208
+ # specified resource group. Storage account names must be between 3 and 24
209
+ # characters in length and use numbers and lower-case letters only.
210
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
211
+ # will be added to the HTTP request.
212
+ #
213
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
214
+ #
215
+ def delete_with_http_info(resource_group_name, account_name, custom_headers = nil)
216
+ delete_async(resource_group_name, account_name, custom_headers).value!
217
+ end
218
+
219
+ #
220
+ # Deletes a storage account in Microsoft Azure.
221
+ #
222
+ # @param resource_group_name [String] The name of the resource group within the
223
+ # user's subscription. The name is case insensitive.
224
+ # @param account_name [String] The name of the storage account within the
225
+ # specified resource group. Storage account names must be between 3 and 24
226
+ # characters in length and use numbers and lower-case letters only.
227
+ # @param [Hash{String => String}] A hash of custom headers that will be added
228
+ # to the HTTP request.
229
+ #
230
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
231
+ #
232
+ def delete_async(resource_group_name, account_name, custom_headers = nil)
233
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
234
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
235
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
236
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
237
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
238
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
239
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
240
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
241
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
242
+
243
+
244
+ request_headers = {}
245
+
246
+ # Set Headers
247
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
248
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
249
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'
250
+
251
+ request_url = @base_url || @client.base_url
252
+
253
+ options = {
254
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
255
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
256
+ query_params: {'api-version' => @client.api_version},
257
+ headers: request_headers.merge(custom_headers || {}),
258
+ base_url: request_url
259
+ }
260
+ promise = @client.make_request_async(:delete, path_template, options)
261
+
262
+ promise = promise.then do |result|
263
+ http_response = result.response
264
+ status_code = http_response.status
265
+ response_content = http_response.body
266
+ unless status_code == 200 || status_code == 204
267
+ error_model = JSON.load(response_content)
268
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
269
+ end
270
+
271
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
272
+
273
+ result
274
+ end
275
+
276
+ promise.execute
277
+ end
278
+
279
+ #
280
+ # Returns the properties for the specified storage account including but not
281
+ # limited to name, SKU name, location, and account status. The ListKeys
282
+ # operation should be used to retrieve storage keys.
283
+ #
284
+ # @param resource_group_name [String] The name of the resource group within the
285
+ # user's subscription. The name is case insensitive.
286
+ # @param account_name [String] The name of the storage account within the
287
+ # specified resource group. Storage account names must be between 3 and 24
288
+ # characters in length and use numbers and lower-case letters only.
289
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
290
+ # will be added to the HTTP request.
291
+ #
292
+ # @return [StorageAccount] operation results.
293
+ #
294
+ def get_properties(resource_group_name, account_name, custom_headers = nil)
295
+ response = get_properties_async(resource_group_name, account_name, custom_headers).value!
296
+ response.body unless response.nil?
297
+ end
298
+
299
+ #
300
+ # Returns the properties for the specified storage account including but not
301
+ # limited to name, SKU name, location, and account status. The ListKeys
302
+ # operation should be used to retrieve storage keys.
303
+ #
304
+ # @param resource_group_name [String] The name of the resource group within the
305
+ # user's subscription. The name is case insensitive.
306
+ # @param account_name [String] The name of the storage account within the
307
+ # specified resource group. Storage account names must be between 3 and 24
308
+ # characters in length and use numbers and lower-case letters only.
309
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
310
+ # will be added to the HTTP request.
311
+ #
312
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
313
+ #
314
+ def get_properties_with_http_info(resource_group_name, account_name, custom_headers = nil)
315
+ get_properties_async(resource_group_name, account_name, custom_headers).value!
316
+ end
317
+
318
+ #
319
+ # Returns the properties for the specified storage account including but not
320
+ # limited to name, SKU name, location, and account status. The ListKeys
321
+ # operation should be used to retrieve storage keys.
322
+ #
323
+ # @param resource_group_name [String] The name of the resource group within the
324
+ # user's subscription. The name is case insensitive.
325
+ # @param account_name [String] The name of the storage account within the
326
+ # specified resource group. Storage account names must be between 3 and 24
327
+ # characters in length and use numbers and lower-case letters only.
328
+ # @param [Hash{String => String}] A hash of custom headers that will be added
329
+ # to the HTTP request.
330
+ #
331
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
332
+ #
333
+ def get_properties_async(resource_group_name, account_name, custom_headers = nil)
334
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
335
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
336
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
337
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
338
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
339
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
340
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
341
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
342
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
343
+
344
+
345
+ request_headers = {}
346
+
347
+ # Set Headers
348
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
349
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
350
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'
351
+
352
+ request_url = @base_url || @client.base_url
353
+
354
+ options = {
355
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
356
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
357
+ query_params: {'api-version' => @client.api_version},
358
+ headers: request_headers.merge(custom_headers || {}),
359
+ base_url: request_url
360
+ }
361
+ promise = @client.make_request_async(:get, path_template, options)
362
+
363
+ promise = promise.then do |result|
364
+ http_response = result.response
365
+ status_code = http_response.status
366
+ response_content = http_response.body
367
+ unless status_code == 200
368
+ error_model = JSON.load(response_content)
369
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
370
+ end
371
+
372
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
373
+ # Deserialize Response
374
+ if status_code == 200
375
+ begin
376
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
377
+ result_mapper = Azure::Storage::Mgmt::V2017_10_01::Models::StorageAccount.mapper()
378
+ result.body = @client.deserialize(result_mapper, parsed_response)
379
+ rescue Exception => e
380
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
381
+ end
382
+ end
383
+
384
+ result
385
+ end
386
+
387
+ promise.execute
388
+ end
389
+
390
+ #
391
+ # The update operation can be used to update the SKU, encryption, access tier,
392
+ # or tags for a storage account. It can also be used to map the account to a
393
+ # custom domain. Only one custom domain is supported per storage account; the
394
+ # replacement/change of custom domain is not supported. In order to replace an
395
+ # old custom domain, the old value must be cleared/unregistered before a new
396
+ # value can be set. The update of multiple properties is supported. This call
397
+ # does not change the storage keys for the account. If you want to change the
398
+ # storage account keys, use the regenerate keys operation. The location and
399
+ # name of the storage account cannot be changed after creation.
400
+ #
401
+ # @param resource_group_name [String] The name of the resource group within the
402
+ # user's subscription. The name is case insensitive.
403
+ # @param account_name [String] The name of the storage account within the
404
+ # specified resource group. Storage account names must be between 3 and 24
405
+ # characters in length and use numbers and lower-case letters only.
406
+ # @param parameters [StorageAccountUpdateParameters] The parameters to provide
407
+ # for the updated account.
408
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
409
+ # will be added to the HTTP request.
410
+ #
411
+ # @return [StorageAccount] operation results.
412
+ #
413
+ def update(resource_group_name, account_name, parameters, custom_headers = nil)
414
+ response = update_async(resource_group_name, account_name, parameters, custom_headers).value!
415
+ response.body unless response.nil?
416
+ end
417
+
418
+ #
419
+ # The update operation can be used to update the SKU, encryption, access tier,
420
+ # or tags for a storage account. It can also be used to map the account to a
421
+ # custom domain. Only one custom domain is supported per storage account; the
422
+ # replacement/change of custom domain is not supported. In order to replace an
423
+ # old custom domain, the old value must be cleared/unregistered before a new
424
+ # value can be set. The update of multiple properties is supported. This call
425
+ # does not change the storage keys for the account. If you want to change the
426
+ # storage account keys, use the regenerate keys operation. The location and
427
+ # name of the storage account cannot be changed after creation.
428
+ #
429
+ # @param resource_group_name [String] The name of the resource group within the
430
+ # user's subscription. The name is case insensitive.
431
+ # @param account_name [String] The name of the storage account within the
432
+ # specified resource group. Storage account names must be between 3 and 24
433
+ # characters in length and use numbers and lower-case letters only.
434
+ # @param parameters [StorageAccountUpdateParameters] The parameters to provide
435
+ # for the updated account.
436
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
437
+ # will be added to the HTTP request.
438
+ #
439
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
440
+ #
441
+ def update_with_http_info(resource_group_name, account_name, parameters, custom_headers = nil)
442
+ update_async(resource_group_name, account_name, parameters, custom_headers).value!
443
+ end
444
+
445
+ #
446
+ # The update operation can be used to update the SKU, encryption, access tier,
447
+ # or tags for a storage account. It can also be used to map the account to a
448
+ # custom domain. Only one custom domain is supported per storage account; the
449
+ # replacement/change of custom domain is not supported. In order to replace an
450
+ # old custom domain, the old value must be cleared/unregistered before a new
451
+ # value can be set. The update of multiple properties is supported. This call
452
+ # does not change the storage keys for the account. If you want to change the
453
+ # storage account keys, use the regenerate keys operation. The location and
454
+ # name of the storage account cannot be changed after creation.
455
+ #
456
+ # @param resource_group_name [String] The name of the resource group within the
457
+ # user's subscription. The name is case insensitive.
458
+ # @param account_name [String] The name of the storage account within the
459
+ # specified resource group. Storage account names must be between 3 and 24
460
+ # characters in length and use numbers and lower-case letters only.
461
+ # @param parameters [StorageAccountUpdateParameters] The parameters to provide
462
+ # for the updated account.
463
+ # @param [Hash{String => String}] A hash of custom headers that will be added
464
+ # to the HTTP request.
465
+ #
466
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
467
+ #
468
+ def update_async(resource_group_name, account_name, parameters, custom_headers = nil)
469
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
470
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
471
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
472
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
473
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
474
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
475
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
476
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
477
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
478
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
479
+
480
+
481
+ request_headers = {}
482
+
483
+ # Set Headers
484
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
485
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
486
+
487
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
488
+
489
+ # Serialize Request
490
+ request_mapper = Azure::Storage::Mgmt::V2017_10_01::Models::StorageAccountUpdateParameters.mapper()
491
+ request_content = @client.serialize(request_mapper, parameters)
492
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
493
+
494
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'
495
+
496
+ request_url = @base_url || @client.base_url
497
+
498
+ options = {
499
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
500
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
501
+ query_params: {'api-version' => @client.api_version},
502
+ body: request_content,
503
+ headers: request_headers.merge(custom_headers || {}),
504
+ base_url: request_url
505
+ }
506
+ promise = @client.make_request_async(:patch, path_template, options)
507
+
508
+ promise = promise.then do |result|
509
+ http_response = result.response
510
+ status_code = http_response.status
511
+ response_content = http_response.body
512
+ unless status_code == 200
513
+ error_model = JSON.load(response_content)
514
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
515
+ end
516
+
517
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
518
+ # Deserialize Response
519
+ if status_code == 200
520
+ begin
521
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
522
+ result_mapper = Azure::Storage::Mgmt::V2017_10_01::Models::StorageAccount.mapper()
523
+ result.body = @client.deserialize(result_mapper, parsed_response)
524
+ rescue Exception => e
525
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
526
+ end
527
+ end
528
+
529
+ result
530
+ end
531
+
532
+ promise.execute
533
+ end
534
+
535
+ #
536
+ # Lists all the storage accounts available under the subscription. Note that
537
+ # storage keys are not returned; use the ListKeys operation for this.
538
+ #
539
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
540
+ # will be added to the HTTP request.
541
+ #
542
+ # @return [StorageAccountListResult] operation results.
543
+ #
544
+ def list(custom_headers = nil)
545
+ response = list_async(custom_headers).value!
546
+ response.body unless response.nil?
547
+ end
548
+
549
+ #
550
+ # Lists all the storage accounts available under the subscription. Note that
551
+ # storage keys are not returned; use the ListKeys operation for this.
552
+ #
553
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
554
+ # will be added to the HTTP request.
555
+ #
556
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
557
+ #
558
+ def list_with_http_info(custom_headers = nil)
559
+ list_async(custom_headers).value!
560
+ end
561
+
562
+ #
563
+ # Lists all the storage accounts available under the subscription. Note that
564
+ # storage keys are not returned; use the ListKeys operation for this.
565
+ #
566
+ # @param [Hash{String => String}] A hash of custom headers that will be added
567
+ # to the HTTP request.
568
+ #
569
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
570
+ #
571
+ def list_async(custom_headers = nil)
572
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
573
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
574
+
575
+
576
+ request_headers = {}
577
+
578
+ # Set Headers
579
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
580
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
581
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts'
582
+
583
+ request_url = @base_url || @client.base_url
584
+
585
+ options = {
586
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
587
+ path_params: {'subscriptionId' => @client.subscription_id},
588
+ query_params: {'api-version' => @client.api_version},
589
+ headers: request_headers.merge(custom_headers || {}),
590
+ base_url: request_url
591
+ }
592
+ promise = @client.make_request_async(:get, path_template, options)
593
+
594
+ promise = promise.then do |result|
595
+ http_response = result.response
596
+ status_code = http_response.status
597
+ response_content = http_response.body
598
+ unless status_code == 200
599
+ error_model = JSON.load(response_content)
600
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
601
+ end
602
+
603
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
604
+ # Deserialize Response
605
+ if status_code == 200
606
+ begin
607
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
608
+ result_mapper = Azure::Storage::Mgmt::V2017_10_01::Models::StorageAccountListResult.mapper()
609
+ result.body = @client.deserialize(result_mapper, parsed_response)
610
+ rescue Exception => e
611
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
612
+ end
613
+ end
614
+
615
+ result
616
+ end
617
+
618
+ promise.execute
619
+ end
620
+
621
+ #
622
+ # Lists all the storage accounts available under the given resource group. Note
623
+ # that storage keys are not returned; use the ListKeys operation for this.
624
+ #
625
+ # @param resource_group_name [String] The name of the resource group within the
626
+ # user's subscription. The name is case insensitive.
627
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
628
+ # will be added to the HTTP request.
629
+ #
630
+ # @return [StorageAccountListResult] operation results.
631
+ #
632
+ def list_by_resource_group(resource_group_name, custom_headers = nil)
633
+ response = list_by_resource_group_async(resource_group_name, custom_headers).value!
634
+ response.body unless response.nil?
635
+ end
636
+
637
+ #
638
+ # Lists all the storage accounts available under the given resource group. Note
639
+ # that storage keys are not returned; use the ListKeys operation for this.
640
+ #
641
+ # @param resource_group_name [String] The name of the resource group within the
642
+ # user's subscription. The name is case insensitive.
643
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
644
+ # will be added to the HTTP request.
645
+ #
646
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
647
+ #
648
+ def list_by_resource_group_with_http_info(resource_group_name, custom_headers = nil)
649
+ list_by_resource_group_async(resource_group_name, custom_headers).value!
650
+ end
651
+
652
+ #
653
+ # Lists all the storage accounts available under the given resource group. Note
654
+ # that storage keys are not returned; use the ListKeys operation for this.
655
+ #
656
+ # @param resource_group_name [String] The name of the resource group within the
657
+ # user's subscription. The name is case insensitive.
658
+ # @param [Hash{String => String}] A hash of custom headers that will be added
659
+ # to the HTTP request.
660
+ #
661
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
662
+ #
663
+ def list_by_resource_group_async(resource_group_name, custom_headers = nil)
664
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
665
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
666
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
667
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
668
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
669
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
670
+
671
+
672
+ request_headers = {}
673
+
674
+ # Set Headers
675
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
676
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
677
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts'
678
+
679
+ request_url = @base_url || @client.base_url
680
+
681
+ options = {
682
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
683
+ path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
684
+ query_params: {'api-version' => @client.api_version},
685
+ headers: request_headers.merge(custom_headers || {}),
686
+ base_url: request_url
687
+ }
688
+ promise = @client.make_request_async(:get, path_template, options)
689
+
690
+ promise = promise.then do |result|
691
+ http_response = result.response
692
+ status_code = http_response.status
693
+ response_content = http_response.body
694
+ unless status_code == 200
695
+ error_model = JSON.load(response_content)
696
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
697
+ end
698
+
699
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
700
+ # Deserialize Response
701
+ if status_code == 200
702
+ begin
703
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
704
+ result_mapper = Azure::Storage::Mgmt::V2017_10_01::Models::StorageAccountListResult.mapper()
705
+ result.body = @client.deserialize(result_mapper, parsed_response)
706
+ rescue Exception => e
707
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
708
+ end
709
+ end
710
+
711
+ result
712
+ end
713
+
714
+ promise.execute
715
+ end
716
+
717
+ #
718
+ # Lists the access keys for the specified storage account.
719
+ #
720
+ # @param resource_group_name [String] The name of the resource group within the
721
+ # user's subscription. The name is case insensitive.
722
+ # @param account_name [String] The name of the storage account within the
723
+ # specified resource group. Storage account names must be between 3 and 24
724
+ # characters in length and use numbers and lower-case letters only.
725
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
726
+ # will be added to the HTTP request.
727
+ #
728
+ # @return [StorageAccountListKeysResult] operation results.
729
+ #
730
+ def list_keys(resource_group_name, account_name, custom_headers = nil)
731
+ response = list_keys_async(resource_group_name, account_name, custom_headers).value!
732
+ response.body unless response.nil?
733
+ end
734
+
735
+ #
736
+ # Lists the access keys for the specified storage account.
737
+ #
738
+ # @param resource_group_name [String] The name of the resource group within the
739
+ # user's subscription. The name is case insensitive.
740
+ # @param account_name [String] The name of the storage account within the
741
+ # specified resource group. Storage account names must be between 3 and 24
742
+ # characters in length and use numbers and lower-case letters only.
743
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
744
+ # will be added to the HTTP request.
745
+ #
746
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
747
+ #
748
+ def list_keys_with_http_info(resource_group_name, account_name, custom_headers = nil)
749
+ list_keys_async(resource_group_name, account_name, custom_headers).value!
750
+ end
751
+
752
+ #
753
+ # Lists the access keys for the specified storage account.
754
+ #
755
+ # @param resource_group_name [String] The name of the resource group within the
756
+ # user's subscription. The name is case insensitive.
757
+ # @param account_name [String] The name of the storage account within the
758
+ # specified resource group. Storage account names must be between 3 and 24
759
+ # characters in length and use numbers and lower-case letters only.
760
+ # @param [Hash{String => String}] A hash of custom headers that will be added
761
+ # to the HTTP request.
762
+ #
763
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
764
+ #
765
+ def list_keys_async(resource_group_name, account_name, custom_headers = nil)
766
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
767
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
768
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
769
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
770
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
771
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
772
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
773
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
774
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
775
+
776
+
777
+ request_headers = {}
778
+
779
+ # Set Headers
780
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
781
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
782
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys'
783
+
784
+ request_url = @base_url || @client.base_url
785
+
786
+ options = {
787
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
788
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
789
+ query_params: {'api-version' => @client.api_version},
790
+ headers: request_headers.merge(custom_headers || {}),
791
+ base_url: request_url
792
+ }
793
+ promise = @client.make_request_async(:post, path_template, options)
794
+
795
+ promise = promise.then do |result|
796
+ http_response = result.response
797
+ status_code = http_response.status
798
+ response_content = http_response.body
799
+ unless status_code == 200
800
+ error_model = JSON.load(response_content)
801
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
802
+ end
803
+
804
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
805
+ # Deserialize Response
806
+ if status_code == 200
807
+ begin
808
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
809
+ result_mapper = Azure::Storage::Mgmt::V2017_10_01::Models::StorageAccountListKeysResult.mapper()
810
+ result.body = @client.deserialize(result_mapper, parsed_response)
811
+ rescue Exception => e
812
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
813
+ end
814
+ end
815
+
816
+ result
817
+ end
818
+
819
+ promise.execute
820
+ end
821
+
822
+ #
823
+ # Regenerates one of the access keys for the specified storage account.
824
+ #
825
+ # @param resource_group_name [String] The name of the resource group within the
826
+ # user's subscription. The name is case insensitive.
827
+ # @param account_name [String] The name of the storage account within the
828
+ # specified resource group. Storage account names must be between 3 and 24
829
+ # characters in length and use numbers and lower-case letters only.
830
+ # @param regenerate_key [StorageAccountRegenerateKeyParameters] Specifies name
831
+ # of the key which should be regenerated -- key1 or key2.
832
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
833
+ # will be added to the HTTP request.
834
+ #
835
+ # @return [StorageAccountListKeysResult] operation results.
836
+ #
837
+ def regenerate_key(resource_group_name, account_name, regenerate_key, custom_headers = nil)
838
+ response = regenerate_key_async(resource_group_name, account_name, regenerate_key, custom_headers).value!
839
+ response.body unless response.nil?
840
+ end
841
+
842
+ #
843
+ # Regenerates one of the access keys for the specified storage account.
844
+ #
845
+ # @param resource_group_name [String] The name of the resource group within the
846
+ # user's subscription. The name is case insensitive.
847
+ # @param account_name [String] The name of the storage account within the
848
+ # specified resource group. Storage account names must be between 3 and 24
849
+ # characters in length and use numbers and lower-case letters only.
850
+ # @param regenerate_key [StorageAccountRegenerateKeyParameters] Specifies name
851
+ # of the key which should be regenerated -- key1 or key2.
852
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
853
+ # will be added to the HTTP request.
854
+ #
855
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
856
+ #
857
+ def regenerate_key_with_http_info(resource_group_name, account_name, regenerate_key, custom_headers = nil)
858
+ regenerate_key_async(resource_group_name, account_name, regenerate_key, custom_headers).value!
859
+ end
860
+
861
+ #
862
+ # Regenerates one of the access keys for the specified storage account.
863
+ #
864
+ # @param resource_group_name [String] The name of the resource group within the
865
+ # user's subscription. The name is case insensitive.
866
+ # @param account_name [String] The name of the storage account within the
867
+ # specified resource group. Storage account names must be between 3 and 24
868
+ # characters in length and use numbers and lower-case letters only.
869
+ # @param regenerate_key [StorageAccountRegenerateKeyParameters] Specifies name
870
+ # of the key which should be regenerated -- key1 or key2.
871
+ # @param [Hash{String => String}] A hash of custom headers that will be added
872
+ # to the HTTP request.
873
+ #
874
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
875
+ #
876
+ def regenerate_key_async(resource_group_name, account_name, regenerate_key, custom_headers = nil)
877
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
878
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
879
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
880
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
881
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
882
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
883
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
884
+ fail ArgumentError, 'regenerate_key is nil' if regenerate_key.nil?
885
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
886
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
887
+
888
+
889
+ request_headers = {}
890
+
891
+ # Set Headers
892
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
893
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
894
+
895
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
896
+
897
+ # Serialize Request
898
+ request_mapper = Azure::Storage::Mgmt::V2017_10_01::Models::StorageAccountRegenerateKeyParameters.mapper()
899
+ request_content = @client.serialize(request_mapper, regenerate_key)
900
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
901
+
902
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey'
903
+
904
+ request_url = @base_url || @client.base_url
905
+
906
+ options = {
907
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
908
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
909
+ query_params: {'api-version' => @client.api_version},
910
+ body: request_content,
911
+ headers: request_headers.merge(custom_headers || {}),
912
+ base_url: request_url
913
+ }
914
+ promise = @client.make_request_async(:post, path_template, options)
915
+
916
+ promise = promise.then do |result|
917
+ http_response = result.response
918
+ status_code = http_response.status
919
+ response_content = http_response.body
920
+ unless status_code == 200
921
+ error_model = JSON.load(response_content)
922
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
923
+ end
924
+
925
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
926
+ # Deserialize Response
927
+ if status_code == 200
928
+ begin
929
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
930
+ result_mapper = Azure::Storage::Mgmt::V2017_10_01::Models::StorageAccountListKeysResult.mapper()
931
+ result.body = @client.deserialize(result_mapper, parsed_response)
932
+ rescue Exception => e
933
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
934
+ end
935
+ end
936
+
937
+ result
938
+ end
939
+
940
+ promise.execute
941
+ end
942
+
943
+ #
944
+ # List SAS credentials of a storage account.
945
+ #
946
+ # @param resource_group_name [String] The name of the resource group within the
947
+ # user's subscription. The name is case insensitive.
948
+ # @param account_name [String] The name of the storage account within the
949
+ # specified resource group. Storage account names must be between 3 and 24
950
+ # characters in length and use numbers and lower-case letters only.
951
+ # @param parameters [AccountSasParameters] The parameters to provide to list
952
+ # SAS credentials for the storage account.
953
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
954
+ # will be added to the HTTP request.
955
+ #
956
+ # @return [ListAccountSasResponse] operation results.
957
+ #
958
+ def list_account_sas(resource_group_name, account_name, parameters, custom_headers = nil)
959
+ response = list_account_sas_async(resource_group_name, account_name, parameters, custom_headers).value!
960
+ response.body unless response.nil?
961
+ end
962
+
963
+ #
964
+ # List SAS credentials of a storage account.
965
+ #
966
+ # @param resource_group_name [String] The name of the resource group within the
967
+ # user's subscription. The name is case insensitive.
968
+ # @param account_name [String] The name of the storage account within the
969
+ # specified resource group. Storage account names must be between 3 and 24
970
+ # characters in length and use numbers and lower-case letters only.
971
+ # @param parameters [AccountSasParameters] The parameters to provide to list
972
+ # SAS credentials for the storage account.
973
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
974
+ # will be added to the HTTP request.
975
+ #
976
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
977
+ #
978
+ def list_account_sas_with_http_info(resource_group_name, account_name, parameters, custom_headers = nil)
979
+ list_account_sas_async(resource_group_name, account_name, parameters, custom_headers).value!
980
+ end
981
+
982
+ #
983
+ # List SAS credentials of a storage account.
984
+ #
985
+ # @param resource_group_name [String] The name of the resource group within the
986
+ # user's subscription. The name is case insensitive.
987
+ # @param account_name [String] The name of the storage account within the
988
+ # specified resource group. Storage account names must be between 3 and 24
989
+ # characters in length and use numbers and lower-case letters only.
990
+ # @param parameters [AccountSasParameters] The parameters to provide to list
991
+ # SAS credentials for the storage account.
992
+ # @param [Hash{String => String}] A hash of custom headers that will be added
993
+ # to the HTTP request.
994
+ #
995
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
996
+ #
997
+ def list_account_sas_async(resource_group_name, account_name, parameters, custom_headers = nil)
998
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
999
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1000
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1001
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1002
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
1003
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
1004
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
1005
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1006
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1007
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1008
+
1009
+
1010
+ request_headers = {}
1011
+
1012
+ # Set Headers
1013
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1014
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1015
+
1016
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1017
+
1018
+ # Serialize Request
1019
+ request_mapper = Azure::Storage::Mgmt::V2017_10_01::Models::AccountSasParameters.mapper()
1020
+ request_content = @client.serialize(request_mapper, parameters)
1021
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1022
+
1023
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas'
1024
+
1025
+ request_url = @base_url || @client.base_url
1026
+
1027
+ options = {
1028
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1029
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
1030
+ query_params: {'api-version' => @client.api_version},
1031
+ body: request_content,
1032
+ headers: request_headers.merge(custom_headers || {}),
1033
+ base_url: request_url
1034
+ }
1035
+ promise = @client.make_request_async(:post, path_template, options)
1036
+
1037
+ promise = promise.then do |result|
1038
+ http_response = result.response
1039
+ status_code = http_response.status
1040
+ response_content = http_response.body
1041
+ unless status_code == 200
1042
+ error_model = JSON.load(response_content)
1043
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1044
+ end
1045
+
1046
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1047
+ # Deserialize Response
1048
+ if status_code == 200
1049
+ begin
1050
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1051
+ result_mapper = Azure::Storage::Mgmt::V2017_10_01::Models::ListAccountSasResponse.mapper()
1052
+ result.body = @client.deserialize(result_mapper, parsed_response)
1053
+ rescue Exception => e
1054
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1055
+ end
1056
+ end
1057
+
1058
+ result
1059
+ end
1060
+
1061
+ promise.execute
1062
+ end
1063
+
1064
+ #
1065
+ # List service SAS credentials of a specific resource.
1066
+ #
1067
+ # @param resource_group_name [String] The name of the resource group within the
1068
+ # user's subscription. The name is case insensitive.
1069
+ # @param account_name [String] The name of the storage account within the
1070
+ # specified resource group. Storage account names must be between 3 and 24
1071
+ # characters in length and use numbers and lower-case letters only.
1072
+ # @param parameters [ServiceSasParameters] The parameters to provide to list
1073
+ # service SAS credentials.
1074
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1075
+ # will be added to the HTTP request.
1076
+ #
1077
+ # @return [ListServiceSasResponse] operation results.
1078
+ #
1079
+ def list_service_sas(resource_group_name, account_name, parameters, custom_headers = nil)
1080
+ response = list_service_sas_async(resource_group_name, account_name, parameters, custom_headers).value!
1081
+ response.body unless response.nil?
1082
+ end
1083
+
1084
+ #
1085
+ # List service SAS credentials of a specific resource.
1086
+ #
1087
+ # @param resource_group_name [String] The name of the resource group within the
1088
+ # user's subscription. The name is case insensitive.
1089
+ # @param account_name [String] The name of the storage account within the
1090
+ # specified resource group. Storage account names must be between 3 and 24
1091
+ # characters in length and use numbers and lower-case letters only.
1092
+ # @param parameters [ServiceSasParameters] The parameters to provide to list
1093
+ # service SAS credentials.
1094
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1095
+ # will be added to the HTTP request.
1096
+ #
1097
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1098
+ #
1099
+ def list_service_sas_with_http_info(resource_group_name, account_name, parameters, custom_headers = nil)
1100
+ list_service_sas_async(resource_group_name, account_name, parameters, custom_headers).value!
1101
+ end
1102
+
1103
+ #
1104
+ # List service SAS credentials of a specific resource.
1105
+ #
1106
+ # @param resource_group_name [String] The name of the resource group within the
1107
+ # user's subscription. The name is case insensitive.
1108
+ # @param account_name [String] The name of the storage account within the
1109
+ # specified resource group. Storage account names must be between 3 and 24
1110
+ # characters in length and use numbers and lower-case letters only.
1111
+ # @param parameters [ServiceSasParameters] The parameters to provide to list
1112
+ # service SAS credentials.
1113
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1114
+ # to the HTTP request.
1115
+ #
1116
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1117
+ #
1118
+ def list_service_sas_async(resource_group_name, account_name, parameters, custom_headers = nil)
1119
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1120
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1121
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1122
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1123
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
1124
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
1125
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
1126
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1127
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1128
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1129
+
1130
+
1131
+ request_headers = {}
1132
+
1133
+ # Set Headers
1134
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1135
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1136
+
1137
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1138
+
1139
+ # Serialize Request
1140
+ request_mapper = Azure::Storage::Mgmt::V2017_10_01::Models::ServiceSasParameters.mapper()
1141
+ request_content = @client.serialize(request_mapper, parameters)
1142
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1143
+
1144
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas'
1145
+
1146
+ request_url = @base_url || @client.base_url
1147
+
1148
+ options = {
1149
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1150
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
1151
+ query_params: {'api-version' => @client.api_version},
1152
+ body: request_content,
1153
+ headers: request_headers.merge(custom_headers || {}),
1154
+ base_url: request_url
1155
+ }
1156
+ promise = @client.make_request_async(:post, path_template, options)
1157
+
1158
+ promise = promise.then do |result|
1159
+ http_response = result.response
1160
+ status_code = http_response.status
1161
+ response_content = http_response.body
1162
+ unless status_code == 200
1163
+ error_model = JSON.load(response_content)
1164
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1165
+ end
1166
+
1167
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1168
+ # Deserialize Response
1169
+ if status_code == 200
1170
+ begin
1171
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1172
+ result_mapper = Azure::Storage::Mgmt::V2017_10_01::Models::ListServiceSasResponse.mapper()
1173
+ result.body = @client.deserialize(result_mapper, parsed_response)
1174
+ rescue Exception => e
1175
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1176
+ end
1177
+ end
1178
+
1179
+ result
1180
+ end
1181
+
1182
+ promise.execute
1183
+ end
1184
+
1185
+ #
1186
+ # Asynchronously creates a new storage account with the specified parameters.
1187
+ # If an account is already created and a subsequent create request is issued
1188
+ # with different properties, the account properties will be updated. If an
1189
+ # account is already created and a subsequent create or update request is
1190
+ # issued with the exact same set of properties, the request will succeed.
1191
+ #
1192
+ # @param resource_group_name [String] The name of the resource group within the
1193
+ # user's subscription. The name is case insensitive.
1194
+ # @param account_name [String] The name of the storage account within the
1195
+ # specified resource group. Storage account names must be between 3 and 24
1196
+ # characters in length and use numbers and lower-case letters only.
1197
+ # @param parameters [StorageAccountCreateParameters] The parameters to provide
1198
+ # for the created account.
1199
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1200
+ # will be added to the HTTP request.
1201
+ #
1202
+ # @return [StorageAccount] operation results.
1203
+ #
1204
+ def begin_create(resource_group_name, account_name, parameters, custom_headers = nil)
1205
+ response = begin_create_async(resource_group_name, account_name, parameters, custom_headers).value!
1206
+ response.body unless response.nil?
1207
+ end
1208
+
1209
+ #
1210
+ # Asynchronously creates a new storage account with the specified parameters.
1211
+ # If an account is already created and a subsequent create request is issued
1212
+ # with different properties, the account properties will be updated. If an
1213
+ # account is already created and a subsequent create or update request is
1214
+ # issued with the exact same set of properties, the request will succeed.
1215
+ #
1216
+ # @param resource_group_name [String] The name of the resource group within the
1217
+ # user's subscription. The name is case insensitive.
1218
+ # @param account_name [String] The name of the storage account within the
1219
+ # specified resource group. Storage account names must be between 3 and 24
1220
+ # characters in length and use numbers and lower-case letters only.
1221
+ # @param parameters [StorageAccountCreateParameters] The parameters to provide
1222
+ # for the created account.
1223
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1224
+ # will be added to the HTTP request.
1225
+ #
1226
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1227
+ #
1228
+ def begin_create_with_http_info(resource_group_name, account_name, parameters, custom_headers = nil)
1229
+ begin_create_async(resource_group_name, account_name, parameters, custom_headers).value!
1230
+ end
1231
+
1232
+ #
1233
+ # Asynchronously creates a new storage account with the specified parameters.
1234
+ # If an account is already created and a subsequent create request is issued
1235
+ # with different properties, the account properties will be updated. If an
1236
+ # account is already created and a subsequent create or update request is
1237
+ # issued with the exact same set of properties, the request will succeed.
1238
+ #
1239
+ # @param resource_group_name [String] The name of the resource group within the
1240
+ # user's subscription. The name is case insensitive.
1241
+ # @param account_name [String] The name of the storage account within the
1242
+ # specified resource group. Storage account names must be between 3 and 24
1243
+ # characters in length and use numbers and lower-case letters only.
1244
+ # @param parameters [StorageAccountCreateParameters] The parameters to provide
1245
+ # for the created account.
1246
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1247
+ # to the HTTP request.
1248
+ #
1249
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1250
+ #
1251
+ def begin_create_async(resource_group_name, account_name, parameters, custom_headers = nil)
1252
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1253
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1254
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1255
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1256
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
1257
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
1258
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
1259
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1260
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1261
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1262
+
1263
+
1264
+ request_headers = {}
1265
+
1266
+ # Set Headers
1267
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1268
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1269
+
1270
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1271
+
1272
+ # Serialize Request
1273
+ request_mapper = Azure::Storage::Mgmt::V2017_10_01::Models::StorageAccountCreateParameters.mapper()
1274
+ request_content = @client.serialize(request_mapper, parameters)
1275
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1276
+
1277
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'
1278
+
1279
+ request_url = @base_url || @client.base_url
1280
+
1281
+ options = {
1282
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1283
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
1284
+ query_params: {'api-version' => @client.api_version},
1285
+ body: request_content,
1286
+ headers: request_headers.merge(custom_headers || {}),
1287
+ base_url: request_url
1288
+ }
1289
+ promise = @client.make_request_async(:put, path_template, options)
1290
+
1291
+ promise = promise.then do |result|
1292
+ http_response = result.response
1293
+ status_code = http_response.status
1294
+ response_content = http_response.body
1295
+ unless status_code == 200 || status_code == 202
1296
+ error_model = JSON.load(response_content)
1297
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1298
+ end
1299
+
1300
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1301
+ # Deserialize Response
1302
+ if status_code == 200
1303
+ begin
1304
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1305
+ result_mapper = Azure::Storage::Mgmt::V2017_10_01::Models::StorageAccount.mapper()
1306
+ result.body = @client.deserialize(result_mapper, parsed_response)
1307
+ rescue Exception => e
1308
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1309
+ end
1310
+ end
1311
+
1312
+ result
1313
+ end
1314
+
1315
+ promise.execute
1316
+ end
1317
+
1318
+ end
1319
+ end