azure_mgmt_storage 0.21.2 → 0.22.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (194) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2015-05-01-preview/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
  3. data/lib/2015-06-15/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
  4. data/lib/2016-01-01/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
  5. data/lib/2016-12-01/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
  6. data/lib/2017-06-01/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
  7. data/lib/2017-10-01/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
  8. data/lib/2018-02-01/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
  9. data/lib/2018-03-01-preview/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
  10. data/lib/2018-07-01/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
  11. data/lib/2018-11-01/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
  12. data/lib/2019-04-01/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
  13. data/lib/2019-06-01/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
  14. data/lib/2020-08-01-preview/generated/azure_mgmt_storage.rb +201 -0
  15. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/blob_containers.rb +2046 -0
  16. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/blob_services.rb +383 -0
  17. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/deleted_accounts.rb +321 -0
  18. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/encryption_scopes.rb +691 -0
  19. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/file_services.rb +377 -0
  20. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/file_shares.rb +940 -0
  21. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/management_policies.rb +361 -0
  22. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/access_tier.rb +16 -0
  23. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/account_sas_parameters.rb +136 -0
  24. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/account_status.rb +16 -0
  25. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/action.rb +15 -0
  26. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/active_directory_properties.rb +103 -0
  27. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/azure_entity_resource.rb +75 -0
  28. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/azure_files_identity_based_authentication.rb +59 -0
  29. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/blob_container.rb +290 -0
  30. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/blob_restore_parameters.rb +66 -0
  31. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/blob_restore_progress_status.rb +17 -0
  32. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/blob_restore_range.rb +59 -0
  33. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/blob_restore_status.rb +88 -0
  34. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/blob_service_items.rb +57 -0
  35. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/blob_service_properties.rb +178 -0
  36. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/bypass.rb +18 -0
  37. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/change_feed.rb +47 -0
  38. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/check_name_availability_result.rb +77 -0
  39. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/cors_rule.rb +128 -0
  40. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/cors_rules.rb +57 -0
  41. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/custom_domain.rb +60 -0
  42. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/date_after_creation.rb +50 -0
  43. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/date_after_modification.rb +51 -0
  44. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/default_action.rb +16 -0
  45. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/delete_retention_policy.rb +63 -0
  46. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/deleted_account.rb +123 -0
  47. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/deleted_account_list_result.rb +103 -0
  48. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/deleted_share.rb +59 -0
  49. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/dimension.rb +57 -0
  50. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/directory_service_options.rb +17 -0
  51. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/enabled_protocols.rb +16 -0
  52. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/encryption.rb +87 -0
  53. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/encryption_scope.rb +129 -0
  54. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/encryption_scope_key_vault_properties.rb +51 -0
  55. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/encryption_scope_list_result.rb +103 -0
  56. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/encryption_scope_source.rb +16 -0
  57. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/encryption_scope_state.rb +16 -0
  58. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/encryption_service.rb +76 -0
  59. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/encryption_services.rb +87 -0
  60. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/endpoints.rb +134 -0
  61. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/error_response.rb +48 -0
  62. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/error_response_body.rb +59 -0
  63. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/file_service_items.rb +57 -0
  64. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/file_service_properties.rb +103 -0
  65. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/file_share.rb +251 -0
  66. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/file_share_item.rb +250 -0
  67. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/file_share_items.rb +103 -0
  68. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/geo_replication_stats.rb +85 -0
  69. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/geo_replication_status.rb +17 -0
  70. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/get_share_expand.rb +15 -0
  71. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/http_protocol.rb +16 -0
  72. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/identity.rb +72 -0
  73. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/immutability_policy.rb +114 -0
  74. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/immutability_policy_properties.rb +111 -0
  75. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/immutability_policy_state.rb +16 -0
  76. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/immutability_policy_update_type.rb +17 -0
  77. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/iprule.rb +61 -0
  78. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/key_permission.rb +16 -0
  79. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/key_source.rb +16 -0
  80. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/key_type.rb +16 -0
  81. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/key_vault_properties.rb +93 -0
  82. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/kind.rb +19 -0
  83. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/large_file_shares_state.rb +16 -0
  84. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/lease_container_request.rb +97 -0
  85. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/lease_container_response.rb +60 -0
  86. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/lease_duration.rb +16 -0
  87. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/lease_state.rb +19 -0
  88. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/lease_status.rb +16 -0
  89. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/legal_hold.rb +71 -0
  90. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/legal_hold_properties.rb +72 -0
  91. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/list_account_sas_response.rb +47 -0
  92. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/list_container_item.rb +289 -0
  93. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/list_container_items.rb +103 -0
  94. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/list_containers_include.rb +15 -0
  95. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/list_key_expand.rb +15 -0
  96. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/list_queue.rb +83 -0
  97. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/list_queue_resource.rb +101 -0
  98. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/list_queue_services.rb +58 -0
  99. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/list_service_sas_response.rb +47 -0
  100. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/list_shares_expand.rb +15 -0
  101. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/list_table_resource.rb +101 -0
  102. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/list_table_services.rb +58 -0
  103. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/management_policy.rb +89 -0
  104. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/management_policy_action.rb +62 -0
  105. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/management_policy_base_blob.rb +73 -0
  106. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/management_policy_definition.rb +60 -0
  107. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/management_policy_filter.rb +97 -0
  108. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/management_policy_rule.rb +87 -0
  109. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/management_policy_schema.rb +58 -0
  110. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/management_policy_snap_shot.rb +47 -0
  111. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/metric_specification.rb +145 -0
  112. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/minimum_tls_version.rb +17 -0
  113. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/network_rule_set.rb +106 -0
  114. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/object_replication_policies.rb +56 -0
  115. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/object_replication_policy.rb +131 -0
  116. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/object_replication_policy_filter.rb +70 -0
  117. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/object_replication_policy_rule.rb +82 -0
  118. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/operation.rb +83 -0
  119. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/operation_display.rb +79 -0
  120. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/operation_list_result.rb +57 -0
  121. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/permissions.rb +22 -0
  122. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/private_endpoint.rb +47 -0
  123. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/private_endpoint_connection.rb +101 -0
  124. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/private_endpoint_connection_list_result.rb +57 -0
  125. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/private_endpoint_connection_provisioning_state.rb +18 -0
  126. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/private_endpoint_service_connection_status.rb +17 -0
  127. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/private_link_resource.rb +115 -0
  128. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/private_link_resource_list_result.rb +55 -0
  129. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/private_link_service_connection_state.rb +72 -0
  130. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/provisioning_state.rb +17 -0
  131. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/proxy_resource.rb +63 -0
  132. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/public_access.rb +17 -0
  133. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/queue_service_properties.rb +77 -0
  134. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/reason.rb +16 -0
  135. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/reason_code.rb +16 -0
  136. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/resource.rb +83 -0
  137. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/restore_policy_properties.rb +87 -0
  138. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/restriction.rb +85 -0
  139. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/root_squash_type.rb +17 -0
  140. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/routing_choice.rb +16 -0
  141. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/routing_preference.rb +74 -0
  142. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/service_sas_parameters.rb +247 -0
  143. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/service_specification.rb +56 -0
  144. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/services.rb +18 -0
  145. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/share_access_tier.rb +18 -0
  146. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/signed_resource.rb +18 -0
  147. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/signed_resource_types.rb +17 -0
  148. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/sku.rb +60 -0
  149. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/sku_information.rb +153 -0
  150. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/sku_name.rb +22 -0
  151. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/sku_tier.rb +16 -0
  152. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/skucapability.rb +63 -0
  153. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/state.rb +19 -0
  154. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/storage_account.rb +462 -0
  155. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/storage_account_check_name_availability_parameters.rb +63 -0
  156. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/storage_account_create_parameters.rb +254 -0
  157. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/storage_account_expand.rb +16 -0
  158. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/storage_account_internet_endpoints.rb +84 -0
  159. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/storage_account_key.rb +73 -0
  160. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/storage_account_list_keys_result.rb +57 -0
  161. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/storage_account_list_result.rb +103 -0
  162. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/storage_account_microsoft_endpoints.rb +108 -0
  163. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/storage_account_regenerate_key_parameters.rb +47 -0
  164. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/storage_account_update_parameters.rb +231 -0
  165. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/storage_queue.rb +97 -0
  166. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/storage_sku_list_result.rb +57 -0
  167. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/table.rb +74 -0
  168. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/table_service_properties.rb +77 -0
  169. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/tag_filter.rb +80 -0
  170. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/tag_property.rb +97 -0
  171. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/tracked_resource.rb +92 -0
  172. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/update_history_property.rb +114 -0
  173. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/usage.rb +89 -0
  174. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/usage_list_result.rb +56 -0
  175. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/usage_name.rb +59 -0
  176. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/usage_unit.rb +20 -0
  177. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/virtual_network_rule.rb +75 -0
  178. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/module_definition.rb +9 -0
  179. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/object_replication_policies_operations.rb +495 -0
  180. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/operations.rb +110 -0
  181. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/private_endpoint_connections.rb +501 -0
  182. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/private_link_resources.rb +138 -0
  183. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/queue.rb +805 -0
  184. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/queue_services.rb +386 -0
  185. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/skus.rb +116 -0
  186. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/storage_accounts.rb +1943 -0
  187. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/storage_management_client.rb +200 -0
  188. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/table_operations.rb +743 -0
  189. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/table_services.rb +386 -0
  190. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/usages.rb +120 -0
  191. data/lib/azure_mgmt_storage.rb +10 -9
  192. data/lib/profiles/latest/modules/storage_profile_module.rb +391 -377
  193. data/lib/version.rb +1 -1
  194. metadata +180 -3
@@ -0,0 +1,1943 @@
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::V2020_08_01_preview
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: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: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.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
73
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
74
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
75
+
76
+
77
+ request_headers = {}
78
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
79
+
80
+ # Set Headers
81
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
82
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
83
+
84
+ # Serialize Request
85
+ request_mapper = Azure::Storage::Mgmt::V2020_08_01_preview::Models::StorageAccountCheckNameAvailabilityParameters.mapper()
86
+ request_content = @client.serialize(request_mapper, account_name)
87
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
88
+
89
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability'
90
+
91
+ request_url = @base_url || @client.base_url
92
+
93
+ options = {
94
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
95
+ path_params: {'subscriptionId' => @client.subscription_id},
96
+ query_params: {'api-version' => @client.api_version},
97
+ body: request_content,
98
+ headers: request_headers.merge(custom_headers || {}),
99
+ base_url: request_url
100
+ }
101
+ promise = @client.make_request_async(:post, path_template, options)
102
+
103
+ promise = promise.then do |result|
104
+ http_response = result.response
105
+ status_code = http_response.status
106
+ response_content = http_response.body
107
+ unless status_code == 200
108
+ error_model = JSON.load(response_content)
109
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
110
+ end
111
+
112
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
113
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
114
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
115
+ # Deserialize Response
116
+ if status_code == 200
117
+ begin
118
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
119
+ result_mapper = Azure::Storage::Mgmt::V2020_08_01_preview::Models::CheckNameAvailabilityResult.mapper()
120
+ result.body = @client.deserialize(result_mapper, parsed_response)
121
+ rescue Exception => e
122
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
123
+ end
124
+ end
125
+
126
+ result
127
+ end
128
+
129
+ promise.execute
130
+ end
131
+
132
+ #
133
+ # Asynchronously creates a new storage account with the specified parameters.
134
+ # If an account is already created and a subsequent create request is issued
135
+ # with different properties, the account properties will be updated. If an
136
+ # account is already created and a subsequent create or update request is
137
+ # issued with the exact same set of properties, the request will succeed.
138
+ #
139
+ # @param resource_group_name [String] The name of the resource group within the
140
+ # user's subscription. The name is case insensitive.
141
+ # @param account_name [String] The name of the storage account within the
142
+ # specified resource group. Storage account names must be between 3 and 24
143
+ # characters in length and use numbers and lower-case letters only.
144
+ # @param parameters [StorageAccountCreateParameters] The parameters to provide
145
+ # for the created account.
146
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
147
+ # will be added to the HTTP request.
148
+ #
149
+ # @return [StorageAccount] operation results.
150
+ #
151
+ def create(resource_group_name, account_name, parameters, custom_headers:nil)
152
+ response = create_async(resource_group_name, account_name, parameters, custom_headers:custom_headers).value!
153
+ response.body unless response.nil?
154
+ end
155
+
156
+ #
157
+ # @param resource_group_name [String] The name of the resource group within the
158
+ # user's subscription. The name is case insensitive.
159
+ # @param account_name [String] The name of the storage account within the
160
+ # specified resource group. Storage account names must be between 3 and 24
161
+ # characters in length and use numbers and lower-case letters only.
162
+ # @param parameters [StorageAccountCreateParameters] The parameters to provide
163
+ # for the created account.
164
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
165
+ # will be added to the HTTP request.
166
+ #
167
+ # @return [Concurrent::Promise] promise which provides async access to http
168
+ # response.
169
+ #
170
+ def create_async(resource_group_name, account_name, parameters, custom_headers:nil)
171
+ # Send request
172
+ promise = begin_create_async(resource_group_name, account_name, parameters, custom_headers:custom_headers)
173
+
174
+ promise = promise.then do |response|
175
+ # Defining deserialization method.
176
+ deserialize_method = lambda do |parsed_response|
177
+ result_mapper = Azure::Storage::Mgmt::V2020_08_01_preview::Models::StorageAccount.mapper()
178
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
179
+ end
180
+
181
+ # Waiting for response.
182
+ @client.get_long_running_operation_result(response, deserialize_method)
183
+ end
184
+
185
+ promise
186
+ end
187
+
188
+ #
189
+ # Deletes a storage account in Microsoft Azure.
190
+ #
191
+ # @param resource_group_name [String] The name of the resource group within the
192
+ # user's subscription. The name is case insensitive.
193
+ # @param account_name [String] The name of the storage account within the
194
+ # specified resource group. Storage account names must be between 3 and 24
195
+ # characters in length and use numbers and lower-case letters only.
196
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
197
+ # will be added to the HTTP request.
198
+ #
199
+ #
200
+ def delete(resource_group_name, account_name, custom_headers:nil)
201
+ response = delete_async(resource_group_name, account_name, custom_headers:custom_headers).value!
202
+ nil
203
+ end
204
+
205
+ #
206
+ # Deletes a storage account in Microsoft Azure.
207
+ #
208
+ # @param resource_group_name [String] The name of the resource group within the
209
+ # user's subscription. The name is case insensitive.
210
+ # @param account_name [String] The name of the storage account within the
211
+ # specified resource group. Storage account names must be between 3 and 24
212
+ # characters in length and use numbers and lower-case letters only.
213
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
214
+ # will be added to the HTTP request.
215
+ #
216
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
217
+ #
218
+ def delete_with_http_info(resource_group_name, account_name, custom_headers:nil)
219
+ delete_async(resource_group_name, account_name, custom_headers:custom_headers).value!
220
+ end
221
+
222
+ #
223
+ # Deletes a storage account in Microsoft Azure.
224
+ #
225
+ # @param resource_group_name [String] The name of the resource group within the
226
+ # user's subscription. The name is case insensitive.
227
+ # @param account_name [String] The name of the storage account within the
228
+ # specified resource group. Storage account names must be between 3 and 24
229
+ # characters in length and use numbers and lower-case letters only.
230
+ # @param [Hash{String => String}] A hash of custom headers that will be added
231
+ # to the HTTP request.
232
+ #
233
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
234
+ #
235
+ def delete_async(resource_group_name, account_name, custom_headers:nil)
236
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
237
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
238
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
239
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
240
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
241
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
242
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
243
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
244
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
245
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
246
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
247
+
248
+
249
+ request_headers = {}
250
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
251
+
252
+ # Set Headers
253
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
254
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
255
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'
256
+
257
+ request_url = @base_url || @client.base_url
258
+
259
+ options = {
260
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
261
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
262
+ query_params: {'api-version' => @client.api_version},
263
+ headers: request_headers.merge(custom_headers || {}),
264
+ base_url: request_url
265
+ }
266
+ promise = @client.make_request_async(:delete, path_template, options)
267
+
268
+ promise = promise.then do |result|
269
+ http_response = result.response
270
+ status_code = http_response.status
271
+ response_content = http_response.body
272
+ unless status_code == 200 || status_code == 204
273
+ error_model = JSON.load(response_content)
274
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
275
+ end
276
+
277
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
278
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
279
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
280
+
281
+ result
282
+ end
283
+
284
+ promise.execute
285
+ end
286
+
287
+ #
288
+ # Returns the properties for the specified storage account including but not
289
+ # limited to name, SKU name, location, and account status. The ListKeys
290
+ # operation should be used to retrieve storage keys.
291
+ #
292
+ # @param resource_group_name [String] The name of the resource group within the
293
+ # user's subscription. The name is case insensitive.
294
+ # @param account_name [String] The name of the storage account within the
295
+ # specified resource group. Storage account names must be between 3 and 24
296
+ # characters in length and use numbers and lower-case letters only.
297
+ # @param expand [StorageAccountExpand] May be used to expand the properties
298
+ # within account's properties. By default, data is not included when fetching
299
+ # properties. Currently we only support geoReplicationStats and
300
+ # blobRestoreStatus. Possible values include: 'geoReplicationStats',
301
+ # 'blobRestoreStatus'
302
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
303
+ # will be added to the HTTP request.
304
+ #
305
+ # @return [StorageAccount] operation results.
306
+ #
307
+ def get_properties(resource_group_name, account_name, expand:nil, custom_headers:nil)
308
+ response = get_properties_async(resource_group_name, account_name, expand:expand, custom_headers:custom_headers).value!
309
+ response.body unless response.nil?
310
+ end
311
+
312
+ #
313
+ # Returns the properties for the specified storage account including but not
314
+ # limited to name, SKU name, location, and account status. The ListKeys
315
+ # operation should be used to retrieve storage keys.
316
+ #
317
+ # @param resource_group_name [String] The name of the resource group within the
318
+ # user's subscription. The name is case insensitive.
319
+ # @param account_name [String] The name of the storage account within the
320
+ # specified resource group. Storage account names must be between 3 and 24
321
+ # characters in length and use numbers and lower-case letters only.
322
+ # @param expand [StorageAccountExpand] May be used to expand the properties
323
+ # within account's properties. By default, data is not included when fetching
324
+ # properties. Currently we only support geoReplicationStats and
325
+ # blobRestoreStatus. Possible values include: 'geoReplicationStats',
326
+ # 'blobRestoreStatus'
327
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
328
+ # will be added to the HTTP request.
329
+ #
330
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
331
+ #
332
+ def get_properties_with_http_info(resource_group_name, account_name, expand:nil, custom_headers:nil)
333
+ get_properties_async(resource_group_name, account_name, expand:expand, custom_headers:custom_headers).value!
334
+ end
335
+
336
+ #
337
+ # Returns the properties for the specified storage account including but not
338
+ # limited to name, SKU name, location, and account status. The ListKeys
339
+ # operation should be used to retrieve storage keys.
340
+ #
341
+ # @param resource_group_name [String] The name of the resource group within the
342
+ # user's subscription. The name is case insensitive.
343
+ # @param account_name [String] The name of the storage account within the
344
+ # specified resource group. Storage account names must be between 3 and 24
345
+ # characters in length and use numbers and lower-case letters only.
346
+ # @param expand [StorageAccountExpand] May be used to expand the properties
347
+ # within account's properties. By default, data is not included when fetching
348
+ # properties. Currently we only support geoReplicationStats and
349
+ # blobRestoreStatus. Possible values include: 'geoReplicationStats',
350
+ # 'blobRestoreStatus'
351
+ # @param [Hash{String => String}] A hash of custom headers that will be added
352
+ # to the HTTP request.
353
+ #
354
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
355
+ #
356
+ def get_properties_async(resource_group_name, account_name, expand:nil, custom_headers:nil)
357
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
358
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
359
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
360
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
361
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
362
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
363
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
364
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
365
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
366
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
367
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
368
+
369
+
370
+ request_headers = {}
371
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
372
+
373
+ # Set Headers
374
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
375
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
376
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'
377
+
378
+ request_url = @base_url || @client.base_url
379
+
380
+ options = {
381
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
382
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
383
+ query_params: {'api-version' => @client.api_version,'$expand' => expand},
384
+ headers: request_headers.merge(custom_headers || {}),
385
+ base_url: request_url
386
+ }
387
+ promise = @client.make_request_async(:get, path_template, options)
388
+
389
+ promise = promise.then do |result|
390
+ http_response = result.response
391
+ status_code = http_response.status
392
+ response_content = http_response.body
393
+ unless status_code == 200
394
+ error_model = JSON.load(response_content)
395
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
396
+ end
397
+
398
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
399
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
400
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
401
+ # Deserialize Response
402
+ if status_code == 200
403
+ begin
404
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
405
+ result_mapper = Azure::Storage::Mgmt::V2020_08_01_preview::Models::StorageAccount.mapper()
406
+ result.body = @client.deserialize(result_mapper, parsed_response)
407
+ rescue Exception => e
408
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
409
+ end
410
+ end
411
+
412
+ result
413
+ end
414
+
415
+ promise.execute
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 [StorageAccount] operation results.
440
+ #
441
+ def update(resource_group_name, account_name, parameters, custom_headers:nil)
442
+ response = update_async(resource_group_name, account_name, parameters, custom_headers:custom_headers).value!
443
+ response.body unless response.nil?
444
+ end
445
+
446
+ #
447
+ # The update operation can be used to update the SKU, encryption, access tier,
448
+ # or tags for a storage account. It can also be used to map the account to a
449
+ # custom domain. Only one custom domain is supported per storage account; the
450
+ # replacement/change of custom domain is not supported. In order to replace an
451
+ # old custom domain, the old value must be cleared/unregistered before a new
452
+ # value can be set. The update of multiple properties is supported. This call
453
+ # does not change the storage keys for the account. If you want to change the
454
+ # storage account keys, use the regenerate keys operation. The location and
455
+ # name of the storage account cannot be changed after creation.
456
+ #
457
+ # @param resource_group_name [String] The name of the resource group within the
458
+ # user's subscription. The name is case insensitive.
459
+ # @param account_name [String] The name of the storage account within the
460
+ # specified resource group. Storage account names must be between 3 and 24
461
+ # characters in length and use numbers and lower-case letters only.
462
+ # @param parameters [StorageAccountUpdateParameters] The parameters to provide
463
+ # for the updated account.
464
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
465
+ # will be added to the HTTP request.
466
+ #
467
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
468
+ #
469
+ def update_with_http_info(resource_group_name, account_name, parameters, custom_headers:nil)
470
+ update_async(resource_group_name, account_name, parameters, custom_headers:custom_headers).value!
471
+ end
472
+
473
+ #
474
+ # The update operation can be used to update the SKU, encryption, access tier,
475
+ # or tags for a storage account. It can also be used to map the account to a
476
+ # custom domain. Only one custom domain is supported per storage account; the
477
+ # replacement/change of custom domain is not supported. In order to replace an
478
+ # old custom domain, the old value must be cleared/unregistered before a new
479
+ # value can be set. The update of multiple properties is supported. This call
480
+ # does not change the storage keys for the account. If you want to change the
481
+ # storage account keys, use the regenerate keys operation. The location and
482
+ # name of the storage account cannot be changed after creation.
483
+ #
484
+ # @param resource_group_name [String] The name of the resource group within the
485
+ # user's subscription. The name is case insensitive.
486
+ # @param account_name [String] The name of the storage account within the
487
+ # specified resource group. Storage account names must be between 3 and 24
488
+ # characters in length and use numbers and lower-case letters only.
489
+ # @param parameters [StorageAccountUpdateParameters] The parameters to provide
490
+ # for the updated account.
491
+ # @param [Hash{String => String}] A hash of custom headers that will be added
492
+ # to the HTTP request.
493
+ #
494
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
495
+ #
496
+ def update_async(resource_group_name, account_name, parameters, custom_headers:nil)
497
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
498
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
499
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
500
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
501
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
502
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
503
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
504
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
505
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
506
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
507
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
508
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
509
+
510
+
511
+ request_headers = {}
512
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
513
+
514
+ # Set Headers
515
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
516
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
517
+
518
+ # Serialize Request
519
+ request_mapper = Azure::Storage::Mgmt::V2020_08_01_preview::Models::StorageAccountUpdateParameters.mapper()
520
+ request_content = @client.serialize(request_mapper, parameters)
521
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
522
+
523
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'
524
+
525
+ request_url = @base_url || @client.base_url
526
+
527
+ options = {
528
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
529
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
530
+ query_params: {'api-version' => @client.api_version},
531
+ body: request_content,
532
+ headers: request_headers.merge(custom_headers || {}),
533
+ base_url: request_url
534
+ }
535
+ promise = @client.make_request_async(:patch, path_template, options)
536
+
537
+ promise = promise.then do |result|
538
+ http_response = result.response
539
+ status_code = http_response.status
540
+ response_content = http_response.body
541
+ unless status_code == 200
542
+ error_model = JSON.load(response_content)
543
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
544
+ end
545
+
546
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
547
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
548
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
549
+ # Deserialize Response
550
+ if status_code == 200
551
+ begin
552
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
553
+ result_mapper = Azure::Storage::Mgmt::V2020_08_01_preview::Models::StorageAccount.mapper()
554
+ result.body = @client.deserialize(result_mapper, parsed_response)
555
+ rescue Exception => e
556
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
557
+ end
558
+ end
559
+
560
+ result
561
+ end
562
+
563
+ promise.execute
564
+ end
565
+
566
+ #
567
+ # Lists all the storage accounts available under the subscription. Note that
568
+ # storage keys are not returned; use the ListKeys operation for this.
569
+ #
570
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
571
+ # will be added to the HTTP request.
572
+ #
573
+ # @return [Array<StorageAccount>] operation results.
574
+ #
575
+ def list(custom_headers:nil)
576
+ first_page = list_as_lazy(custom_headers:custom_headers)
577
+ first_page.get_all_items
578
+ end
579
+
580
+ #
581
+ # Lists all the storage accounts available under the subscription. Note that
582
+ # storage keys are not returned; use the ListKeys operation for this.
583
+ #
584
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
585
+ # will be added to the HTTP request.
586
+ #
587
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
588
+ #
589
+ def list_with_http_info(custom_headers:nil)
590
+ list_async(custom_headers:custom_headers).value!
591
+ end
592
+
593
+ #
594
+ # Lists all the storage accounts available under the subscription. Note that
595
+ # storage keys are not returned; use the ListKeys operation for this.
596
+ #
597
+ # @param [Hash{String => String}] A hash of custom headers that will be added
598
+ # to the HTTP request.
599
+ #
600
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
601
+ #
602
+ def list_async(custom_headers:nil)
603
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
604
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
605
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
606
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
607
+
608
+
609
+ request_headers = {}
610
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
611
+
612
+ # Set Headers
613
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
614
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
615
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts'
616
+
617
+ request_url = @base_url || @client.base_url
618
+
619
+ options = {
620
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
621
+ path_params: {'subscriptionId' => @client.subscription_id},
622
+ query_params: {'api-version' => @client.api_version},
623
+ headers: request_headers.merge(custom_headers || {}),
624
+ base_url: request_url
625
+ }
626
+ promise = @client.make_request_async(:get, path_template, options)
627
+
628
+ promise = promise.then do |result|
629
+ http_response = result.response
630
+ status_code = http_response.status
631
+ response_content = http_response.body
632
+ unless status_code == 200
633
+ error_model = JSON.load(response_content)
634
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
635
+ end
636
+
637
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
638
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
639
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
640
+ # Deserialize Response
641
+ if status_code == 200
642
+ begin
643
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
644
+ result_mapper = Azure::Storage::Mgmt::V2020_08_01_preview::Models::StorageAccountListResult.mapper()
645
+ result.body = @client.deserialize(result_mapper, parsed_response)
646
+ rescue Exception => e
647
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
648
+ end
649
+ end
650
+
651
+ result
652
+ end
653
+
654
+ promise.execute
655
+ end
656
+
657
+ #
658
+ # Lists all the storage accounts available under the given resource group. Note
659
+ # that storage keys are not returned; use the ListKeys operation for this.
660
+ #
661
+ # @param resource_group_name [String] The name of the resource group within the
662
+ # user's subscription. The name is case insensitive.
663
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
664
+ # will be added to the HTTP request.
665
+ #
666
+ # @return [StorageAccountListResult] operation results.
667
+ #
668
+ def list_by_resource_group(resource_group_name, custom_headers:nil)
669
+ response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
670
+ response.body unless response.nil?
671
+ end
672
+
673
+ #
674
+ # Lists all the storage accounts available under the given resource group. Note
675
+ # that storage keys are not returned; use the ListKeys operation for this.
676
+ #
677
+ # @param resource_group_name [String] The name of the resource group within the
678
+ # user's subscription. The name is case insensitive.
679
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
680
+ # will be added to the HTTP request.
681
+ #
682
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
683
+ #
684
+ def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil)
685
+ list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
686
+ end
687
+
688
+ #
689
+ # Lists all the storage accounts available under the given resource group. Note
690
+ # that storage keys are not returned; use the ListKeys operation for this.
691
+ #
692
+ # @param resource_group_name [String] The name of the resource group within the
693
+ # user's subscription. The name is case insensitive.
694
+ # @param [Hash{String => String}] A hash of custom headers that will be added
695
+ # to the HTTP request.
696
+ #
697
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
698
+ #
699
+ def list_by_resource_group_async(resource_group_name, custom_headers:nil)
700
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
701
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
702
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
703
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
704
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
705
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
706
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
707
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
708
+
709
+
710
+ request_headers = {}
711
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
712
+
713
+ # Set Headers
714
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
715
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
716
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts'
717
+
718
+ request_url = @base_url || @client.base_url
719
+
720
+ options = {
721
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
722
+ path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
723
+ query_params: {'api-version' => @client.api_version},
724
+ headers: request_headers.merge(custom_headers || {}),
725
+ base_url: request_url
726
+ }
727
+ promise = @client.make_request_async(:get, path_template, options)
728
+
729
+ promise = promise.then do |result|
730
+ http_response = result.response
731
+ status_code = http_response.status
732
+ response_content = http_response.body
733
+ unless status_code == 200
734
+ error_model = JSON.load(response_content)
735
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
736
+ end
737
+
738
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
739
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
740
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
741
+ # Deserialize Response
742
+ if status_code == 200
743
+ begin
744
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
745
+ result_mapper = Azure::Storage::Mgmt::V2020_08_01_preview::Models::StorageAccountListResult.mapper()
746
+ result.body = @client.deserialize(result_mapper, parsed_response)
747
+ rescue Exception => e
748
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
749
+ end
750
+ end
751
+
752
+ result
753
+ end
754
+
755
+ promise.execute
756
+ end
757
+
758
+ #
759
+ # Lists the access keys or Kerberos keys (if active directory enabled) for the
760
+ # specified storage account.
761
+ #
762
+ # @param resource_group_name [String] The name of the resource group within the
763
+ # user's subscription. The name is case insensitive.
764
+ # @param account_name [String] The name of the storage account within the
765
+ # specified resource group. Storage account names must be between 3 and 24
766
+ # characters in length and use numbers and lower-case letters only.
767
+ # @param expand [ListKeyExpand] Specifies type of the key to be listed.
768
+ # Possible value is kerb. Possible values include: 'kerb'
769
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
770
+ # will be added to the HTTP request.
771
+ #
772
+ # @return [StorageAccountListKeysResult] operation results.
773
+ #
774
+ def list_keys(resource_group_name, account_name, expand:nil, custom_headers:nil)
775
+ response = list_keys_async(resource_group_name, account_name, expand:expand, custom_headers:custom_headers).value!
776
+ response.body unless response.nil?
777
+ end
778
+
779
+ #
780
+ # Lists the access keys or Kerberos keys (if active directory enabled) for the
781
+ # specified storage account.
782
+ #
783
+ # @param resource_group_name [String] The name of the resource group within the
784
+ # user's subscription. The name is case insensitive.
785
+ # @param account_name [String] The name of the storage account within the
786
+ # specified resource group. Storage account names must be between 3 and 24
787
+ # characters in length and use numbers and lower-case letters only.
788
+ # @param expand [ListKeyExpand] Specifies type of the key to be listed.
789
+ # Possible value is kerb. Possible values include: 'kerb'
790
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
791
+ # will be added to the HTTP request.
792
+ #
793
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
794
+ #
795
+ def list_keys_with_http_info(resource_group_name, account_name, expand:nil, custom_headers:nil)
796
+ list_keys_async(resource_group_name, account_name, expand:expand, custom_headers:custom_headers).value!
797
+ end
798
+
799
+ #
800
+ # Lists the access keys or Kerberos keys (if active directory enabled) for the
801
+ # specified storage account.
802
+ #
803
+ # @param resource_group_name [String] The name of the resource group within the
804
+ # user's subscription. The name is case insensitive.
805
+ # @param account_name [String] The name of the storage account within the
806
+ # specified resource group. Storage account names must be between 3 and 24
807
+ # characters in length and use numbers and lower-case letters only.
808
+ # @param expand [ListKeyExpand] Specifies type of the key to be listed.
809
+ # Possible value is kerb. Possible values include: 'kerb'
810
+ # @param [Hash{String => String}] A hash of custom headers that will be added
811
+ # to the HTTP request.
812
+ #
813
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
814
+ #
815
+ def list_keys_async(resource_group_name, account_name, expand:nil, custom_headers:nil)
816
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
817
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
818
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
819
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
820
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
821
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
822
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
823
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
824
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
825
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
826
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
827
+
828
+
829
+ request_headers = {}
830
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
831
+
832
+ # Set Headers
833
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
834
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
835
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys'
836
+
837
+ request_url = @base_url || @client.base_url
838
+
839
+ options = {
840
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
841
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
842
+ query_params: {'api-version' => @client.api_version,'$expand' => expand},
843
+ headers: request_headers.merge(custom_headers || {}),
844
+ base_url: request_url
845
+ }
846
+ promise = @client.make_request_async(:post, path_template, options)
847
+
848
+ promise = promise.then do |result|
849
+ http_response = result.response
850
+ status_code = http_response.status
851
+ response_content = http_response.body
852
+ unless status_code == 200
853
+ error_model = JSON.load(response_content)
854
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
855
+ end
856
+
857
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
858
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
859
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
860
+ # Deserialize Response
861
+ if status_code == 200
862
+ begin
863
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
864
+ result_mapper = Azure::Storage::Mgmt::V2020_08_01_preview::Models::StorageAccountListKeysResult.mapper()
865
+ result.body = @client.deserialize(result_mapper, parsed_response)
866
+ rescue Exception => e
867
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
868
+ end
869
+ end
870
+
871
+ result
872
+ end
873
+
874
+ promise.execute
875
+ end
876
+
877
+ #
878
+ # Regenerates one of the access keys or Kerberos keys for the specified storage
879
+ # account.
880
+ #
881
+ # @param resource_group_name [String] The name of the resource group within the
882
+ # user's subscription. The name is case insensitive.
883
+ # @param account_name [String] The name of the storage account within the
884
+ # specified resource group. Storage account names must be between 3 and 24
885
+ # characters in length and use numbers and lower-case letters only.
886
+ # @param regenerate_key [StorageAccountRegenerateKeyParameters] Specifies name
887
+ # of the key which should be regenerated -- key1, key2, kerb1, kerb2.
888
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
889
+ # will be added to the HTTP request.
890
+ #
891
+ # @return [StorageAccountListKeysResult] operation results.
892
+ #
893
+ def regenerate_key(resource_group_name, account_name, regenerate_key, custom_headers:nil)
894
+ response = regenerate_key_async(resource_group_name, account_name, regenerate_key, custom_headers:custom_headers).value!
895
+ response.body unless response.nil?
896
+ end
897
+
898
+ #
899
+ # Regenerates one of the access keys or Kerberos keys for the specified storage
900
+ # account.
901
+ #
902
+ # @param resource_group_name [String] The name of the resource group within the
903
+ # user's subscription. The name is case insensitive.
904
+ # @param account_name [String] The name of the storage account within the
905
+ # specified resource group. Storage account names must be between 3 and 24
906
+ # characters in length and use numbers and lower-case letters only.
907
+ # @param regenerate_key [StorageAccountRegenerateKeyParameters] Specifies name
908
+ # of the key which should be regenerated -- key1, key2, kerb1, kerb2.
909
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
910
+ # will be added to the HTTP request.
911
+ #
912
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
913
+ #
914
+ def regenerate_key_with_http_info(resource_group_name, account_name, regenerate_key, custom_headers:nil)
915
+ regenerate_key_async(resource_group_name, account_name, regenerate_key, custom_headers:custom_headers).value!
916
+ end
917
+
918
+ #
919
+ # Regenerates one of the access keys or Kerberos keys for the specified storage
920
+ # account.
921
+ #
922
+ # @param resource_group_name [String] The name of the resource group within the
923
+ # user's subscription. The name is case insensitive.
924
+ # @param account_name [String] The name of the storage account within the
925
+ # specified resource group. Storage account names must be between 3 and 24
926
+ # characters in length and use numbers and lower-case letters only.
927
+ # @param regenerate_key [StorageAccountRegenerateKeyParameters] Specifies name
928
+ # of the key which should be regenerated -- key1, key2, kerb1, kerb2.
929
+ # @param [Hash{String => String}] A hash of custom headers that will be added
930
+ # to the HTTP request.
931
+ #
932
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
933
+ #
934
+ def regenerate_key_async(resource_group_name, account_name, regenerate_key, custom_headers:nil)
935
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
936
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
937
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
938
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
939
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
940
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
941
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
942
+ fail ArgumentError, 'regenerate_key is nil' if regenerate_key.nil?
943
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
944
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
945
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
946
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
947
+
948
+
949
+ request_headers = {}
950
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
951
+
952
+ # Set Headers
953
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
954
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
955
+
956
+ # Serialize Request
957
+ request_mapper = Azure::Storage::Mgmt::V2020_08_01_preview::Models::StorageAccountRegenerateKeyParameters.mapper()
958
+ request_content = @client.serialize(request_mapper, regenerate_key)
959
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
960
+
961
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey'
962
+
963
+ request_url = @base_url || @client.base_url
964
+
965
+ options = {
966
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
967
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
968
+ query_params: {'api-version' => @client.api_version},
969
+ body: request_content,
970
+ headers: request_headers.merge(custom_headers || {}),
971
+ base_url: request_url
972
+ }
973
+ promise = @client.make_request_async(:post, path_template, options)
974
+
975
+ promise = promise.then do |result|
976
+ http_response = result.response
977
+ status_code = http_response.status
978
+ response_content = http_response.body
979
+ unless status_code == 200
980
+ error_model = JSON.load(response_content)
981
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
982
+ end
983
+
984
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
985
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
986
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
987
+ # Deserialize Response
988
+ if status_code == 200
989
+ begin
990
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
991
+ result_mapper = Azure::Storage::Mgmt::V2020_08_01_preview::Models::StorageAccountListKeysResult.mapper()
992
+ result.body = @client.deserialize(result_mapper, parsed_response)
993
+ rescue Exception => e
994
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
995
+ end
996
+ end
997
+
998
+ result
999
+ end
1000
+
1001
+ promise.execute
1002
+ end
1003
+
1004
+ #
1005
+ # List SAS credentials of a storage account.
1006
+ #
1007
+ # @param resource_group_name [String] The name of the resource group within the
1008
+ # user's subscription. The name is case insensitive.
1009
+ # @param account_name [String] The name of the storage account within the
1010
+ # specified resource group. Storage account names must be between 3 and 24
1011
+ # characters in length and use numbers and lower-case letters only.
1012
+ # @param parameters [AccountSasParameters] The parameters to provide to list
1013
+ # SAS credentials for the storage account.
1014
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1015
+ # will be added to the HTTP request.
1016
+ #
1017
+ # @return [ListAccountSasResponse] operation results.
1018
+ #
1019
+ def list_account_sas(resource_group_name, account_name, parameters, custom_headers:nil)
1020
+ response = list_account_sas_async(resource_group_name, account_name, parameters, custom_headers:custom_headers).value!
1021
+ response.body unless response.nil?
1022
+ end
1023
+
1024
+ #
1025
+ # List SAS credentials of a storage account.
1026
+ #
1027
+ # @param resource_group_name [String] The name of the resource group within the
1028
+ # user's subscription. The name is case insensitive.
1029
+ # @param account_name [String] The name of the storage account within the
1030
+ # specified resource group. Storage account names must be between 3 and 24
1031
+ # characters in length and use numbers and lower-case letters only.
1032
+ # @param parameters [AccountSasParameters] The parameters to provide to list
1033
+ # SAS credentials for the storage account.
1034
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1035
+ # will be added to the HTTP request.
1036
+ #
1037
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1038
+ #
1039
+ def list_account_sas_with_http_info(resource_group_name, account_name, parameters, custom_headers:nil)
1040
+ list_account_sas_async(resource_group_name, account_name, parameters, custom_headers:custom_headers).value!
1041
+ end
1042
+
1043
+ #
1044
+ # List SAS credentials of a storage account.
1045
+ #
1046
+ # @param resource_group_name [String] The name of the resource group within the
1047
+ # user's subscription. The name is case insensitive.
1048
+ # @param account_name [String] The name of the storage account within the
1049
+ # specified resource group. Storage account names must be between 3 and 24
1050
+ # characters in length and use numbers and lower-case letters only.
1051
+ # @param parameters [AccountSasParameters] The parameters to provide to list
1052
+ # SAS credentials for the storage account.
1053
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1054
+ # to the HTTP request.
1055
+ #
1056
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1057
+ #
1058
+ def list_account_sas_async(resource_group_name, account_name, parameters, custom_headers:nil)
1059
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1060
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1061
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1062
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1063
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
1064
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
1065
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
1066
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1067
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1068
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
1069
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1070
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
1071
+
1072
+
1073
+ request_headers = {}
1074
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1075
+
1076
+ # Set Headers
1077
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1078
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1079
+
1080
+ # Serialize Request
1081
+ request_mapper = Azure::Storage::Mgmt::V2020_08_01_preview::Models::AccountSasParameters.mapper()
1082
+ request_content = @client.serialize(request_mapper, parameters)
1083
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1084
+
1085
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas'
1086
+
1087
+ request_url = @base_url || @client.base_url
1088
+
1089
+ options = {
1090
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1091
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
1092
+ query_params: {'api-version' => @client.api_version},
1093
+ body: request_content,
1094
+ headers: request_headers.merge(custom_headers || {}),
1095
+ base_url: request_url
1096
+ }
1097
+ promise = @client.make_request_async(:post, path_template, options)
1098
+
1099
+ promise = promise.then do |result|
1100
+ http_response = result.response
1101
+ status_code = http_response.status
1102
+ response_content = http_response.body
1103
+ unless status_code == 200
1104
+ error_model = JSON.load(response_content)
1105
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1106
+ end
1107
+
1108
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1109
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1110
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1111
+ # Deserialize Response
1112
+ if status_code == 200
1113
+ begin
1114
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1115
+ result_mapper = Azure::Storage::Mgmt::V2020_08_01_preview::Models::ListAccountSasResponse.mapper()
1116
+ result.body = @client.deserialize(result_mapper, parsed_response)
1117
+ rescue Exception => e
1118
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1119
+ end
1120
+ end
1121
+
1122
+ result
1123
+ end
1124
+
1125
+ promise.execute
1126
+ end
1127
+
1128
+ #
1129
+ # List service SAS credentials of a specific resource.
1130
+ #
1131
+ # @param resource_group_name [String] The name of the resource group within the
1132
+ # user's subscription. The name is case insensitive.
1133
+ # @param account_name [String] The name of the storage account within the
1134
+ # specified resource group. Storage account names must be between 3 and 24
1135
+ # characters in length and use numbers and lower-case letters only.
1136
+ # @param parameters [ServiceSasParameters] The parameters to provide to list
1137
+ # service SAS credentials.
1138
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1139
+ # will be added to the HTTP request.
1140
+ #
1141
+ # @return [ListServiceSasResponse] operation results.
1142
+ #
1143
+ def list_service_sas(resource_group_name, account_name, parameters, custom_headers:nil)
1144
+ response = list_service_sas_async(resource_group_name, account_name, parameters, custom_headers:custom_headers).value!
1145
+ response.body unless response.nil?
1146
+ end
1147
+
1148
+ #
1149
+ # List service SAS credentials of a specific resource.
1150
+ #
1151
+ # @param resource_group_name [String] The name of the resource group within the
1152
+ # user's subscription. The name is case insensitive.
1153
+ # @param account_name [String] The name of the storage account within the
1154
+ # specified resource group. Storage account names must be between 3 and 24
1155
+ # characters in length and use numbers and lower-case letters only.
1156
+ # @param parameters [ServiceSasParameters] The parameters to provide to list
1157
+ # service SAS credentials.
1158
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1159
+ # will be added to the HTTP request.
1160
+ #
1161
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1162
+ #
1163
+ def list_service_sas_with_http_info(resource_group_name, account_name, parameters, custom_headers:nil)
1164
+ list_service_sas_async(resource_group_name, account_name, parameters, custom_headers:custom_headers).value!
1165
+ end
1166
+
1167
+ #
1168
+ # List service SAS credentials of a specific resource.
1169
+ #
1170
+ # @param resource_group_name [String] The name of the resource group within the
1171
+ # user's subscription. The name is case insensitive.
1172
+ # @param account_name [String] The name of the storage account within the
1173
+ # specified resource group. Storage account names must be between 3 and 24
1174
+ # characters in length and use numbers and lower-case letters only.
1175
+ # @param parameters [ServiceSasParameters] The parameters to provide to list
1176
+ # service SAS credentials.
1177
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1178
+ # to the HTTP request.
1179
+ #
1180
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1181
+ #
1182
+ def list_service_sas_async(resource_group_name, account_name, parameters, custom_headers:nil)
1183
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1184
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1185
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1186
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1187
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
1188
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
1189
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
1190
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1191
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1192
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
1193
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1194
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
1195
+
1196
+
1197
+ request_headers = {}
1198
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1199
+
1200
+ # Set Headers
1201
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1202
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1203
+
1204
+ # Serialize Request
1205
+ request_mapper = Azure::Storage::Mgmt::V2020_08_01_preview::Models::ServiceSasParameters.mapper()
1206
+ request_content = @client.serialize(request_mapper, parameters)
1207
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1208
+
1209
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas'
1210
+
1211
+ request_url = @base_url || @client.base_url
1212
+
1213
+ options = {
1214
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1215
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
1216
+ query_params: {'api-version' => @client.api_version},
1217
+ body: request_content,
1218
+ headers: request_headers.merge(custom_headers || {}),
1219
+ base_url: request_url
1220
+ }
1221
+ promise = @client.make_request_async(:post, path_template, options)
1222
+
1223
+ promise = promise.then do |result|
1224
+ http_response = result.response
1225
+ status_code = http_response.status
1226
+ response_content = http_response.body
1227
+ unless status_code == 200
1228
+ error_model = JSON.load(response_content)
1229
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1230
+ end
1231
+
1232
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1233
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1234
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1235
+ # Deserialize Response
1236
+ if status_code == 200
1237
+ begin
1238
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1239
+ result_mapper = Azure::Storage::Mgmt::V2020_08_01_preview::Models::ListServiceSasResponse.mapper()
1240
+ result.body = @client.deserialize(result_mapper, parsed_response)
1241
+ rescue Exception => e
1242
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1243
+ end
1244
+ end
1245
+
1246
+ result
1247
+ end
1248
+
1249
+ promise.execute
1250
+ end
1251
+
1252
+ #
1253
+ # Failover request can be triggered for a storage account in case of
1254
+ # availability issues. The failover occurs from the storage account's primary
1255
+ # cluster to secondary cluster for RA-GRS accounts. The secondary cluster will
1256
+ # become primary after failover.
1257
+ #
1258
+ # @param resource_group_name [String] The name of the resource group within the
1259
+ # user's subscription. The name is case insensitive.
1260
+ # @param account_name [String] The name of the storage account within the
1261
+ # specified resource group. Storage account names must be between 3 and 24
1262
+ # characters in length and use numbers and lower-case letters only.
1263
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1264
+ # will be added to the HTTP request.
1265
+ #
1266
+ def failover(resource_group_name, account_name, custom_headers:nil)
1267
+ response = failover_async(resource_group_name, account_name, custom_headers:custom_headers).value!
1268
+ nil
1269
+ end
1270
+
1271
+ #
1272
+ # @param resource_group_name [String] The name of the resource group within the
1273
+ # user's subscription. The name is case insensitive.
1274
+ # @param account_name [String] The name of the storage account within the
1275
+ # specified resource group. Storage account names must be between 3 and 24
1276
+ # characters in length and use numbers and lower-case letters only.
1277
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1278
+ # will be added to the HTTP request.
1279
+ #
1280
+ # @return [Concurrent::Promise] promise which provides async access to http
1281
+ # response.
1282
+ #
1283
+ def failover_async(resource_group_name, account_name, custom_headers:nil)
1284
+ # Send request
1285
+ promise = begin_failover_async(resource_group_name, account_name, custom_headers:custom_headers)
1286
+
1287
+ promise = promise.then do |response|
1288
+ # Defining deserialization method.
1289
+ deserialize_method = lambda do |parsed_response|
1290
+ end
1291
+
1292
+ # Waiting for response.
1293
+ @client.get_long_running_operation_result(response, deserialize_method, FinalStateVia::LOCATION)
1294
+ end
1295
+
1296
+ promise
1297
+ end
1298
+
1299
+ #
1300
+ # Restore blobs in the specified blob ranges
1301
+ #
1302
+ # @param resource_group_name [String] The name of the resource group within the
1303
+ # user's subscription. The name is case insensitive.
1304
+ # @param account_name [String] The name of the storage account within the
1305
+ # specified resource group. Storage account names must be between 3 and 24
1306
+ # characters in length and use numbers and lower-case letters only.
1307
+ # @param parameters [BlobRestoreParameters] The parameters to provide for
1308
+ # restore blob ranges.
1309
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1310
+ # will be added to the HTTP request.
1311
+ #
1312
+ # @return [BlobRestoreStatus] operation results.
1313
+ #
1314
+ def restore_blob_ranges(resource_group_name, account_name, parameters, custom_headers:nil)
1315
+ response = restore_blob_ranges_async(resource_group_name, account_name, parameters, custom_headers:custom_headers).value!
1316
+ response.body unless response.nil?
1317
+ end
1318
+
1319
+ #
1320
+ # @param resource_group_name [String] The name of the resource group within the
1321
+ # user's subscription. The name is case insensitive.
1322
+ # @param account_name [String] The name of the storage account within the
1323
+ # specified resource group. Storage account names must be between 3 and 24
1324
+ # characters in length and use numbers and lower-case letters only.
1325
+ # @param parameters [BlobRestoreParameters] The parameters to provide for
1326
+ # restore blob ranges.
1327
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1328
+ # will be added to the HTTP request.
1329
+ #
1330
+ # @return [Concurrent::Promise] promise which provides async access to http
1331
+ # response.
1332
+ #
1333
+ def restore_blob_ranges_async(resource_group_name, account_name, parameters, custom_headers:nil)
1334
+ # Send request
1335
+ promise = begin_restore_blob_ranges_async(resource_group_name, account_name, parameters, custom_headers:custom_headers)
1336
+
1337
+ promise = promise.then do |response|
1338
+ # Defining deserialization method.
1339
+ deserialize_method = lambda do |parsed_response|
1340
+ result_mapper = Azure::Storage::Mgmt::V2020_08_01_preview::Models::BlobRestoreStatus.mapper()
1341
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
1342
+ end
1343
+
1344
+ # Waiting for response.
1345
+ @client.get_long_running_operation_result(response, deserialize_method, FinalStateVia::LOCATION)
1346
+ end
1347
+
1348
+ promise
1349
+ end
1350
+
1351
+ #
1352
+ # Revoke user delegation keys.
1353
+ #
1354
+ # @param resource_group_name [String] The name of the resource group within the
1355
+ # user's subscription. The name is case insensitive.
1356
+ # @param account_name [String] The name of the storage account within the
1357
+ # specified resource group. Storage account names must be between 3 and 24
1358
+ # characters in length and use numbers and lower-case letters only.
1359
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1360
+ # will be added to the HTTP request.
1361
+ #
1362
+ #
1363
+ def revoke_user_delegation_keys(resource_group_name, account_name, custom_headers:nil)
1364
+ response = revoke_user_delegation_keys_async(resource_group_name, account_name, custom_headers:custom_headers).value!
1365
+ nil
1366
+ end
1367
+
1368
+ #
1369
+ # Revoke user delegation keys.
1370
+ #
1371
+ # @param resource_group_name [String] The name of the resource group within the
1372
+ # user's subscription. The name is case insensitive.
1373
+ # @param account_name [String] The name of the storage account within the
1374
+ # specified resource group. Storage account names must be between 3 and 24
1375
+ # characters in length and use numbers and lower-case letters only.
1376
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1377
+ # will be added to the HTTP request.
1378
+ #
1379
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1380
+ #
1381
+ def revoke_user_delegation_keys_with_http_info(resource_group_name, account_name, custom_headers:nil)
1382
+ revoke_user_delegation_keys_async(resource_group_name, account_name, custom_headers:custom_headers).value!
1383
+ end
1384
+
1385
+ #
1386
+ # Revoke user delegation keys.
1387
+ #
1388
+ # @param resource_group_name [String] The name of the resource group within the
1389
+ # user's subscription. The name is case insensitive.
1390
+ # @param account_name [String] The name of the storage account within the
1391
+ # specified resource group. Storage account names must be between 3 and 24
1392
+ # characters in length and use numbers and lower-case letters only.
1393
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1394
+ # to the HTTP request.
1395
+ #
1396
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1397
+ #
1398
+ def revoke_user_delegation_keys_async(resource_group_name, account_name, custom_headers:nil)
1399
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1400
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1401
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1402
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1403
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
1404
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
1405
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
1406
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1407
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
1408
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1409
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
1410
+
1411
+
1412
+ request_headers = {}
1413
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1414
+
1415
+ # Set Headers
1416
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1417
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1418
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/revokeUserDelegationKeys'
1419
+
1420
+ request_url = @base_url || @client.base_url
1421
+
1422
+ options = {
1423
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1424
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
1425
+ query_params: {'api-version' => @client.api_version},
1426
+ headers: request_headers.merge(custom_headers || {}),
1427
+ base_url: request_url
1428
+ }
1429
+ promise = @client.make_request_async(:post, path_template, options)
1430
+
1431
+ promise = promise.then do |result|
1432
+ http_response = result.response
1433
+ status_code = http_response.status
1434
+ response_content = http_response.body
1435
+ unless status_code == 200
1436
+ error_model = JSON.load(response_content)
1437
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1438
+ end
1439
+
1440
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1441
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1442
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1443
+
1444
+ result
1445
+ end
1446
+
1447
+ promise.execute
1448
+ end
1449
+
1450
+ #
1451
+ # Asynchronously creates a new storage account with the specified parameters.
1452
+ # If an account is already created and a subsequent create request is issued
1453
+ # with different properties, the account properties will be updated. If an
1454
+ # account is already created and a subsequent create or update request is
1455
+ # issued with the exact same set of properties, the request will succeed.
1456
+ #
1457
+ # @param resource_group_name [String] The name of the resource group within the
1458
+ # user's subscription. The name is case insensitive.
1459
+ # @param account_name [String] The name of the storage account within the
1460
+ # specified resource group. Storage account names must be between 3 and 24
1461
+ # characters in length and use numbers and lower-case letters only.
1462
+ # @param parameters [StorageAccountCreateParameters] The parameters to provide
1463
+ # for the created account.
1464
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1465
+ # will be added to the HTTP request.
1466
+ #
1467
+ # @return [StorageAccount] operation results.
1468
+ #
1469
+ def begin_create(resource_group_name, account_name, parameters, custom_headers:nil)
1470
+ response = begin_create_async(resource_group_name, account_name, parameters, custom_headers:custom_headers).value!
1471
+ response.body unless response.nil?
1472
+ end
1473
+
1474
+ #
1475
+ # Asynchronously creates a new storage account with the specified parameters.
1476
+ # If an account is already created and a subsequent create request is issued
1477
+ # with different properties, the account properties will be updated. If an
1478
+ # account is already created and a subsequent create or update request is
1479
+ # issued with the exact same set of properties, the request will succeed.
1480
+ #
1481
+ # @param resource_group_name [String] The name of the resource group within the
1482
+ # user's subscription. The name is case insensitive.
1483
+ # @param account_name [String] The name of the storage account within the
1484
+ # specified resource group. Storage account names must be between 3 and 24
1485
+ # characters in length and use numbers and lower-case letters only.
1486
+ # @param parameters [StorageAccountCreateParameters] The parameters to provide
1487
+ # for the created account.
1488
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1489
+ # will be added to the HTTP request.
1490
+ #
1491
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1492
+ #
1493
+ def begin_create_with_http_info(resource_group_name, account_name, parameters, custom_headers:nil)
1494
+ begin_create_async(resource_group_name, account_name, parameters, custom_headers:custom_headers).value!
1495
+ end
1496
+
1497
+ #
1498
+ # Asynchronously creates a new storage account with the specified parameters.
1499
+ # If an account is already created and a subsequent create request is issued
1500
+ # with different properties, the account properties will be updated. If an
1501
+ # account is already created and a subsequent create or update request is
1502
+ # issued with the exact same set of properties, the request will succeed.
1503
+ #
1504
+ # @param resource_group_name [String] The name of the resource group within the
1505
+ # user's subscription. The name is case insensitive.
1506
+ # @param account_name [String] The name of the storage account within the
1507
+ # specified resource group. Storage account names must be between 3 and 24
1508
+ # characters in length and use numbers and lower-case letters only.
1509
+ # @param parameters [StorageAccountCreateParameters] The parameters to provide
1510
+ # for the created account.
1511
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1512
+ # to the HTTP request.
1513
+ #
1514
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1515
+ #
1516
+ def begin_create_async(resource_group_name, account_name, parameters, custom_headers:nil)
1517
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1518
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1519
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1520
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1521
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
1522
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
1523
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
1524
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1525
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1526
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
1527
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1528
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
1529
+
1530
+
1531
+ request_headers = {}
1532
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1533
+
1534
+ # Set Headers
1535
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1536
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1537
+
1538
+ # Serialize Request
1539
+ request_mapper = Azure::Storage::Mgmt::V2020_08_01_preview::Models::StorageAccountCreateParameters.mapper()
1540
+ request_content = @client.serialize(request_mapper, parameters)
1541
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1542
+
1543
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'
1544
+
1545
+ request_url = @base_url || @client.base_url
1546
+
1547
+ options = {
1548
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1549
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
1550
+ query_params: {'api-version' => @client.api_version},
1551
+ body: request_content,
1552
+ headers: request_headers.merge(custom_headers || {}),
1553
+ base_url: request_url
1554
+ }
1555
+ promise = @client.make_request_async(:put, path_template, options)
1556
+
1557
+ promise = promise.then do |result|
1558
+ http_response = result.response
1559
+ status_code = http_response.status
1560
+ response_content = http_response.body
1561
+ unless status_code == 200 || status_code == 202
1562
+ error_model = JSON.load(response_content)
1563
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1564
+ end
1565
+
1566
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1567
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1568
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1569
+ # Deserialize Response
1570
+ if status_code == 200
1571
+ begin
1572
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1573
+ result_mapper = Azure::Storage::Mgmt::V2020_08_01_preview::Models::StorageAccount.mapper()
1574
+ result.body = @client.deserialize(result_mapper, parsed_response)
1575
+ rescue Exception => e
1576
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1577
+ end
1578
+ end
1579
+
1580
+ result
1581
+ end
1582
+
1583
+ promise.execute
1584
+ end
1585
+
1586
+ #
1587
+ # Failover request can be triggered for a storage account in case of
1588
+ # availability issues. The failover occurs from the storage account's primary
1589
+ # cluster to secondary cluster for RA-GRS accounts. The secondary cluster will
1590
+ # become primary after failover.
1591
+ #
1592
+ # @param resource_group_name [String] The name of the resource group within the
1593
+ # user's subscription. The name is case insensitive.
1594
+ # @param account_name [String] The name of the storage account within the
1595
+ # specified resource group. Storage account names must be between 3 and 24
1596
+ # characters in length and use numbers and lower-case letters only.
1597
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1598
+ # will be added to the HTTP request.
1599
+ #
1600
+ #
1601
+ def begin_failover(resource_group_name, account_name, custom_headers:nil)
1602
+ response = begin_failover_async(resource_group_name, account_name, custom_headers:custom_headers).value!
1603
+ nil
1604
+ end
1605
+
1606
+ #
1607
+ # Failover request can be triggered for a storage account in case of
1608
+ # availability issues. The failover occurs from the storage account's primary
1609
+ # cluster to secondary cluster for RA-GRS accounts. The secondary cluster will
1610
+ # become primary after failover.
1611
+ #
1612
+ # @param resource_group_name [String] The name of the resource group within the
1613
+ # user's subscription. The name is case insensitive.
1614
+ # @param account_name [String] The name of the storage account within the
1615
+ # specified resource group. Storage account names must be between 3 and 24
1616
+ # characters in length and use numbers and lower-case letters only.
1617
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1618
+ # will be added to the HTTP request.
1619
+ #
1620
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1621
+ #
1622
+ def begin_failover_with_http_info(resource_group_name, account_name, custom_headers:nil)
1623
+ begin_failover_async(resource_group_name, account_name, custom_headers:custom_headers).value!
1624
+ end
1625
+
1626
+ #
1627
+ # Failover request can be triggered for a storage account in case of
1628
+ # availability issues. The failover occurs from the storage account's primary
1629
+ # cluster to secondary cluster for RA-GRS accounts. The secondary cluster will
1630
+ # become primary after failover.
1631
+ #
1632
+ # @param resource_group_name [String] The name of the resource group within the
1633
+ # user's subscription. The name is case insensitive.
1634
+ # @param account_name [String] The name of the storage account within the
1635
+ # specified resource group. Storage account names must be between 3 and 24
1636
+ # characters in length and use numbers and lower-case letters only.
1637
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1638
+ # to the HTTP request.
1639
+ #
1640
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1641
+ #
1642
+ def begin_failover_async(resource_group_name, account_name, custom_headers:nil)
1643
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1644
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1645
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1646
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1647
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
1648
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
1649
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
1650
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1651
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
1652
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1653
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
1654
+
1655
+
1656
+ request_headers = {}
1657
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1658
+
1659
+ # Set Headers
1660
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1661
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1662
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/failover'
1663
+
1664
+ request_url = @base_url || @client.base_url
1665
+
1666
+ options = {
1667
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1668
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
1669
+ query_params: {'api-version' => @client.api_version},
1670
+ headers: request_headers.merge(custom_headers || {}),
1671
+ base_url: request_url
1672
+ }
1673
+ promise = @client.make_request_async(:post, path_template, options)
1674
+
1675
+ promise = promise.then do |result|
1676
+ http_response = result.response
1677
+ status_code = http_response.status
1678
+ response_content = http_response.body
1679
+ unless status_code == 200 || status_code == 202
1680
+ error_model = JSON.load(response_content)
1681
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1682
+ end
1683
+
1684
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1685
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1686
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1687
+
1688
+ result
1689
+ end
1690
+
1691
+ promise.execute
1692
+ end
1693
+
1694
+ #
1695
+ # Restore blobs in the specified blob ranges
1696
+ #
1697
+ # @param resource_group_name [String] The name of the resource group within the
1698
+ # user's subscription. The name is case insensitive.
1699
+ # @param account_name [String] The name of the storage account within the
1700
+ # specified resource group. Storage account names must be between 3 and 24
1701
+ # characters in length and use numbers and lower-case letters only.
1702
+ # @param parameters [BlobRestoreParameters] The parameters to provide for
1703
+ # restore blob ranges.
1704
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1705
+ # will be added to the HTTP request.
1706
+ #
1707
+ # @return [BlobRestoreStatus] operation results.
1708
+ #
1709
+ def begin_restore_blob_ranges(resource_group_name, account_name, parameters, custom_headers:nil)
1710
+ response = begin_restore_blob_ranges_async(resource_group_name, account_name, parameters, custom_headers:custom_headers).value!
1711
+ response.body unless response.nil?
1712
+ end
1713
+
1714
+ #
1715
+ # Restore blobs in the specified blob ranges
1716
+ #
1717
+ # @param resource_group_name [String] The name of the resource group within the
1718
+ # user's subscription. The name is case insensitive.
1719
+ # @param account_name [String] The name of the storage account within the
1720
+ # specified resource group. Storage account names must be between 3 and 24
1721
+ # characters in length and use numbers and lower-case letters only.
1722
+ # @param parameters [BlobRestoreParameters] The parameters to provide for
1723
+ # restore blob ranges.
1724
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1725
+ # will be added to the HTTP request.
1726
+ #
1727
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1728
+ #
1729
+ def begin_restore_blob_ranges_with_http_info(resource_group_name, account_name, parameters, custom_headers:nil)
1730
+ begin_restore_blob_ranges_async(resource_group_name, account_name, parameters, custom_headers:custom_headers).value!
1731
+ end
1732
+
1733
+ #
1734
+ # Restore blobs in the specified blob ranges
1735
+ #
1736
+ # @param resource_group_name [String] The name of the resource group within the
1737
+ # user's subscription. The name is case insensitive.
1738
+ # @param account_name [String] The name of the storage account within the
1739
+ # specified resource group. Storage account names must be between 3 and 24
1740
+ # characters in length and use numbers and lower-case letters only.
1741
+ # @param parameters [BlobRestoreParameters] The parameters to provide for
1742
+ # restore blob ranges.
1743
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1744
+ # to the HTTP request.
1745
+ #
1746
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1747
+ #
1748
+ def begin_restore_blob_ranges_async(resource_group_name, account_name, parameters, custom_headers:nil)
1749
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1750
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1751
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1752
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1753
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
1754
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
1755
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
1756
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1757
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
1758
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1759
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
1760
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1761
+
1762
+
1763
+ request_headers = {}
1764
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1765
+
1766
+ # Set Headers
1767
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1768
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1769
+
1770
+ # Serialize Request
1771
+ request_mapper = Azure::Storage::Mgmt::V2020_08_01_preview::Models::BlobRestoreParameters.mapper()
1772
+ request_content = @client.serialize(request_mapper, parameters)
1773
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1774
+
1775
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/restoreBlobRanges'
1776
+
1777
+ request_url = @base_url || @client.base_url
1778
+
1779
+ options = {
1780
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1781
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
1782
+ query_params: {'api-version' => @client.api_version},
1783
+ body: request_content,
1784
+ headers: request_headers.merge(custom_headers || {}),
1785
+ base_url: request_url
1786
+ }
1787
+ promise = @client.make_request_async(:post, path_template, options)
1788
+
1789
+ promise = promise.then do |result|
1790
+ http_response = result.response
1791
+ status_code = http_response.status
1792
+ response_content = http_response.body
1793
+ unless status_code == 200 || status_code == 202
1794
+ error_model = JSON.load(response_content)
1795
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1796
+ end
1797
+
1798
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1799
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1800
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1801
+ # Deserialize Response
1802
+ if status_code == 200
1803
+ begin
1804
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1805
+ result_mapper = Azure::Storage::Mgmt::V2020_08_01_preview::Models::BlobRestoreStatus.mapper()
1806
+ result.body = @client.deserialize(result_mapper, parsed_response)
1807
+ rescue Exception => e
1808
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1809
+ end
1810
+ end
1811
+ # Deserialize Response
1812
+ if status_code == 202
1813
+ begin
1814
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1815
+ result_mapper = Azure::Storage::Mgmt::V2020_08_01_preview::Models::BlobRestoreStatus.mapper()
1816
+ result.body = @client.deserialize(result_mapper, parsed_response)
1817
+ rescue Exception => e
1818
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1819
+ end
1820
+ end
1821
+
1822
+ result
1823
+ end
1824
+
1825
+ promise.execute
1826
+ end
1827
+
1828
+ #
1829
+ # Lists all the storage accounts available under the subscription. Note that
1830
+ # storage keys are not returned; use the ListKeys operation for this.
1831
+ #
1832
+ # @param next_page_link [String] The NextLink from the previous successful call
1833
+ # to List operation.
1834
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1835
+ # will be added to the HTTP request.
1836
+ #
1837
+ # @return [StorageAccountListResult] operation results.
1838
+ #
1839
+ def list_next(next_page_link, custom_headers:nil)
1840
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
1841
+ response.body unless response.nil?
1842
+ end
1843
+
1844
+ #
1845
+ # Lists all the storage accounts available under the subscription. Note that
1846
+ # storage keys are not returned; use the ListKeys operation for this.
1847
+ #
1848
+ # @param next_page_link [String] The NextLink from the previous successful call
1849
+ # to List operation.
1850
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1851
+ # will be added to the HTTP request.
1852
+ #
1853
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1854
+ #
1855
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
1856
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
1857
+ end
1858
+
1859
+ #
1860
+ # Lists all the storage accounts available under the subscription. Note that
1861
+ # storage keys are not returned; use the ListKeys operation for this.
1862
+ #
1863
+ # @param next_page_link [String] The NextLink from the previous successful call
1864
+ # to List operation.
1865
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1866
+ # to the HTTP request.
1867
+ #
1868
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1869
+ #
1870
+ def list_next_async(next_page_link, custom_headers:nil)
1871
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1872
+
1873
+
1874
+ request_headers = {}
1875
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1876
+
1877
+ # Set Headers
1878
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1879
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1880
+ path_template = '{nextLink}'
1881
+
1882
+ request_url = @base_url || @client.base_url
1883
+
1884
+ options = {
1885
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1886
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1887
+ headers: request_headers.merge(custom_headers || {}),
1888
+ base_url: request_url
1889
+ }
1890
+ promise = @client.make_request_async(:get, path_template, options)
1891
+
1892
+ promise = promise.then do |result|
1893
+ http_response = result.response
1894
+ status_code = http_response.status
1895
+ response_content = http_response.body
1896
+ unless status_code == 200
1897
+ error_model = JSON.load(response_content)
1898
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1899
+ end
1900
+
1901
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1902
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1903
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1904
+ # Deserialize Response
1905
+ if status_code == 200
1906
+ begin
1907
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1908
+ result_mapper = Azure::Storage::Mgmt::V2020_08_01_preview::Models::StorageAccountListResult.mapper()
1909
+ result.body = @client.deserialize(result_mapper, parsed_response)
1910
+ rescue Exception => e
1911
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1912
+ end
1913
+ end
1914
+
1915
+ result
1916
+ end
1917
+
1918
+ promise.execute
1919
+ end
1920
+
1921
+ #
1922
+ # Lists all the storage accounts available under the subscription. Note that
1923
+ # storage keys are not returned; use the ListKeys operation for this.
1924
+ #
1925
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1926
+ # will be added to the HTTP request.
1927
+ #
1928
+ # @return [StorageAccountListResult] which provide lazy access to pages of the
1929
+ # response.
1930
+ #
1931
+ def list_as_lazy(custom_headers:nil)
1932
+ response = list_async(custom_headers:custom_headers).value!
1933
+ unless response.nil?
1934
+ page = response.body
1935
+ page.next_method = Proc.new do |next_page_link|
1936
+ list_next_async(next_page_link, custom_headers:custom_headers)
1937
+ end
1938
+ page
1939
+ end
1940
+ end
1941
+
1942
+ end
1943
+ end