azure-mgmt-storage 22.1.1__py3-none-any.whl → 23.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) hide show
  1. azure/mgmt/storage/__init__.py +19 -7
  2. azure/mgmt/storage/_configuration.py +27 -29
  3. azure/mgmt/storage/{v2016_01_01/models/_patch.py → _patch.py} +5 -4
  4. azure/mgmt/storage/_storage_management_client.py +184 -499
  5. azure/mgmt/storage/{v2016_01_01/_version.py → _utils/__init__.py} +0 -3
  6. azure/mgmt/storage/{_serialization.py → _utils/serialization.py} +46 -131
  7. azure/mgmt/storage/_version.py +1 -1
  8. azure/mgmt/storage/aio/__init__.py +21 -2
  9. azure/mgmt/storage/aio/_configuration.py +27 -29
  10. azure/mgmt/storage/{v2017_10_01/aio/operations → aio}/_patch.py +5 -4
  11. azure/mgmt/storage/aio/_storage_management_client.py +188 -497
  12. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/__init__.py +1 -0
  13. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_blob_containers_operations.py +66 -69
  14. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_blob_inventory_policies_operations.py +26 -34
  15. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_blob_services_operations.py +20 -22
  16. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_deleted_accounts_operations.py +14 -17
  17. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_encryption_scopes_operations.py +27 -30
  18. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_file_services_operations.py +24 -27
  19. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_file_shares_operations.py +36 -39
  20. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_local_users_operations.py +26 -29
  21. azure/mgmt/storage/{v2019_06_01/aio → aio}/operations/_management_policies_operations.py +23 -30
  22. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_network_security_perimeter_configurations_operations.py +16 -19
  23. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_object_replication_policies_operations.py +21 -23
  24. azure/mgmt/storage/{v2017_10_01/aio → aio}/operations/_operations.py +12 -15
  25. azure/mgmt/storage/{v2016_01_01/aio → aio}/operations/_patch.py +5 -4
  26. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_private_endpoint_connections_operations.py +21 -23
  27. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_private_link_resources_operations.py +11 -13
  28. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_queue_operations.py +27 -30
  29. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_queue_services_operations.py +19 -21
  30. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_skus_operations.py +12 -15
  31. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_storage_accounts_operations.py +81 -96
  32. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_storage_task_assignment_instances_report_operations.py +14 -16
  33. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_storage_task_assignments_instances_report_operations.py +14 -16
  34. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_storage_task_assignments_operations.py +30 -39
  35. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_table_operations.py +27 -29
  36. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_table_services_operations.py +19 -21
  37. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_usages_operations.py +12 -14
  38. azure/mgmt/storage/{v2024_01_01/models → models}/_models_py3.py +870 -927
  39. azure/mgmt/storage/{v2016_01_01/operations → models}/_patch.py +5 -4
  40. azure/mgmt/storage/{v2024_01_01/models → models}/_storage_management_client_enums.py +1 -0
  41. azure/mgmt/storage/{v2024_01_01/operations → operations}/__init__.py +1 -0
  42. azure/mgmt/storage/{v2024_01_01/operations → operations}/_blob_containers_operations.py +81 -84
  43. azure/mgmt/storage/{v2024_01_01/operations → operations}/_blob_inventory_policies_operations.py +31 -39
  44. azure/mgmt/storage/{v2024_01_01/operations → operations}/_blob_services_operations.py +24 -27
  45. azure/mgmt/storage/{v2024_01_01/operations → operations}/_deleted_accounts_operations.py +16 -18
  46. azure/mgmt/storage/{v2024_01_01/operations → operations}/_encryption_scopes_operations.py +32 -34
  47. azure/mgmt/storage/{v2024_01_01/operations → operations}/_file_services_operations.py +30 -32
  48. azure/mgmt/storage/{v2024_01_01/operations → operations}/_file_shares_operations.py +44 -47
  49. azure/mgmt/storage/{v2024_01_01/operations → operations}/_local_users_operations.py +33 -35
  50. azure/mgmt/storage/{v2024_01_01/operations → operations}/_management_policies_operations.py +27 -34
  51. azure/mgmt/storage/{v2024_01_01/operations → operations}/_network_security_perimeter_configurations_operations.py +20 -22
  52. azure/mgmt/storage/{v2024_01_01/operations → operations}/_object_replication_policies_operations.py +26 -29
  53. azure/mgmt/storage/{v2024_01_01/operations → operations}/_operations.py +12 -15
  54. azure/mgmt/storage/operations/_patch.py +21 -0
  55. azure/mgmt/storage/{v2024_01_01/operations → operations}/_private_endpoint_connections_operations.py +26 -29
  56. azure/mgmt/storage/{v2024_01_01/operations → operations}/_private_link_resources_operations.py +13 -15
  57. azure/mgmt/storage/{v2024_01_01/operations → operations}/_queue_operations.py +33 -35
  58. azure/mgmt/storage/{v2024_01_01/operations → operations}/_queue_services_operations.py +23 -25
  59. azure/mgmt/storage/{v2024_01_01/operations → operations}/_skus_operations.py +12 -15
  60. azure/mgmt/storage/{v2024_01_01/operations → operations}/_storage_accounts_operations.py +98 -106
  61. azure/mgmt/storage/{v2024_01_01/operations → operations}/_storage_task_assignment_instances_report_operations.py +15 -19
  62. azure/mgmt/storage/{v2024_01_01/operations → operations}/_storage_task_assignments_instances_report_operations.py +15 -19
  63. azure/mgmt/storage/{v2024_01_01/operations → operations}/_storage_task_assignments_operations.py +36 -47
  64. azure/mgmt/storage/{v2024_01_01/operations → operations}/_table_operations.py +33 -35
  65. azure/mgmt/storage/{v2024_01_01/operations → operations}/_table_services_operations.py +23 -25
  66. azure/mgmt/storage/{v2024_01_01/operations → operations}/_usages_operations.py +13 -16
  67. {azure_mgmt_storage-22.1.1.dist-info → azure_mgmt_storage-23.0.0.dist-info}/METADATA +20 -10
  68. azure_mgmt_storage-23.0.0.dist-info/RECORD +73 -0
  69. {azure_mgmt_storage-22.1.1.dist-info → azure_mgmt_storage-23.0.0.dist-info}/WHEEL +1 -1
  70. azure/mgmt/storage/models.py +0 -8
  71. azure/mgmt/storage/v2016_01_01/__init__.py +0 -32
  72. azure/mgmt/storage/v2016_01_01/_configuration.py +0 -65
  73. azure/mgmt/storage/v2016_01_01/_patch.py +0 -32
  74. azure/mgmt/storage/v2016_01_01/_storage_management_client.py +0 -117
  75. azure/mgmt/storage/v2016_01_01/aio/__init__.py +0 -29
  76. azure/mgmt/storage/v2016_01_01/aio/_configuration.py +0 -65
  77. azure/mgmt/storage/v2016_01_01/aio/_patch.py +0 -32
  78. azure/mgmt/storage/v2016_01_01/aio/_storage_management_client.py +0 -120
  79. azure/mgmt/storage/v2016_01_01/aio/operations/__init__.py +0 -27
  80. azure/mgmt/storage/v2016_01_01/aio/operations/_storage_accounts_operations.py +0 -1023
  81. azure/mgmt/storage/v2016_01_01/aio/operations/_usage_operations.py +0 -130
  82. azure/mgmt/storage/v2016_01_01/models/__init__.py +0 -88
  83. azure/mgmt/storage/v2016_01_01/models/_models_py3.py +0 -829
  84. azure/mgmt/storage/v2016_01_01/models/_storage_management_client_enums.py +0 -99
  85. azure/mgmt/storage/v2016_01_01/operations/__init__.py +0 -27
  86. azure/mgmt/storage/v2016_01_01/operations/_storage_accounts_operations.py +0 -1278
  87. azure/mgmt/storage/v2016_01_01/operations/_usage_operations.py +0 -157
  88. azure/mgmt/storage/v2016_01_01/py.typed +0 -1
  89. azure/mgmt/storage/v2017_10_01/__init__.py +0 -32
  90. azure/mgmt/storage/v2017_10_01/_configuration.py +0 -65
  91. azure/mgmt/storage/v2017_10_01/_patch.py +0 -32
  92. azure/mgmt/storage/v2017_10_01/_storage_management.py +0 -121
  93. azure/mgmt/storage/v2017_10_01/_version.py +0 -9
  94. azure/mgmt/storage/v2017_10_01/aio/__init__.py +0 -29
  95. azure/mgmt/storage/v2017_10_01/aio/_configuration.py +0 -65
  96. azure/mgmt/storage/v2017_10_01/aio/_patch.py +0 -32
  97. azure/mgmt/storage/v2017_10_01/aio/_storage_management.py +0 -124
  98. azure/mgmt/storage/v2017_10_01/aio/operations/__init__.py +0 -31
  99. azure/mgmt/storage/v2017_10_01/aio/operations/_skus_operations.py +0 -130
  100. azure/mgmt/storage/v2017_10_01/aio/operations/_storage_accounts_operations.py +0 -1299
  101. azure/mgmt/storage/v2017_10_01/aio/operations/_usage_operations.py +0 -130
  102. azure/mgmt/storage/v2017_10_01/models/__init__.py +0 -140
  103. azure/mgmt/storage/v2017_10_01/models/_models_py3.py +0 -1851
  104. azure/mgmt/storage/v2017_10_01/models/_patch.py +0 -20
  105. azure/mgmt/storage/v2017_10_01/models/_storage_management_enums.py +0 -192
  106. azure/mgmt/storage/v2017_10_01/operations/__init__.py +0 -31
  107. azure/mgmt/storage/v2017_10_01/operations/_operations.py +0 -151
  108. azure/mgmt/storage/v2017_10_01/operations/_patch.py +0 -20
  109. azure/mgmt/storage/v2017_10_01/operations/_skus_operations.py +0 -157
  110. azure/mgmt/storage/v2017_10_01/operations/_storage_accounts_operations.py +0 -1638
  111. azure/mgmt/storage/v2017_10_01/operations/_usage_operations.py +0 -157
  112. azure/mgmt/storage/v2017_10_01/py.typed +0 -1
  113. azure/mgmt/storage/v2019_06_01/__init__.py +0 -32
  114. azure/mgmt/storage/v2019_06_01/_configuration.py +0 -64
  115. azure/mgmt/storage/v2019_06_01/_patch.py +0 -32
  116. azure/mgmt/storage/v2019_06_01/_storage_management_client.py +0 -213
  117. azure/mgmt/storage/v2019_06_01/_version.py +0 -9
  118. azure/mgmt/storage/v2019_06_01/aio/__init__.py +0 -29
  119. azure/mgmt/storage/v2019_06_01/aio/_configuration.py +0 -64
  120. azure/mgmt/storage/v2019_06_01/aio/_patch.py +0 -32
  121. azure/mgmt/storage/v2019_06_01/aio/_storage_management_client.py +0 -217
  122. azure/mgmt/storage/v2019_06_01/aio/operations/__init__.py +0 -59
  123. azure/mgmt/storage/v2019_06_01/aio/operations/_blob_containers_operations.py +0 -1725
  124. azure/mgmt/storage/v2019_06_01/aio/operations/_blob_inventory_policies_operations.py +0 -437
  125. azure/mgmt/storage/v2019_06_01/aio/operations/_blob_services_operations.py +0 -368
  126. azure/mgmt/storage/v2019_06_01/aio/operations/_encryption_scopes_operations.py +0 -538
  127. azure/mgmt/storage/v2019_06_01/aio/operations/_file_services_operations.py +0 -335
  128. azure/mgmt/storage/v2019_06_01/aio/operations/_file_shares_operations.py +0 -771
  129. azure/mgmt/storage/v2019_06_01/aio/operations/_object_replication_policies_operations.py +0 -428
  130. azure/mgmt/storage/v2019_06_01/aio/operations/_operations.py +0 -130
  131. azure/mgmt/storage/v2019_06_01/aio/operations/_patch.py +0 -20
  132. azure/mgmt/storage/v2019_06_01/aio/operations/_private_endpoint_connections_operations.py +0 -424
  133. azure/mgmt/storage/v2019_06_01/aio/operations/_private_link_resources_operations.py +0 -113
  134. azure/mgmt/storage/v2019_06_01/aio/operations/_queue_operations.py +0 -597
  135. azure/mgmt/storage/v2019_06_01/aio/operations/_queue_services_operations.py +0 -335
  136. azure/mgmt/storage/v2019_06_01/aio/operations/_skus_operations.py +0 -131
  137. azure/mgmt/storage/v2019_06_01/aio/operations/_storage_accounts_operations.py +0 -1696
  138. azure/mgmt/storage/v2019_06_01/aio/operations/_table_operations.py +0 -394
  139. azure/mgmt/storage/v2019_06_01/aio/operations/_table_services_operations.py +0 -335
  140. azure/mgmt/storage/v2019_06_01/aio/operations/_usages_operations.py +0 -134
  141. azure/mgmt/storage/v2019_06_01/models/__init__.py +0 -364
  142. azure/mgmt/storage/v2019_06_01/models/_models_py3.py +0 -6038
  143. azure/mgmt/storage/v2019_06_01/models/_patch.py +0 -20
  144. azure/mgmt/storage/v2019_06_01/models/_storage_management_client_enums.py +0 -456
  145. azure/mgmt/storage/v2019_06_01/operations/__init__.py +0 -59
  146. azure/mgmt/storage/v2019_06_01/operations/_blob_containers_operations.py +0 -2226
  147. azure/mgmt/storage/v2019_06_01/operations/_blob_inventory_policies_operations.py +0 -582
  148. azure/mgmt/storage/v2019_06_01/operations/_blob_services_operations.py +0 -476
  149. azure/mgmt/storage/v2019_06_01/operations/_encryption_scopes_operations.py +0 -677
  150. azure/mgmt/storage/v2019_06_01/operations/_file_services_operations.py +0 -444
  151. azure/mgmt/storage/v2019_06_01/operations/_file_shares_operations.py +0 -1000
  152. azure/mgmt/storage/v2019_06_01/operations/_management_policies_operations.py +0 -453
  153. azure/mgmt/storage/v2019_06_01/operations/_object_replication_policies_operations.py +0 -567
  154. azure/mgmt/storage/v2019_06_01/operations/_operations.py +0 -151
  155. azure/mgmt/storage/v2019_06_01/operations/_patch.py +0 -20
  156. azure/mgmt/storage/v2019_06_01/operations/_private_endpoint_connections_operations.py +0 -575
  157. azure/mgmt/storage/v2019_06_01/operations/_private_link_resources_operations.py +0 -149
  158. azure/mgmt/storage/v2019_06_01/operations/_queue_operations.py +0 -805
  159. azure/mgmt/storage/v2019_06_01/operations/_queue_services_operations.py +0 -444
  160. azure/mgmt/storage/v2019_06_01/operations/_skus_operations.py +0 -157
  161. azure/mgmt/storage/v2019_06_01/operations/_storage_accounts_operations.py +0 -2122
  162. azure/mgmt/storage/v2019_06_01/operations/_table_operations.py +0 -563
  163. azure/mgmt/storage/v2019_06_01/operations/_table_services_operations.py +0 -444
  164. azure/mgmt/storage/v2019_06_01/operations/_usages_operations.py +0 -164
  165. azure/mgmt/storage/v2019_06_01/py.typed +0 -1
  166. azure/mgmt/storage/v2024_01_01/__init__.py +0 -32
  167. azure/mgmt/storage/v2024_01_01/_configuration.py +0 -64
  168. azure/mgmt/storage/v2024_01_01/_patch.py +0 -20
  169. azure/mgmt/storage/v2024_01_01/_storage_management_client.py +0 -256
  170. azure/mgmt/storage/v2024_01_01/_version.py +0 -9
  171. azure/mgmt/storage/v2024_01_01/aio/__init__.py +0 -29
  172. azure/mgmt/storage/v2024_01_01/aio/_configuration.py +0 -64
  173. azure/mgmt/storage/v2024_01_01/aio/_patch.py +0 -20
  174. azure/mgmt/storage/v2024_01_01/aio/_storage_management_client.py +0 -261
  175. azure/mgmt/storage/v2024_01_01/aio/operations/_management_policies_operations.py +0 -343
  176. azure/mgmt/storage/v2024_01_01/aio/operations/_operations.py +0 -130
  177. azure/mgmt/storage/v2024_01_01/aio/operations/_patch.py +0 -20
  178. azure/mgmt/storage/v2024_01_01/models/_patch.py +0 -20
  179. azure/mgmt/storage/v2024_01_01/operations/_patch.py +0 -20
  180. azure/mgmt/storage/v2024_01_01/py.typed +0 -1
  181. azure_mgmt_storage-22.1.1.dist-info/RECORD +0 -183
  182. /azure/mgmt/storage/{v2024_01_01/models → models}/__init__.py +0 -0
  183. {azure_mgmt_storage-22.1.1.dist-info → azure_mgmt_storage-23.0.0.dist-info}/LICENSE +0 -0
  184. {azure_mgmt_storage-22.1.1.dist-info → azure_mgmt_storage-23.0.0.dist-info}/top_level.txt +0 -0
@@ -1,1023 +0,0 @@
1
- # pylint: disable=too-many-lines
2
- # coding=utf-8
3
- # --------------------------------------------------------------------------
4
- # Copyright (c) Microsoft Corporation. All rights reserved.
5
- # Licensed under the MIT License. See License.txt in the project root for license information.
6
- # Code generated by Microsoft (R) AutoRest Code Generator.
7
- # Changes may cause incorrect behavior and will be lost if the code is regenerated.
8
- # --------------------------------------------------------------------------
9
- from io import IOBase
10
- import sys
11
- from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
12
- import urllib.parse
13
-
14
- from azure.core.async_paging import AsyncItemPaged, AsyncList
15
- from azure.core.exceptions import (
16
- ClientAuthenticationError,
17
- HttpResponseError,
18
- ResourceExistsError,
19
- ResourceNotFoundError,
20
- ResourceNotModifiedError,
21
- StreamClosedError,
22
- StreamConsumedError,
23
- map_error,
24
- )
25
- from azure.core.pipeline import PipelineResponse
26
- from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod
27
- from azure.core.rest import AsyncHttpResponse, HttpRequest
28
- from azure.core.tracing.decorator import distributed_trace
29
- from azure.core.tracing.decorator_async import distributed_trace_async
30
- from azure.core.utils import case_insensitive_dict
31
- from azure.mgmt.core.exceptions import ARMErrorFormat
32
- from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling
33
-
34
- from ... import models as _models
35
- from ...operations._storage_accounts_operations import (
36
- build_check_name_availability_request,
37
- build_create_request,
38
- build_delete_request,
39
- build_get_properties_request,
40
- build_list_by_resource_group_request,
41
- build_list_keys_request,
42
- build_list_request,
43
- build_regenerate_key_request,
44
- build_update_request,
45
- )
46
-
47
- if sys.version_info >= (3, 9):
48
- from collections.abc import MutableMapping
49
- else:
50
- from typing import MutableMapping # type: ignore
51
- T = TypeVar("T")
52
- ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
53
-
54
-
55
- class StorageAccountsOperations:
56
- """
57
- .. warning::
58
- **DO NOT** instantiate this class directly.
59
-
60
- Instead, you should access the following operations through
61
- :class:`~azure.mgmt.storage.v2016_01_01.aio.StorageManagementClient`'s
62
- :attr:`storage_accounts` attribute.
63
- """
64
-
65
- models = _models
66
-
67
- def __init__(self, *args, **kwargs) -> None:
68
- input_args = list(args)
69
- self._client = input_args.pop(0) if input_args else kwargs.pop("client")
70
- self._config = input_args.pop(0) if input_args else kwargs.pop("config")
71
- self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
72
- self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
73
- self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
74
-
75
- @overload
76
- async def check_name_availability(
77
- self,
78
- account_name: _models.StorageAccountCheckNameAvailabilityParameters,
79
- *,
80
- content_type: str = "application/json",
81
- **kwargs: Any
82
- ) -> _models.CheckNameAvailabilityResult:
83
- """Checks that the storage account name is valid and is not already in use.
84
-
85
- :param account_name: The name of the storage account within the specified resource group.
86
- Storage account names must be between 3 and 24 characters in length and use numbers and
87
- lower-case letters only. Required.
88
- :type account_name:
89
- ~azure.mgmt.storage.v2016_01_01.models.StorageAccountCheckNameAvailabilityParameters
90
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
91
- Default value is "application/json".
92
- :paramtype content_type: str
93
- :return: CheckNameAvailabilityResult or the result of cls(response)
94
- :rtype: ~azure.mgmt.storage.v2016_01_01.models.CheckNameAvailabilityResult
95
- :raises ~azure.core.exceptions.HttpResponseError:
96
- """
97
-
98
- @overload
99
- async def check_name_availability(
100
- self, account_name: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
101
- ) -> _models.CheckNameAvailabilityResult:
102
- """Checks that the storage account name is valid and is not already in use.
103
-
104
- :param account_name: The name of the storage account within the specified resource group.
105
- Storage account names must be between 3 and 24 characters in length and use numbers and
106
- lower-case letters only. Required.
107
- :type account_name: IO[bytes]
108
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
109
- Known values are: 'application/json', 'text/json'. Default value is "application/json".
110
- :paramtype content_type: str
111
- :return: CheckNameAvailabilityResult or the result of cls(response)
112
- :rtype: ~azure.mgmt.storage.v2016_01_01.models.CheckNameAvailabilityResult
113
- :raises ~azure.core.exceptions.HttpResponseError:
114
- """
115
-
116
- @distributed_trace_async
117
- async def check_name_availability(
118
- self, account_name: Union[_models.StorageAccountCheckNameAvailabilityParameters, IO[bytes]], **kwargs: Any
119
- ) -> _models.CheckNameAvailabilityResult:
120
- """Checks that the storage account name is valid and is not already in use.
121
-
122
- :param account_name: The name of the storage account within the specified resource group.
123
- Storage account names must be between 3 and 24 characters in length and use numbers and
124
- lower-case letters only. Is either a StorageAccountCheckNameAvailabilityParameters type or a
125
- IO[bytes] type. Required.
126
- :type account_name:
127
- ~azure.mgmt.storage.v2016_01_01.models.StorageAccountCheckNameAvailabilityParameters or
128
- IO[bytes]
129
- :return: CheckNameAvailabilityResult or the result of cls(response)
130
- :rtype: ~azure.mgmt.storage.v2016_01_01.models.CheckNameAvailabilityResult
131
- :raises ~azure.core.exceptions.HttpResponseError:
132
- """
133
- error_map: MutableMapping = {
134
- 401: ClientAuthenticationError,
135
- 404: ResourceNotFoundError,
136
- 409: ResourceExistsError,
137
- 304: ResourceNotModifiedError,
138
- }
139
- error_map.update(kwargs.pop("error_map", {}) or {})
140
-
141
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
142
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
143
-
144
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-01-01"))
145
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
146
- cls: ClsType[_models.CheckNameAvailabilityResult] = kwargs.pop("cls", None)
147
-
148
- content_type = content_type or "application/json"
149
- _json = None
150
- _content = None
151
- if isinstance(account_name, (IOBase, bytes)):
152
- _content = account_name
153
- else:
154
- _json = self._serialize.body(account_name, "StorageAccountCheckNameAvailabilityParameters")
155
-
156
- _request = build_check_name_availability_request(
157
- subscription_id=self._config.subscription_id,
158
- api_version=api_version,
159
- content_type=content_type,
160
- json=_json,
161
- content=_content,
162
- headers=_headers,
163
- params=_params,
164
- )
165
- _request.url = self._client.format_url(_request.url)
166
-
167
- _stream = False
168
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
169
- _request, stream=_stream, **kwargs
170
- )
171
-
172
- response = pipeline_response.http_response
173
-
174
- if response.status_code not in [200]:
175
- map_error(status_code=response.status_code, response=response, error_map=error_map)
176
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
177
-
178
- deserialized = self._deserialize("CheckNameAvailabilityResult", pipeline_response.http_response)
179
-
180
- if cls:
181
- return cls(pipeline_response, deserialized, {}) # type: ignore
182
-
183
- return deserialized # type: ignore
184
-
185
- async def _create_initial(
186
- self,
187
- resource_group_name: str,
188
- account_name: str,
189
- parameters: Union[_models.StorageAccountCreateParameters, IO[bytes]],
190
- **kwargs: Any
191
- ) -> AsyncIterator[bytes]:
192
- error_map: MutableMapping = {
193
- 401: ClientAuthenticationError,
194
- 404: ResourceNotFoundError,
195
- 409: ResourceExistsError,
196
- 304: ResourceNotModifiedError,
197
- }
198
- error_map.update(kwargs.pop("error_map", {}) or {})
199
-
200
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
201
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
202
-
203
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-01-01"))
204
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
205
- cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
206
-
207
- content_type = content_type or "application/json"
208
- _json = None
209
- _content = None
210
- if isinstance(parameters, (IOBase, bytes)):
211
- _content = parameters
212
- else:
213
- _json = self._serialize.body(parameters, "StorageAccountCreateParameters")
214
-
215
- _request = build_create_request(
216
- resource_group_name=resource_group_name,
217
- account_name=account_name,
218
- subscription_id=self._config.subscription_id,
219
- api_version=api_version,
220
- content_type=content_type,
221
- json=_json,
222
- content=_content,
223
- headers=_headers,
224
- params=_params,
225
- )
226
- _request.url = self._client.format_url(_request.url)
227
-
228
- _decompress = kwargs.pop("decompress", True)
229
- _stream = True
230
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
231
- _request, stream=_stream, **kwargs
232
- )
233
-
234
- response = pipeline_response.http_response
235
-
236
- if response.status_code not in [200, 202]:
237
- try:
238
- await response.read() # Load the body in memory and close the socket
239
- except (StreamConsumedError, StreamClosedError):
240
- pass
241
- map_error(status_code=response.status_code, response=response, error_map=error_map)
242
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
243
-
244
- deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
245
-
246
- if cls:
247
- return cls(pipeline_response, deserialized, {}) # type: ignore
248
-
249
- return deserialized # type: ignore
250
-
251
- @overload
252
- async def begin_create(
253
- self,
254
- resource_group_name: str,
255
- account_name: str,
256
- parameters: _models.StorageAccountCreateParameters,
257
- *,
258
- content_type: str = "application/json",
259
- **kwargs: Any
260
- ) -> AsyncLROPoller[_models.StorageAccount]:
261
- """Asynchronously creates a new storage account with the specified parameters. If an account is
262
- already created and a subsequent create request is issued with different properties, the
263
- account properties will be updated. If an account is already created and a subsequent create or
264
- update request is issued with the exact same set of properties, the request will succeed.
265
-
266
- :param resource_group_name: The name of the resource group within the user's subscription.
267
- Required.
268
- :type resource_group_name: str
269
- :param account_name: The name of the storage account within the specified resource group.
270
- Storage account names must be between 3 and 24 characters in length and use numbers and
271
- lower-case letters only. Required.
272
- :type account_name: str
273
- :param parameters: The parameters to provide for the created account. Required.
274
- :type parameters: ~azure.mgmt.storage.v2016_01_01.models.StorageAccountCreateParameters
275
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
276
- Default value is "application/json".
277
- :paramtype content_type: str
278
- :return: An instance of AsyncLROPoller that returns either StorageAccount or the result of
279
- cls(response)
280
- :rtype:
281
- ~azure.core.polling.AsyncLROPoller[~azure.mgmt.storage.v2016_01_01.models.StorageAccount]
282
- :raises ~azure.core.exceptions.HttpResponseError:
283
- """
284
-
285
- @overload
286
- async def begin_create(
287
- self,
288
- resource_group_name: str,
289
- account_name: str,
290
- parameters: IO[bytes],
291
- *,
292
- content_type: str = "application/json",
293
- **kwargs: Any
294
- ) -> AsyncLROPoller[_models.StorageAccount]:
295
- """Asynchronously creates a new storage account with the specified parameters. If an account is
296
- already created and a subsequent create request is issued with different properties, the
297
- account properties will be updated. If an account is already created and a subsequent create or
298
- update request is issued with the exact same set of properties, the request will succeed.
299
-
300
- :param resource_group_name: The name of the resource group within the user's subscription.
301
- Required.
302
- :type resource_group_name: str
303
- :param account_name: The name of the storage account within the specified resource group.
304
- Storage account names must be between 3 and 24 characters in length and use numbers and
305
- lower-case letters only. Required.
306
- :type account_name: str
307
- :param parameters: The parameters to provide for the created account. Required.
308
- :type parameters: IO[bytes]
309
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
310
- Known values are: 'application/json', 'text/json'. Default value is "application/json".
311
- :paramtype content_type: str
312
- :return: An instance of AsyncLROPoller that returns either StorageAccount or the result of
313
- cls(response)
314
- :rtype:
315
- ~azure.core.polling.AsyncLROPoller[~azure.mgmt.storage.v2016_01_01.models.StorageAccount]
316
- :raises ~azure.core.exceptions.HttpResponseError:
317
- """
318
-
319
- @distributed_trace_async
320
- async def begin_create(
321
- self,
322
- resource_group_name: str,
323
- account_name: str,
324
- parameters: Union[_models.StorageAccountCreateParameters, IO[bytes]],
325
- **kwargs: Any
326
- ) -> AsyncLROPoller[_models.StorageAccount]:
327
- """Asynchronously creates a new storage account with the specified parameters. If an account is
328
- already created and a subsequent create request is issued with different properties, the
329
- account properties will be updated. If an account is already created and a subsequent create or
330
- update request is issued with the exact same set of properties, the request will succeed.
331
-
332
- :param resource_group_name: The name of the resource group within the user's subscription.
333
- Required.
334
- :type resource_group_name: str
335
- :param account_name: The name of the storage account within the specified resource group.
336
- Storage account names must be between 3 and 24 characters in length and use numbers and
337
- lower-case letters only. Required.
338
- :type account_name: str
339
- :param parameters: The parameters to provide for the created account. Is either a
340
- StorageAccountCreateParameters type or a IO[bytes] type. Required.
341
- :type parameters: ~azure.mgmt.storage.v2016_01_01.models.StorageAccountCreateParameters or
342
- IO[bytes]
343
- :return: An instance of AsyncLROPoller that returns either StorageAccount or the result of
344
- cls(response)
345
- :rtype:
346
- ~azure.core.polling.AsyncLROPoller[~azure.mgmt.storage.v2016_01_01.models.StorageAccount]
347
- :raises ~azure.core.exceptions.HttpResponseError:
348
- """
349
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
350
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
351
-
352
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-01-01"))
353
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
354
- cls: ClsType[_models.StorageAccount] = kwargs.pop("cls", None)
355
- polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
356
- lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
357
- cont_token: Optional[str] = kwargs.pop("continuation_token", None)
358
- if cont_token is None:
359
- raw_result = await self._create_initial(
360
- resource_group_name=resource_group_name,
361
- account_name=account_name,
362
- parameters=parameters,
363
- api_version=api_version,
364
- content_type=content_type,
365
- cls=lambda x, y, z: x,
366
- headers=_headers,
367
- params=_params,
368
- **kwargs
369
- )
370
- await raw_result.http_response.read() # type: ignore
371
- kwargs.pop("error_map", None)
372
-
373
- def get_long_running_output(pipeline_response):
374
- deserialized = self._deserialize("StorageAccount", pipeline_response.http_response)
375
- if cls:
376
- return cls(pipeline_response, deserialized, {}) # type: ignore
377
- return deserialized
378
-
379
- if polling is True:
380
- polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
381
- elif polling is False:
382
- polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
383
- else:
384
- polling_method = polling
385
- if cont_token:
386
- return AsyncLROPoller[_models.StorageAccount].from_continuation_token(
387
- polling_method=polling_method,
388
- continuation_token=cont_token,
389
- client=self._client,
390
- deserialization_callback=get_long_running_output,
391
- )
392
- return AsyncLROPoller[_models.StorageAccount](
393
- self._client, raw_result, get_long_running_output, polling_method # type: ignore
394
- )
395
-
396
- @distributed_trace_async
397
- async def delete(self, resource_group_name: str, account_name: str, **kwargs: Any) -> None:
398
- """Deletes a storage account in Microsoft Azure.
399
-
400
- :param resource_group_name: The name of the resource group within the user's subscription.
401
- Required.
402
- :type resource_group_name: str
403
- :param account_name: The name of the storage account within the specified resource group.
404
- Storage account names must be between 3 and 24 characters in length and use numbers and
405
- lower-case letters only. Required.
406
- :type account_name: str
407
- :return: None or the result of cls(response)
408
- :rtype: None
409
- :raises ~azure.core.exceptions.HttpResponseError:
410
- """
411
- error_map: MutableMapping = {
412
- 401: ClientAuthenticationError,
413
- 404: ResourceNotFoundError,
414
- 409: ResourceExistsError,
415
- 304: ResourceNotModifiedError,
416
- }
417
- error_map.update(kwargs.pop("error_map", {}) or {})
418
-
419
- _headers = kwargs.pop("headers", {}) or {}
420
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
421
-
422
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-01-01"))
423
- cls: ClsType[None] = kwargs.pop("cls", None)
424
-
425
- _request = build_delete_request(
426
- resource_group_name=resource_group_name,
427
- account_name=account_name,
428
- subscription_id=self._config.subscription_id,
429
- api_version=api_version,
430
- headers=_headers,
431
- params=_params,
432
- )
433
- _request.url = self._client.format_url(_request.url)
434
-
435
- _stream = False
436
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
437
- _request, stream=_stream, **kwargs
438
- )
439
-
440
- response = pipeline_response.http_response
441
-
442
- if response.status_code not in [200, 204]:
443
- map_error(status_code=response.status_code, response=response, error_map=error_map)
444
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
445
-
446
- if cls:
447
- return cls(pipeline_response, None, {}) # type: ignore
448
-
449
- @distributed_trace_async
450
- async def get_properties(
451
- self, resource_group_name: str, account_name: str, **kwargs: Any
452
- ) -> _models.StorageAccount:
453
- """Returns the properties for the specified storage account including but not limited to name, SKU
454
- name, location, and account status. The ListKeys operation should be used to retrieve storage
455
- keys.
456
-
457
- :param resource_group_name: The name of the resource group within the user's subscription.
458
- Required.
459
- :type resource_group_name: str
460
- :param account_name: The name of the storage account within the specified resource group.
461
- Storage account names must be between 3 and 24 characters in length and use numbers and
462
- lower-case letters only. Required.
463
- :type account_name: str
464
- :return: StorageAccount or the result of cls(response)
465
- :rtype: ~azure.mgmt.storage.v2016_01_01.models.StorageAccount
466
- :raises ~azure.core.exceptions.HttpResponseError:
467
- """
468
- error_map: MutableMapping = {
469
- 401: ClientAuthenticationError,
470
- 404: ResourceNotFoundError,
471
- 409: ResourceExistsError,
472
- 304: ResourceNotModifiedError,
473
- }
474
- error_map.update(kwargs.pop("error_map", {}) or {})
475
-
476
- _headers = kwargs.pop("headers", {}) or {}
477
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
478
-
479
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-01-01"))
480
- cls: ClsType[_models.StorageAccount] = kwargs.pop("cls", None)
481
-
482
- _request = build_get_properties_request(
483
- resource_group_name=resource_group_name,
484
- account_name=account_name,
485
- subscription_id=self._config.subscription_id,
486
- api_version=api_version,
487
- headers=_headers,
488
- params=_params,
489
- )
490
- _request.url = self._client.format_url(_request.url)
491
-
492
- _stream = False
493
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
494
- _request, stream=_stream, **kwargs
495
- )
496
-
497
- response = pipeline_response.http_response
498
-
499
- if response.status_code not in [200]:
500
- map_error(status_code=response.status_code, response=response, error_map=error_map)
501
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
502
-
503
- deserialized = self._deserialize("StorageAccount", pipeline_response.http_response)
504
-
505
- if cls:
506
- return cls(pipeline_response, deserialized, {}) # type: ignore
507
-
508
- return deserialized # type: ignore
509
-
510
- @overload
511
- async def update(
512
- self,
513
- resource_group_name: str,
514
- account_name: str,
515
- parameters: _models.StorageAccountUpdateParameters,
516
- *,
517
- content_type: str = "application/json",
518
- **kwargs: Any
519
- ) -> _models.StorageAccount:
520
- """The update operation can be used to update the SKU, encryption, access tier, or tags for a
521
- storage account. It can also be used to map the account to a custom domain. Only one custom
522
- domain is supported per storage account; the replacement/change of custom domain is not
523
- supported. In order to replace an old custom domain, the old value must be cleared/unregistered
524
- before a new value can be set. The update of multiple properties is supported. This call does
525
- not change the storage keys for the account. If you want to change the storage account keys,
526
- use the regenerate keys operation. The location and name of the storage account cannot be
527
- changed after creation.
528
-
529
- :param resource_group_name: The name of the resource group within the user's subscription.
530
- Required.
531
- :type resource_group_name: str
532
- :param account_name: The name of the storage account within the specified resource group.
533
- Storage account names must be between 3 and 24 characters in length and use numbers and
534
- lower-case letters only. Required.
535
- :type account_name: str
536
- :param parameters: The parameters to provide for the updated account. Required.
537
- :type parameters: ~azure.mgmt.storage.v2016_01_01.models.StorageAccountUpdateParameters
538
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
539
- Default value is "application/json".
540
- :paramtype content_type: str
541
- :return: StorageAccount or the result of cls(response)
542
- :rtype: ~azure.mgmt.storage.v2016_01_01.models.StorageAccount
543
- :raises ~azure.core.exceptions.HttpResponseError:
544
- """
545
-
546
- @overload
547
- async def update(
548
- self,
549
- resource_group_name: str,
550
- account_name: str,
551
- parameters: IO[bytes],
552
- *,
553
- content_type: str = "application/json",
554
- **kwargs: Any
555
- ) -> _models.StorageAccount:
556
- """The update operation can be used to update the SKU, encryption, access tier, or tags for a
557
- storage account. It can also be used to map the account to a custom domain. Only one custom
558
- domain is supported per storage account; the replacement/change of custom domain is not
559
- supported. In order to replace an old custom domain, the old value must be cleared/unregistered
560
- before a new value can be set. The update of multiple properties is supported. This call does
561
- not change the storage keys for the account. If you want to change the storage account keys,
562
- use the regenerate keys operation. The location and name of the storage account cannot be
563
- changed after creation.
564
-
565
- :param resource_group_name: The name of the resource group within the user's subscription.
566
- Required.
567
- :type resource_group_name: str
568
- :param account_name: The name of the storage account within the specified resource group.
569
- Storage account names must be between 3 and 24 characters in length and use numbers and
570
- lower-case letters only. Required.
571
- :type account_name: str
572
- :param parameters: The parameters to provide for the updated account. Required.
573
- :type parameters: IO[bytes]
574
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
575
- Known values are: 'application/json', 'text/json'. Default value is "application/json".
576
- :paramtype content_type: str
577
- :return: StorageAccount or the result of cls(response)
578
- :rtype: ~azure.mgmt.storage.v2016_01_01.models.StorageAccount
579
- :raises ~azure.core.exceptions.HttpResponseError:
580
- """
581
-
582
- @distributed_trace_async
583
- async def update(
584
- self,
585
- resource_group_name: str,
586
- account_name: str,
587
- parameters: Union[_models.StorageAccountUpdateParameters, IO[bytes]],
588
- **kwargs: Any
589
- ) -> _models.StorageAccount:
590
- """The update operation can be used to update the SKU, encryption, access tier, or tags for a
591
- storage account. It can also be used to map the account to a custom domain. Only one custom
592
- domain is supported per storage account; the replacement/change of custom domain is not
593
- supported. In order to replace an old custom domain, the old value must be cleared/unregistered
594
- before a new value can be set. The update of multiple properties is supported. This call does
595
- not change the storage keys for the account. If you want to change the storage account keys,
596
- use the regenerate keys operation. The location and name of the storage account cannot be
597
- changed after creation.
598
-
599
- :param resource_group_name: The name of the resource group within the user's subscription.
600
- Required.
601
- :type resource_group_name: str
602
- :param account_name: The name of the storage account within the specified resource group.
603
- Storage account names must be between 3 and 24 characters in length and use numbers and
604
- lower-case letters only. Required.
605
- :type account_name: str
606
- :param parameters: The parameters to provide for the updated account. Is either a
607
- StorageAccountUpdateParameters type or a IO[bytes] type. Required.
608
- :type parameters: ~azure.mgmt.storage.v2016_01_01.models.StorageAccountUpdateParameters or
609
- IO[bytes]
610
- :return: StorageAccount or the result of cls(response)
611
- :rtype: ~azure.mgmt.storage.v2016_01_01.models.StorageAccount
612
- :raises ~azure.core.exceptions.HttpResponseError:
613
- """
614
- error_map: MutableMapping = {
615
- 401: ClientAuthenticationError,
616
- 404: ResourceNotFoundError,
617
- 409: ResourceExistsError,
618
- 304: ResourceNotModifiedError,
619
- }
620
- error_map.update(kwargs.pop("error_map", {}) or {})
621
-
622
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
623
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
624
-
625
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-01-01"))
626
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
627
- cls: ClsType[_models.StorageAccount] = kwargs.pop("cls", None)
628
-
629
- content_type = content_type or "application/json"
630
- _json = None
631
- _content = None
632
- if isinstance(parameters, (IOBase, bytes)):
633
- _content = parameters
634
- else:
635
- _json = self._serialize.body(parameters, "StorageAccountUpdateParameters")
636
-
637
- _request = build_update_request(
638
- resource_group_name=resource_group_name,
639
- account_name=account_name,
640
- subscription_id=self._config.subscription_id,
641
- api_version=api_version,
642
- content_type=content_type,
643
- json=_json,
644
- content=_content,
645
- headers=_headers,
646
- params=_params,
647
- )
648
- _request.url = self._client.format_url(_request.url)
649
-
650
- _stream = False
651
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
652
- _request, stream=_stream, **kwargs
653
- )
654
-
655
- response = pipeline_response.http_response
656
-
657
- if response.status_code not in [200]:
658
- map_error(status_code=response.status_code, response=response, error_map=error_map)
659
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
660
-
661
- deserialized = self._deserialize("StorageAccount", pipeline_response.http_response)
662
-
663
- if cls:
664
- return cls(pipeline_response, deserialized, {}) # type: ignore
665
-
666
- return deserialized # type: ignore
667
-
668
- @distributed_trace
669
- def list(self, **kwargs: Any) -> AsyncIterable["_models.StorageAccount"]:
670
- """Lists all the storage accounts available under the subscription. Note that storage keys are not
671
- returned; use the ListKeys operation for this.
672
-
673
- :return: An iterator like instance of either StorageAccount or the result of cls(response)
674
- :rtype:
675
- ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2016_01_01.models.StorageAccount]
676
- :raises ~azure.core.exceptions.HttpResponseError:
677
- """
678
- _headers = kwargs.pop("headers", {}) or {}
679
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
680
-
681
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-01-01"))
682
- cls: ClsType[_models.StorageAccountListResult] = kwargs.pop("cls", None)
683
-
684
- error_map: MutableMapping = {
685
- 401: ClientAuthenticationError,
686
- 404: ResourceNotFoundError,
687
- 409: ResourceExistsError,
688
- 304: ResourceNotModifiedError,
689
- }
690
- error_map.update(kwargs.pop("error_map", {}) or {})
691
-
692
- def prepare_request(next_link=None):
693
- if not next_link:
694
-
695
- _request = build_list_request(
696
- subscription_id=self._config.subscription_id,
697
- api_version=api_version,
698
- headers=_headers,
699
- params=_params,
700
- )
701
- _request.url = self._client.format_url(_request.url)
702
-
703
- else:
704
- # make call to next link with the client's api-version
705
- _parsed_next_link = urllib.parse.urlparse(next_link)
706
- _next_request_params = case_insensitive_dict(
707
- {
708
- key: [urllib.parse.quote(v) for v in value]
709
- for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
710
- }
711
- )
712
- _next_request_params["api-version"] = self._api_version
713
- _request = HttpRequest(
714
- "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
715
- )
716
- _request.url = self._client.format_url(_request.url)
717
- _request.method = "GET"
718
- return _request
719
-
720
- async def extract_data(pipeline_response):
721
- deserialized = self._deserialize("StorageAccountListResult", pipeline_response)
722
- list_of_elem = deserialized.value
723
- if cls:
724
- list_of_elem = cls(list_of_elem) # type: ignore
725
- return None, AsyncList(list_of_elem)
726
-
727
- async def get_next(next_link=None):
728
- _request = prepare_request(next_link)
729
-
730
- _stream = False
731
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
732
- _request, stream=_stream, **kwargs
733
- )
734
- response = pipeline_response.http_response
735
-
736
- if response.status_code not in [200]:
737
- map_error(status_code=response.status_code, response=response, error_map=error_map)
738
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
739
-
740
- return pipeline_response
741
-
742
- return AsyncItemPaged(get_next, extract_data)
743
-
744
- @distributed_trace
745
- def list_by_resource_group(
746
- self, resource_group_name: str, **kwargs: Any
747
- ) -> AsyncIterable["_models.StorageAccount"]:
748
- """Lists all the storage accounts available under the given resource group. Note that storage keys
749
- are not returned; use the ListKeys operation for this.
750
-
751
- :param resource_group_name: The name of the resource group within the user's subscription.
752
- Required.
753
- :type resource_group_name: str
754
- :return: An iterator like instance of either StorageAccount or the result of cls(response)
755
- :rtype:
756
- ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2016_01_01.models.StorageAccount]
757
- :raises ~azure.core.exceptions.HttpResponseError:
758
- """
759
- _headers = kwargs.pop("headers", {}) or {}
760
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
761
-
762
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-01-01"))
763
- cls: ClsType[_models.StorageAccountListResult] = kwargs.pop("cls", None)
764
-
765
- error_map: MutableMapping = {
766
- 401: ClientAuthenticationError,
767
- 404: ResourceNotFoundError,
768
- 409: ResourceExistsError,
769
- 304: ResourceNotModifiedError,
770
- }
771
- error_map.update(kwargs.pop("error_map", {}) or {})
772
-
773
- def prepare_request(next_link=None):
774
- if not next_link:
775
-
776
- _request = build_list_by_resource_group_request(
777
- resource_group_name=resource_group_name,
778
- subscription_id=self._config.subscription_id,
779
- api_version=api_version,
780
- headers=_headers,
781
- params=_params,
782
- )
783
- _request.url = self._client.format_url(_request.url)
784
-
785
- else:
786
- # make call to next link with the client's api-version
787
- _parsed_next_link = urllib.parse.urlparse(next_link)
788
- _next_request_params = case_insensitive_dict(
789
- {
790
- key: [urllib.parse.quote(v) for v in value]
791
- for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
792
- }
793
- )
794
- _next_request_params["api-version"] = self._api_version
795
- _request = HttpRequest(
796
- "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
797
- )
798
- _request.url = self._client.format_url(_request.url)
799
- _request.method = "GET"
800
- return _request
801
-
802
- async def extract_data(pipeline_response):
803
- deserialized = self._deserialize("StorageAccountListResult", pipeline_response)
804
- list_of_elem = deserialized.value
805
- if cls:
806
- list_of_elem = cls(list_of_elem) # type: ignore
807
- return None, AsyncList(list_of_elem)
808
-
809
- async def get_next(next_link=None):
810
- _request = prepare_request(next_link)
811
-
812
- _stream = False
813
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
814
- _request, stream=_stream, **kwargs
815
- )
816
- response = pipeline_response.http_response
817
-
818
- if response.status_code not in [200]:
819
- map_error(status_code=response.status_code, response=response, error_map=error_map)
820
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
821
-
822
- return pipeline_response
823
-
824
- return AsyncItemPaged(get_next, extract_data)
825
-
826
- @distributed_trace_async
827
- async def list_keys(
828
- self, resource_group_name: str, account_name: str, **kwargs: Any
829
- ) -> _models.StorageAccountListKeysResult:
830
- """Lists the access keys for the specified storage account.
831
-
832
- :param resource_group_name: The name of the resource group within the user's subscription.
833
- Required.
834
- :type resource_group_name: str
835
- :param account_name: The name of the storage account within the specified resource group.
836
- Storage account names must be between 3 and 24 characters in length and use numbers and
837
- lower-case letters only. Required.
838
- :type account_name: str
839
- :return: StorageAccountListKeysResult or the result of cls(response)
840
- :rtype: ~azure.mgmt.storage.v2016_01_01.models.StorageAccountListKeysResult
841
- :raises ~azure.core.exceptions.HttpResponseError:
842
- """
843
- error_map: MutableMapping = {
844
- 401: ClientAuthenticationError,
845
- 404: ResourceNotFoundError,
846
- 409: ResourceExistsError,
847
- 304: ResourceNotModifiedError,
848
- }
849
- error_map.update(kwargs.pop("error_map", {}) or {})
850
-
851
- _headers = kwargs.pop("headers", {}) or {}
852
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
853
-
854
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-01-01"))
855
- cls: ClsType[_models.StorageAccountListKeysResult] = kwargs.pop("cls", None)
856
-
857
- _request = build_list_keys_request(
858
- resource_group_name=resource_group_name,
859
- account_name=account_name,
860
- subscription_id=self._config.subscription_id,
861
- api_version=api_version,
862
- headers=_headers,
863
- params=_params,
864
- )
865
- _request.url = self._client.format_url(_request.url)
866
-
867
- _stream = False
868
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
869
- _request, stream=_stream, **kwargs
870
- )
871
-
872
- response = pipeline_response.http_response
873
-
874
- if response.status_code not in [200]:
875
- map_error(status_code=response.status_code, response=response, error_map=error_map)
876
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
877
-
878
- deserialized = self._deserialize("StorageAccountListKeysResult", pipeline_response.http_response)
879
-
880
- if cls:
881
- return cls(pipeline_response, deserialized, {}) # type: ignore
882
-
883
- return deserialized # type: ignore
884
-
885
- @overload
886
- async def regenerate_key(
887
- self,
888
- resource_group_name: str,
889
- account_name: str,
890
- regenerate_key: _models.StorageAccountRegenerateKeyParameters,
891
- *,
892
- content_type: str = "application/json",
893
- **kwargs: Any
894
- ) -> _models.StorageAccountListKeysResult:
895
- """Regenerates one of the access keys for the specified storage account.
896
-
897
- :param resource_group_name: The name of the resource group within the user's subscription.
898
- Required.
899
- :type resource_group_name: str
900
- :param account_name: The name of the storage account within the specified resource group.
901
- Storage account names must be between 3 and 24 characters in length and use numbers and
902
- lower-case letters only. Required.
903
- :type account_name: str
904
- :param regenerate_key: Specifies name of the key which should be regenerated -- key1 or key2.
905
- Required.
906
- :type regenerate_key:
907
- ~azure.mgmt.storage.v2016_01_01.models.StorageAccountRegenerateKeyParameters
908
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
909
- Default value is "application/json".
910
- :paramtype content_type: str
911
- :return: StorageAccountListKeysResult or the result of cls(response)
912
- :rtype: ~azure.mgmt.storage.v2016_01_01.models.StorageAccountListKeysResult
913
- :raises ~azure.core.exceptions.HttpResponseError:
914
- """
915
-
916
- @overload
917
- async def regenerate_key(
918
- self,
919
- resource_group_name: str,
920
- account_name: str,
921
- regenerate_key: IO[bytes],
922
- *,
923
- content_type: str = "application/json",
924
- **kwargs: Any
925
- ) -> _models.StorageAccountListKeysResult:
926
- """Regenerates one of the access keys for the specified storage account.
927
-
928
- :param resource_group_name: The name of the resource group within the user's subscription.
929
- Required.
930
- :type resource_group_name: str
931
- :param account_name: The name of the storage account within the specified resource group.
932
- Storage account names must be between 3 and 24 characters in length and use numbers and
933
- lower-case letters only. Required.
934
- :type account_name: str
935
- :param regenerate_key: Specifies name of the key which should be regenerated -- key1 or key2.
936
- Required.
937
- :type regenerate_key: IO[bytes]
938
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
939
- Known values are: 'application/json', 'text/json'. Default value is "application/json".
940
- :paramtype content_type: str
941
- :return: StorageAccountListKeysResult or the result of cls(response)
942
- :rtype: ~azure.mgmt.storage.v2016_01_01.models.StorageAccountListKeysResult
943
- :raises ~azure.core.exceptions.HttpResponseError:
944
- """
945
-
946
- @distributed_trace_async
947
- async def regenerate_key(
948
- self,
949
- resource_group_name: str,
950
- account_name: str,
951
- regenerate_key: Union[_models.StorageAccountRegenerateKeyParameters, IO[bytes]],
952
- **kwargs: Any
953
- ) -> _models.StorageAccountListKeysResult:
954
- """Regenerates one of the access keys for the specified storage account.
955
-
956
- :param resource_group_name: The name of the resource group within the user's subscription.
957
- Required.
958
- :type resource_group_name: str
959
- :param account_name: The name of the storage account within the specified resource group.
960
- Storage account names must be between 3 and 24 characters in length and use numbers and
961
- lower-case letters only. Required.
962
- :type account_name: str
963
- :param regenerate_key: Specifies name of the key which should be regenerated -- key1 or key2.
964
- Is either a StorageAccountRegenerateKeyParameters type or a IO[bytes] type. Required.
965
- :type regenerate_key:
966
- ~azure.mgmt.storage.v2016_01_01.models.StorageAccountRegenerateKeyParameters or IO[bytes]
967
- :return: StorageAccountListKeysResult or the result of cls(response)
968
- :rtype: ~azure.mgmt.storage.v2016_01_01.models.StorageAccountListKeysResult
969
- :raises ~azure.core.exceptions.HttpResponseError:
970
- """
971
- error_map: MutableMapping = {
972
- 401: ClientAuthenticationError,
973
- 404: ResourceNotFoundError,
974
- 409: ResourceExistsError,
975
- 304: ResourceNotModifiedError,
976
- }
977
- error_map.update(kwargs.pop("error_map", {}) or {})
978
-
979
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
980
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
981
-
982
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-01-01"))
983
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
984
- cls: ClsType[_models.StorageAccountListKeysResult] = kwargs.pop("cls", None)
985
-
986
- content_type = content_type or "application/json"
987
- _json = None
988
- _content = None
989
- if isinstance(regenerate_key, (IOBase, bytes)):
990
- _content = regenerate_key
991
- else:
992
- _json = self._serialize.body(regenerate_key, "StorageAccountRegenerateKeyParameters")
993
-
994
- _request = build_regenerate_key_request(
995
- resource_group_name=resource_group_name,
996
- account_name=account_name,
997
- subscription_id=self._config.subscription_id,
998
- api_version=api_version,
999
- content_type=content_type,
1000
- json=_json,
1001
- content=_content,
1002
- headers=_headers,
1003
- params=_params,
1004
- )
1005
- _request.url = self._client.format_url(_request.url)
1006
-
1007
- _stream = False
1008
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
1009
- _request, stream=_stream, **kwargs
1010
- )
1011
-
1012
- response = pipeline_response.http_response
1013
-
1014
- if response.status_code not in [200]:
1015
- map_error(status_code=response.status_code, response=response, error_map=error_map)
1016
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
1017
-
1018
- deserialized = self._deserialize("StorageAccountListKeysResult", pipeline_response.http_response)
1019
-
1020
- if cls:
1021
- return cls(pipeline_response, deserialized, {}) # type: ignore
1022
-
1023
- return deserialized # type: ignore