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,1299 +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_account_sas_request,
41
- build_list_by_resource_group_request,
42
- build_list_keys_request,
43
- build_list_request,
44
- build_list_service_sas_request,
45
- build_regenerate_key_request,
46
- build_update_request,
47
- )
48
-
49
- if sys.version_info >= (3, 9):
50
- from collections.abc import MutableMapping
51
- else:
52
- from typing import MutableMapping # type: ignore
53
- T = TypeVar("T")
54
- ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
55
-
56
-
57
- class StorageAccountsOperations:
58
- """
59
- .. warning::
60
- **DO NOT** instantiate this class directly.
61
-
62
- Instead, you should access the following operations through
63
- :class:`~azure.mgmt.storage.v2017_10_01.aio.StorageManagement`'s
64
- :attr:`storage_accounts` attribute.
65
- """
66
-
67
- models = _models
68
-
69
- def __init__(self, *args, **kwargs) -> None:
70
- input_args = list(args)
71
- self._client = input_args.pop(0) if input_args else kwargs.pop("client")
72
- self._config = input_args.pop(0) if input_args else kwargs.pop("config")
73
- self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
74
- self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
75
- self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
76
-
77
- @overload
78
- async def check_name_availability(
79
- self,
80
- account_name: _models.StorageAccountCheckNameAvailabilityParameters,
81
- *,
82
- content_type: str = "application/json",
83
- **kwargs: Any
84
- ) -> _models.CheckNameAvailabilityResult:
85
- """Checks that the storage account name is valid and is not already in use.
86
-
87
- :param account_name: The name of the storage account within the specified resource group.
88
- Storage account names must be between 3 and 24 characters in length and use numbers and
89
- lower-case letters only. Required.
90
- :type account_name:
91
- ~azure.mgmt.storage.v2017_10_01.models.StorageAccountCheckNameAvailabilityParameters
92
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
93
- Default value is "application/json".
94
- :paramtype content_type: str
95
- :return: CheckNameAvailabilityResult or the result of cls(response)
96
- :rtype: ~azure.mgmt.storage.v2017_10_01.models.CheckNameAvailabilityResult
97
- :raises ~azure.core.exceptions.HttpResponseError:
98
- """
99
-
100
- @overload
101
- async def check_name_availability(
102
- self, account_name: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
103
- ) -> _models.CheckNameAvailabilityResult:
104
- """Checks that the storage account name is valid and is not already in use.
105
-
106
- :param account_name: The name of the storage account within the specified resource group.
107
- Storage account names must be between 3 and 24 characters in length and use numbers and
108
- lower-case letters only. Required.
109
- :type account_name: IO[bytes]
110
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
111
- Default value is "application/json".
112
- :paramtype content_type: str
113
- :return: CheckNameAvailabilityResult or the result of cls(response)
114
- :rtype: ~azure.mgmt.storage.v2017_10_01.models.CheckNameAvailabilityResult
115
- :raises ~azure.core.exceptions.HttpResponseError:
116
- """
117
-
118
- @distributed_trace_async
119
- async def check_name_availability(
120
- self, account_name: Union[_models.StorageAccountCheckNameAvailabilityParameters, IO[bytes]], **kwargs: Any
121
- ) -> _models.CheckNameAvailabilityResult:
122
- """Checks that the storage account name is valid and is not already in use.
123
-
124
- :param account_name: The name of the storage account within the specified resource group.
125
- Storage account names must be between 3 and 24 characters in length and use numbers and
126
- lower-case letters only. Is either a StorageAccountCheckNameAvailabilityParameters type or a
127
- IO[bytes] type. Required.
128
- :type account_name:
129
- ~azure.mgmt.storage.v2017_10_01.models.StorageAccountCheckNameAvailabilityParameters or
130
- IO[bytes]
131
- :return: CheckNameAvailabilityResult or the result of cls(response)
132
- :rtype: ~azure.mgmt.storage.v2017_10_01.models.CheckNameAvailabilityResult
133
- :raises ~azure.core.exceptions.HttpResponseError:
134
- """
135
- error_map: MutableMapping = {
136
- 401: ClientAuthenticationError,
137
- 404: ResourceNotFoundError,
138
- 409: ResourceExistsError,
139
- 304: ResourceNotModifiedError,
140
- }
141
- error_map.update(kwargs.pop("error_map", {}) or {})
142
-
143
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
144
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
145
-
146
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-10-01"))
147
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
148
- cls: ClsType[_models.CheckNameAvailabilityResult] = kwargs.pop("cls", None)
149
-
150
- content_type = content_type or "application/json"
151
- _json = None
152
- _content = None
153
- if isinstance(account_name, (IOBase, bytes)):
154
- _content = account_name
155
- else:
156
- _json = self._serialize.body(account_name, "StorageAccountCheckNameAvailabilityParameters")
157
-
158
- _request = build_check_name_availability_request(
159
- subscription_id=self._config.subscription_id,
160
- api_version=api_version,
161
- content_type=content_type,
162
- json=_json,
163
- content=_content,
164
- headers=_headers,
165
- params=_params,
166
- )
167
- _request.url = self._client.format_url(_request.url)
168
-
169
- _stream = False
170
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
171
- _request, stream=_stream, **kwargs
172
- )
173
-
174
- response = pipeline_response.http_response
175
-
176
- if response.status_code not in [200]:
177
- map_error(status_code=response.status_code, response=response, error_map=error_map)
178
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
179
-
180
- deserialized = self._deserialize("CheckNameAvailabilityResult", pipeline_response.http_response)
181
-
182
- if cls:
183
- return cls(pipeline_response, deserialized, {}) # type: ignore
184
-
185
- return deserialized # type: ignore
186
-
187
- async def _create_initial(
188
- self,
189
- resource_group_name: str,
190
- account_name: str,
191
- parameters: Union[_models.StorageAccountCreateParameters, IO[bytes]],
192
- **kwargs: Any
193
- ) -> AsyncIterator[bytes]:
194
- error_map: MutableMapping = {
195
- 401: ClientAuthenticationError,
196
- 404: ResourceNotFoundError,
197
- 409: ResourceExistsError,
198
- 304: ResourceNotModifiedError,
199
- }
200
- error_map.update(kwargs.pop("error_map", {}) or {})
201
-
202
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
203
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
204
-
205
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-10-01"))
206
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
207
- cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
208
-
209
- content_type = content_type or "application/json"
210
- _json = None
211
- _content = None
212
- if isinstance(parameters, (IOBase, bytes)):
213
- _content = parameters
214
- else:
215
- _json = self._serialize.body(parameters, "StorageAccountCreateParameters")
216
-
217
- _request = build_create_request(
218
- resource_group_name=resource_group_name,
219
- account_name=account_name,
220
- subscription_id=self._config.subscription_id,
221
- api_version=api_version,
222
- content_type=content_type,
223
- json=_json,
224
- content=_content,
225
- headers=_headers,
226
- params=_params,
227
- )
228
- _request.url = self._client.format_url(_request.url)
229
-
230
- _decompress = kwargs.pop("decompress", True)
231
- _stream = True
232
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
233
- _request, stream=_stream, **kwargs
234
- )
235
-
236
- response = pipeline_response.http_response
237
-
238
- if response.status_code not in [200, 202]:
239
- try:
240
- await response.read() # Load the body in memory and close the socket
241
- except (StreamConsumedError, StreamClosedError):
242
- pass
243
- map_error(status_code=response.status_code, response=response, error_map=error_map)
244
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
245
-
246
- deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
247
-
248
- if cls:
249
- return cls(pipeline_response, deserialized, {}) # type: ignore
250
-
251
- return deserialized # type: ignore
252
-
253
- @overload
254
- async def begin_create(
255
- self,
256
- resource_group_name: str,
257
- account_name: str,
258
- parameters: _models.StorageAccountCreateParameters,
259
- *,
260
- content_type: str = "application/json",
261
- **kwargs: Any
262
- ) -> AsyncLROPoller[_models.StorageAccount]:
263
- """Asynchronously creates a new storage account with the specified parameters. If an account is
264
- already created and a subsequent create request is issued with different properties, the
265
- account properties will be updated. If an account is already created and a subsequent create or
266
- update request is issued with the exact same set of properties, the request will succeed.
267
-
268
- :param resource_group_name: The name of the resource group within the user's subscription. The
269
- name is case insensitive. Required.
270
- :type resource_group_name: str
271
- :param account_name: The name of the storage account within the specified resource group.
272
- Storage account names must be between 3 and 24 characters in length and use numbers and
273
- lower-case letters only. Required.
274
- :type account_name: str
275
- :param parameters: The parameters to provide for the created account. Required.
276
- :type parameters: ~azure.mgmt.storage.v2017_10_01.models.StorageAccountCreateParameters
277
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
278
- Default value is "application/json".
279
- :paramtype content_type: str
280
- :return: An instance of AsyncLROPoller that returns either StorageAccount or the result of
281
- cls(response)
282
- :rtype:
283
- ~azure.core.polling.AsyncLROPoller[~azure.mgmt.storage.v2017_10_01.models.StorageAccount]
284
- :raises ~azure.core.exceptions.HttpResponseError:
285
- """
286
-
287
- @overload
288
- async def begin_create(
289
- self,
290
- resource_group_name: str,
291
- account_name: str,
292
- parameters: IO[bytes],
293
- *,
294
- content_type: str = "application/json",
295
- **kwargs: Any
296
- ) -> AsyncLROPoller[_models.StorageAccount]:
297
- """Asynchronously creates a new storage account with the specified parameters. If an account is
298
- already created and a subsequent create request is issued with different properties, the
299
- account properties will be updated. If an account is already created and a subsequent create or
300
- update request is issued with the exact same set of properties, the request will succeed.
301
-
302
- :param resource_group_name: The name of the resource group within the user's subscription. The
303
- name is case insensitive. Required.
304
- :type resource_group_name: str
305
- :param account_name: The name of the storage account within the specified resource group.
306
- Storage account names must be between 3 and 24 characters in length and use numbers and
307
- lower-case letters only. Required.
308
- :type account_name: str
309
- :param parameters: The parameters to provide for the created account. Required.
310
- :type parameters: IO[bytes]
311
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
312
- Default value is "application/json".
313
- :paramtype content_type: str
314
- :return: An instance of AsyncLROPoller that returns either StorageAccount or the result of
315
- cls(response)
316
- :rtype:
317
- ~azure.core.polling.AsyncLROPoller[~azure.mgmt.storage.v2017_10_01.models.StorageAccount]
318
- :raises ~azure.core.exceptions.HttpResponseError:
319
- """
320
-
321
- @distributed_trace_async
322
- async def begin_create(
323
- self,
324
- resource_group_name: str,
325
- account_name: str,
326
- parameters: Union[_models.StorageAccountCreateParameters, IO[bytes]],
327
- **kwargs: Any
328
- ) -> AsyncLROPoller[_models.StorageAccount]:
329
- """Asynchronously creates a new storage account with the specified parameters. If an account is
330
- already created and a subsequent create request is issued with different properties, the
331
- account properties will be updated. If an account is already created and a subsequent create or
332
- update request is issued with the exact same set of properties, the request will succeed.
333
-
334
- :param resource_group_name: The name of the resource group within the user's subscription. The
335
- name is case insensitive. Required.
336
- :type resource_group_name: str
337
- :param account_name: The name of the storage account within the specified resource group.
338
- Storage account names must be between 3 and 24 characters in length and use numbers and
339
- lower-case letters only. Required.
340
- :type account_name: str
341
- :param parameters: The parameters to provide for the created account. Is either a
342
- StorageAccountCreateParameters type or a IO[bytes] type. Required.
343
- :type parameters: ~azure.mgmt.storage.v2017_10_01.models.StorageAccountCreateParameters or
344
- IO[bytes]
345
- :return: An instance of AsyncLROPoller that returns either StorageAccount or the result of
346
- cls(response)
347
- :rtype:
348
- ~azure.core.polling.AsyncLROPoller[~azure.mgmt.storage.v2017_10_01.models.StorageAccount]
349
- :raises ~azure.core.exceptions.HttpResponseError:
350
- """
351
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
352
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
353
-
354
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-10-01"))
355
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
356
- cls: ClsType[_models.StorageAccount] = kwargs.pop("cls", None)
357
- polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
358
- lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
359
- cont_token: Optional[str] = kwargs.pop("continuation_token", None)
360
- if cont_token is None:
361
- raw_result = await self._create_initial(
362
- resource_group_name=resource_group_name,
363
- account_name=account_name,
364
- parameters=parameters,
365
- api_version=api_version,
366
- content_type=content_type,
367
- cls=lambda x, y, z: x,
368
- headers=_headers,
369
- params=_params,
370
- **kwargs
371
- )
372
- await raw_result.http_response.read() # type: ignore
373
- kwargs.pop("error_map", None)
374
-
375
- def get_long_running_output(pipeline_response):
376
- deserialized = self._deserialize("StorageAccount", pipeline_response.http_response)
377
- if cls:
378
- return cls(pipeline_response, deserialized, {}) # type: ignore
379
- return deserialized
380
-
381
- if polling is True:
382
- polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
383
- elif polling is False:
384
- polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
385
- else:
386
- polling_method = polling
387
- if cont_token:
388
- return AsyncLROPoller[_models.StorageAccount].from_continuation_token(
389
- polling_method=polling_method,
390
- continuation_token=cont_token,
391
- client=self._client,
392
- deserialization_callback=get_long_running_output,
393
- )
394
- return AsyncLROPoller[_models.StorageAccount](
395
- self._client, raw_result, get_long_running_output, polling_method # type: ignore
396
- )
397
-
398
- @distributed_trace_async
399
- async def delete(self, resource_group_name: str, account_name: str, **kwargs: Any) -> None:
400
- """Deletes a storage account in Microsoft Azure.
401
-
402
- :param resource_group_name: The name of the resource group within the user's subscription. The
403
- name is case insensitive. Required.
404
- :type resource_group_name: str
405
- :param account_name: The name of the storage account within the specified resource group.
406
- Storage account names must be between 3 and 24 characters in length and use numbers and
407
- lower-case letters only. Required.
408
- :type account_name: str
409
- :return: None or the result of cls(response)
410
- :rtype: None
411
- :raises ~azure.core.exceptions.HttpResponseError:
412
- """
413
- error_map: MutableMapping = {
414
- 401: ClientAuthenticationError,
415
- 404: ResourceNotFoundError,
416
- 409: ResourceExistsError,
417
- 304: ResourceNotModifiedError,
418
- }
419
- error_map.update(kwargs.pop("error_map", {}) or {})
420
-
421
- _headers = kwargs.pop("headers", {}) or {}
422
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
423
-
424
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-10-01"))
425
- cls: ClsType[None] = kwargs.pop("cls", None)
426
-
427
- _request = build_delete_request(
428
- resource_group_name=resource_group_name,
429
- account_name=account_name,
430
- subscription_id=self._config.subscription_id,
431
- api_version=api_version,
432
- headers=_headers,
433
- params=_params,
434
- )
435
- _request.url = self._client.format_url(_request.url)
436
-
437
- _stream = False
438
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
439
- _request, stream=_stream, **kwargs
440
- )
441
-
442
- response = pipeline_response.http_response
443
-
444
- if response.status_code not in [200, 204]:
445
- map_error(status_code=response.status_code, response=response, error_map=error_map)
446
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
447
-
448
- if cls:
449
- return cls(pipeline_response, None, {}) # type: ignore
450
-
451
- @distributed_trace_async
452
- async def get_properties(
453
- self, resource_group_name: str, account_name: str, **kwargs: Any
454
- ) -> _models.StorageAccount:
455
- """Returns the properties for the specified storage account including but not limited to name, SKU
456
- name, location, and account status. The ListKeys operation should be used to retrieve storage
457
- keys.
458
-
459
- :param resource_group_name: The name of the resource group within the user's subscription. The
460
- name is case insensitive. Required.
461
- :type resource_group_name: str
462
- :param account_name: The name of the storage account within the specified resource group.
463
- Storage account names must be between 3 and 24 characters in length and use numbers and
464
- lower-case letters only. Required.
465
- :type account_name: str
466
- :return: StorageAccount or the result of cls(response)
467
- :rtype: ~azure.mgmt.storage.v2017_10_01.models.StorageAccount
468
- :raises ~azure.core.exceptions.HttpResponseError:
469
- """
470
- error_map: MutableMapping = {
471
- 401: ClientAuthenticationError,
472
- 404: ResourceNotFoundError,
473
- 409: ResourceExistsError,
474
- 304: ResourceNotModifiedError,
475
- }
476
- error_map.update(kwargs.pop("error_map", {}) or {})
477
-
478
- _headers = kwargs.pop("headers", {}) or {}
479
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
480
-
481
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-10-01"))
482
- cls: ClsType[_models.StorageAccount] = kwargs.pop("cls", None)
483
-
484
- _request = build_get_properties_request(
485
- resource_group_name=resource_group_name,
486
- account_name=account_name,
487
- subscription_id=self._config.subscription_id,
488
- api_version=api_version,
489
- headers=_headers,
490
- params=_params,
491
- )
492
- _request.url = self._client.format_url(_request.url)
493
-
494
- _stream = False
495
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
496
- _request, stream=_stream, **kwargs
497
- )
498
-
499
- response = pipeline_response.http_response
500
-
501
- if response.status_code not in [200]:
502
- map_error(status_code=response.status_code, response=response, error_map=error_map)
503
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
504
-
505
- deserialized = self._deserialize("StorageAccount", pipeline_response.http_response)
506
-
507
- if cls:
508
- return cls(pipeline_response, deserialized, {}) # type: ignore
509
-
510
- return deserialized # type: ignore
511
-
512
- @overload
513
- async def update(
514
- self,
515
- resource_group_name: str,
516
- account_name: str,
517
- parameters: _models.StorageAccountUpdateParameters,
518
- *,
519
- content_type: str = "application/json",
520
- **kwargs: Any
521
- ) -> _models.StorageAccount:
522
- """The update operation can be used to update the SKU, encryption, access tier, or tags for a
523
- storage account. It can also be used to map the account to a custom domain. Only one custom
524
- domain is supported per storage account; the replacement/change of custom domain is not
525
- supported. In order to replace an old custom domain, the old value must be cleared/unregistered
526
- before a new value can be set. The update of multiple properties is supported. This call does
527
- not change the storage keys for the account. If you want to change the storage account keys,
528
- use the regenerate keys operation. The location and name of the storage account cannot be
529
- changed after creation.
530
-
531
- :param resource_group_name: The name of the resource group within the user's subscription. The
532
- name is case insensitive. Required.
533
- :type resource_group_name: str
534
- :param account_name: The name of the storage account within the specified resource group.
535
- Storage account names must be between 3 and 24 characters in length and use numbers and
536
- lower-case letters only. Required.
537
- :type account_name: str
538
- :param parameters: The parameters to provide for the updated account. Required.
539
- :type parameters: ~azure.mgmt.storage.v2017_10_01.models.StorageAccountUpdateParameters
540
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
541
- Default value is "application/json".
542
- :paramtype content_type: str
543
- :return: StorageAccount or the result of cls(response)
544
- :rtype: ~azure.mgmt.storage.v2017_10_01.models.StorageAccount
545
- :raises ~azure.core.exceptions.HttpResponseError:
546
- """
547
-
548
- @overload
549
- async def update(
550
- self,
551
- resource_group_name: str,
552
- account_name: str,
553
- parameters: IO[bytes],
554
- *,
555
- content_type: str = "application/json",
556
- **kwargs: Any
557
- ) -> _models.StorageAccount:
558
- """The update operation can be used to update the SKU, encryption, access tier, or tags for a
559
- storage account. It can also be used to map the account to a custom domain. Only one custom
560
- domain is supported per storage account; the replacement/change of custom domain is not
561
- supported. In order to replace an old custom domain, the old value must be cleared/unregistered
562
- before a new value can be set. The update of multiple properties is supported. This call does
563
- not change the storage keys for the account. If you want to change the storage account keys,
564
- use the regenerate keys operation. The location and name of the storage account cannot be
565
- changed after creation.
566
-
567
- :param resource_group_name: The name of the resource group within the user's subscription. The
568
- name is case insensitive. Required.
569
- :type resource_group_name: str
570
- :param account_name: The name of the storage account within the specified resource group.
571
- Storage account names must be between 3 and 24 characters in length and use numbers and
572
- lower-case letters only. Required.
573
- :type account_name: str
574
- :param parameters: The parameters to provide for the updated account. Required.
575
- :type parameters: IO[bytes]
576
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
577
- Default value is "application/json".
578
- :paramtype content_type: str
579
- :return: StorageAccount or the result of cls(response)
580
- :rtype: ~azure.mgmt.storage.v2017_10_01.models.StorageAccount
581
- :raises ~azure.core.exceptions.HttpResponseError:
582
- """
583
-
584
- @distributed_trace_async
585
- async def update(
586
- self,
587
- resource_group_name: str,
588
- account_name: str,
589
- parameters: Union[_models.StorageAccountUpdateParameters, IO[bytes]],
590
- **kwargs: Any
591
- ) -> _models.StorageAccount:
592
- """The update operation can be used to update the SKU, encryption, access tier, or tags for a
593
- storage account. It can also be used to map the account to a custom domain. Only one custom
594
- domain is supported per storage account; the replacement/change of custom domain is not
595
- supported. In order to replace an old custom domain, the old value must be cleared/unregistered
596
- before a new value can be set. The update of multiple properties is supported. This call does
597
- not change the storage keys for the account. If you want to change the storage account keys,
598
- use the regenerate keys operation. The location and name of the storage account cannot be
599
- changed after creation.
600
-
601
- :param resource_group_name: The name of the resource group within the user's subscription. The
602
- name is case insensitive. Required.
603
- :type resource_group_name: str
604
- :param account_name: The name of the storage account within the specified resource group.
605
- Storage account names must be between 3 and 24 characters in length and use numbers and
606
- lower-case letters only. Required.
607
- :type account_name: str
608
- :param parameters: The parameters to provide for the updated account. Is either a
609
- StorageAccountUpdateParameters type or a IO[bytes] type. Required.
610
- :type parameters: ~azure.mgmt.storage.v2017_10_01.models.StorageAccountUpdateParameters or
611
- IO[bytes]
612
- :return: StorageAccount or the result of cls(response)
613
- :rtype: ~azure.mgmt.storage.v2017_10_01.models.StorageAccount
614
- :raises ~azure.core.exceptions.HttpResponseError:
615
- """
616
- error_map: MutableMapping = {
617
- 401: ClientAuthenticationError,
618
- 404: ResourceNotFoundError,
619
- 409: ResourceExistsError,
620
- 304: ResourceNotModifiedError,
621
- }
622
- error_map.update(kwargs.pop("error_map", {}) or {})
623
-
624
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
625
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
626
-
627
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-10-01"))
628
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
629
- cls: ClsType[_models.StorageAccount] = kwargs.pop("cls", None)
630
-
631
- content_type = content_type or "application/json"
632
- _json = None
633
- _content = None
634
- if isinstance(parameters, (IOBase, bytes)):
635
- _content = parameters
636
- else:
637
- _json = self._serialize.body(parameters, "StorageAccountUpdateParameters")
638
-
639
- _request = build_update_request(
640
- resource_group_name=resource_group_name,
641
- account_name=account_name,
642
- subscription_id=self._config.subscription_id,
643
- api_version=api_version,
644
- content_type=content_type,
645
- json=_json,
646
- content=_content,
647
- headers=_headers,
648
- params=_params,
649
- )
650
- _request.url = self._client.format_url(_request.url)
651
-
652
- _stream = False
653
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
654
- _request, stream=_stream, **kwargs
655
- )
656
-
657
- response = pipeline_response.http_response
658
-
659
- if response.status_code not in [200]:
660
- map_error(status_code=response.status_code, response=response, error_map=error_map)
661
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
662
-
663
- deserialized = self._deserialize("StorageAccount", pipeline_response.http_response)
664
-
665
- if cls:
666
- return cls(pipeline_response, deserialized, {}) # type: ignore
667
-
668
- return deserialized # type: ignore
669
-
670
- @distributed_trace
671
- def list(self, **kwargs: Any) -> AsyncIterable["_models.StorageAccount"]:
672
- """Lists all the storage accounts available under the subscription. Note that storage keys are not
673
- returned; use the ListKeys operation for this.
674
-
675
- :return: An iterator like instance of either StorageAccount or the result of cls(response)
676
- :rtype:
677
- ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2017_10_01.models.StorageAccount]
678
- :raises ~azure.core.exceptions.HttpResponseError:
679
- """
680
- _headers = kwargs.pop("headers", {}) or {}
681
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
682
-
683
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-10-01"))
684
- cls: ClsType[_models.StorageAccountListResult] = kwargs.pop("cls", None)
685
-
686
- error_map: MutableMapping = {
687
- 401: ClientAuthenticationError,
688
- 404: ResourceNotFoundError,
689
- 409: ResourceExistsError,
690
- 304: ResourceNotModifiedError,
691
- }
692
- error_map.update(kwargs.pop("error_map", {}) or {})
693
-
694
- def prepare_request(next_link=None):
695
- if not next_link:
696
-
697
- _request = build_list_request(
698
- subscription_id=self._config.subscription_id,
699
- api_version=api_version,
700
- headers=_headers,
701
- params=_params,
702
- )
703
- _request.url = self._client.format_url(_request.url)
704
-
705
- else:
706
- # make call to next link with the client's api-version
707
- _parsed_next_link = urllib.parse.urlparse(next_link)
708
- _next_request_params = case_insensitive_dict(
709
- {
710
- key: [urllib.parse.quote(v) for v in value]
711
- for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
712
- }
713
- )
714
- _next_request_params["api-version"] = self._api_version
715
- _request = HttpRequest(
716
- "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
717
- )
718
- _request.url = self._client.format_url(_request.url)
719
- _request.method = "GET"
720
- return _request
721
-
722
- async def extract_data(pipeline_response):
723
- deserialized = self._deserialize("StorageAccountListResult", pipeline_response)
724
- list_of_elem = deserialized.value
725
- if cls:
726
- list_of_elem = cls(list_of_elem) # type: ignore
727
- return None, AsyncList(list_of_elem)
728
-
729
- async def get_next(next_link=None):
730
- _request = prepare_request(next_link)
731
-
732
- _stream = False
733
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
734
- _request, stream=_stream, **kwargs
735
- )
736
- response = pipeline_response.http_response
737
-
738
- if response.status_code not in [200]:
739
- map_error(status_code=response.status_code, response=response, error_map=error_map)
740
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
741
-
742
- return pipeline_response
743
-
744
- return AsyncItemPaged(get_next, extract_data)
745
-
746
- @distributed_trace
747
- def list_by_resource_group(
748
- self, resource_group_name: str, **kwargs: Any
749
- ) -> AsyncIterable["_models.StorageAccount"]:
750
- """Lists all the storage accounts available under the given resource group. Note that storage keys
751
- are not returned; use the ListKeys operation for this.
752
-
753
- :param resource_group_name: The name of the resource group within the user's subscription. The
754
- name is case insensitive. Required.
755
- :type resource_group_name: str
756
- :return: An iterator like instance of either StorageAccount or the result of cls(response)
757
- :rtype:
758
- ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2017_10_01.models.StorageAccount]
759
- :raises ~azure.core.exceptions.HttpResponseError:
760
- """
761
- _headers = kwargs.pop("headers", {}) or {}
762
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
763
-
764
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-10-01"))
765
- cls: ClsType[_models.StorageAccountListResult] = kwargs.pop("cls", None)
766
-
767
- error_map: MutableMapping = {
768
- 401: ClientAuthenticationError,
769
- 404: ResourceNotFoundError,
770
- 409: ResourceExistsError,
771
- 304: ResourceNotModifiedError,
772
- }
773
- error_map.update(kwargs.pop("error_map", {}) or {})
774
-
775
- def prepare_request(next_link=None):
776
- if not next_link:
777
-
778
- _request = build_list_by_resource_group_request(
779
- resource_group_name=resource_group_name,
780
- subscription_id=self._config.subscription_id,
781
- api_version=api_version,
782
- headers=_headers,
783
- params=_params,
784
- )
785
- _request.url = self._client.format_url(_request.url)
786
-
787
- else:
788
- # make call to next link with the client's api-version
789
- _parsed_next_link = urllib.parse.urlparse(next_link)
790
- _next_request_params = case_insensitive_dict(
791
- {
792
- key: [urllib.parse.quote(v) for v in value]
793
- for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
794
- }
795
- )
796
- _next_request_params["api-version"] = self._api_version
797
- _request = HttpRequest(
798
- "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
799
- )
800
- _request.url = self._client.format_url(_request.url)
801
- _request.method = "GET"
802
- return _request
803
-
804
- async def extract_data(pipeline_response):
805
- deserialized = self._deserialize("StorageAccountListResult", pipeline_response)
806
- list_of_elem = deserialized.value
807
- if cls:
808
- list_of_elem = cls(list_of_elem) # type: ignore
809
- return None, AsyncList(list_of_elem)
810
-
811
- async def get_next(next_link=None):
812
- _request = prepare_request(next_link)
813
-
814
- _stream = False
815
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
816
- _request, stream=_stream, **kwargs
817
- )
818
- response = pipeline_response.http_response
819
-
820
- if response.status_code not in [200]:
821
- map_error(status_code=response.status_code, response=response, error_map=error_map)
822
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
823
-
824
- return pipeline_response
825
-
826
- return AsyncItemPaged(get_next, extract_data)
827
-
828
- @distributed_trace_async
829
- async def list_keys(
830
- self, resource_group_name: str, account_name: str, **kwargs: Any
831
- ) -> _models.StorageAccountListKeysResult:
832
- """Lists the access keys for the specified storage account.
833
-
834
- :param resource_group_name: The name of the resource group within the user's subscription. The
835
- name is case insensitive. Required.
836
- :type resource_group_name: str
837
- :param account_name: The name of the storage account within the specified resource group.
838
- Storage account names must be between 3 and 24 characters in length and use numbers and
839
- lower-case letters only. Required.
840
- :type account_name: str
841
- :return: StorageAccountListKeysResult or the result of cls(response)
842
- :rtype: ~azure.mgmt.storage.v2017_10_01.models.StorageAccountListKeysResult
843
- :raises ~azure.core.exceptions.HttpResponseError:
844
- """
845
- error_map: MutableMapping = {
846
- 401: ClientAuthenticationError,
847
- 404: ResourceNotFoundError,
848
- 409: ResourceExistsError,
849
- 304: ResourceNotModifiedError,
850
- }
851
- error_map.update(kwargs.pop("error_map", {}) or {})
852
-
853
- _headers = kwargs.pop("headers", {}) or {}
854
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
855
-
856
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-10-01"))
857
- cls: ClsType[_models.StorageAccountListKeysResult] = kwargs.pop("cls", None)
858
-
859
- _request = build_list_keys_request(
860
- resource_group_name=resource_group_name,
861
- account_name=account_name,
862
- subscription_id=self._config.subscription_id,
863
- api_version=api_version,
864
- headers=_headers,
865
- params=_params,
866
- )
867
- _request.url = self._client.format_url(_request.url)
868
-
869
- _stream = False
870
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
871
- _request, stream=_stream, **kwargs
872
- )
873
-
874
- response = pipeline_response.http_response
875
-
876
- if response.status_code not in [200]:
877
- map_error(status_code=response.status_code, response=response, error_map=error_map)
878
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
879
-
880
- deserialized = self._deserialize("StorageAccountListKeysResult", pipeline_response.http_response)
881
-
882
- if cls:
883
- return cls(pipeline_response, deserialized, {}) # type: ignore
884
-
885
- return deserialized # type: ignore
886
-
887
- @overload
888
- async def regenerate_key(
889
- self,
890
- resource_group_name: str,
891
- account_name: str,
892
- regenerate_key: _models.StorageAccountRegenerateKeyParameters,
893
- *,
894
- content_type: str = "application/json",
895
- **kwargs: Any
896
- ) -> _models.StorageAccountListKeysResult:
897
- """Regenerates one of the access keys for the specified storage account.
898
-
899
- :param resource_group_name: The name of the resource group within the user's subscription. The
900
- name is case insensitive. Required.
901
- :type resource_group_name: str
902
- :param account_name: The name of the storage account within the specified resource group.
903
- Storage account names must be between 3 and 24 characters in length and use numbers and
904
- lower-case letters only. Required.
905
- :type account_name: str
906
- :param regenerate_key: Specifies name of the key which should be regenerated -- key1 or key2.
907
- Required.
908
- :type regenerate_key:
909
- ~azure.mgmt.storage.v2017_10_01.models.StorageAccountRegenerateKeyParameters
910
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
911
- Default value is "application/json".
912
- :paramtype content_type: str
913
- :return: StorageAccountListKeysResult or the result of cls(response)
914
- :rtype: ~azure.mgmt.storage.v2017_10_01.models.StorageAccountListKeysResult
915
- :raises ~azure.core.exceptions.HttpResponseError:
916
- """
917
-
918
- @overload
919
- async def regenerate_key(
920
- self,
921
- resource_group_name: str,
922
- account_name: str,
923
- regenerate_key: IO[bytes],
924
- *,
925
- content_type: str = "application/json",
926
- **kwargs: Any
927
- ) -> _models.StorageAccountListKeysResult:
928
- """Regenerates one of the access keys for the specified storage account.
929
-
930
- :param resource_group_name: The name of the resource group within the user's subscription. The
931
- name is case insensitive. Required.
932
- :type resource_group_name: str
933
- :param account_name: The name of the storage account within the specified resource group.
934
- Storage account names must be between 3 and 24 characters in length and use numbers and
935
- lower-case letters only. Required.
936
- :type account_name: str
937
- :param regenerate_key: Specifies name of the key which should be regenerated -- key1 or key2.
938
- Required.
939
- :type regenerate_key: IO[bytes]
940
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
941
- Default value is "application/json".
942
- :paramtype content_type: str
943
- :return: StorageAccountListKeysResult or the result of cls(response)
944
- :rtype: ~azure.mgmt.storage.v2017_10_01.models.StorageAccountListKeysResult
945
- :raises ~azure.core.exceptions.HttpResponseError:
946
- """
947
-
948
- @distributed_trace_async
949
- async def regenerate_key(
950
- self,
951
- resource_group_name: str,
952
- account_name: str,
953
- regenerate_key: Union[_models.StorageAccountRegenerateKeyParameters, IO[bytes]],
954
- **kwargs: Any
955
- ) -> _models.StorageAccountListKeysResult:
956
- """Regenerates one of the access keys for the specified storage account.
957
-
958
- :param resource_group_name: The name of the resource group within the user's subscription. The
959
- name is case insensitive. Required.
960
- :type resource_group_name: str
961
- :param account_name: The name of the storage account within the specified resource group.
962
- Storage account names must be between 3 and 24 characters in length and use numbers and
963
- lower-case letters only. Required.
964
- :type account_name: str
965
- :param regenerate_key: Specifies name of the key which should be regenerated -- key1 or key2.
966
- Is either a StorageAccountRegenerateKeyParameters type or a IO[bytes] type. Required.
967
- :type regenerate_key:
968
- ~azure.mgmt.storage.v2017_10_01.models.StorageAccountRegenerateKeyParameters or IO[bytes]
969
- :return: StorageAccountListKeysResult or the result of cls(response)
970
- :rtype: ~azure.mgmt.storage.v2017_10_01.models.StorageAccountListKeysResult
971
- :raises ~azure.core.exceptions.HttpResponseError:
972
- """
973
- error_map: MutableMapping = {
974
- 401: ClientAuthenticationError,
975
- 404: ResourceNotFoundError,
976
- 409: ResourceExistsError,
977
- 304: ResourceNotModifiedError,
978
- }
979
- error_map.update(kwargs.pop("error_map", {}) or {})
980
-
981
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
982
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
983
-
984
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-10-01"))
985
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
986
- cls: ClsType[_models.StorageAccountListKeysResult] = kwargs.pop("cls", None)
987
-
988
- content_type = content_type or "application/json"
989
- _json = None
990
- _content = None
991
- if isinstance(regenerate_key, (IOBase, bytes)):
992
- _content = regenerate_key
993
- else:
994
- _json = self._serialize.body(regenerate_key, "StorageAccountRegenerateKeyParameters")
995
-
996
- _request = build_regenerate_key_request(
997
- resource_group_name=resource_group_name,
998
- account_name=account_name,
999
- subscription_id=self._config.subscription_id,
1000
- api_version=api_version,
1001
- content_type=content_type,
1002
- json=_json,
1003
- content=_content,
1004
- headers=_headers,
1005
- params=_params,
1006
- )
1007
- _request.url = self._client.format_url(_request.url)
1008
-
1009
- _stream = False
1010
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
1011
- _request, stream=_stream, **kwargs
1012
- )
1013
-
1014
- response = pipeline_response.http_response
1015
-
1016
- if response.status_code not in [200]:
1017
- map_error(status_code=response.status_code, response=response, error_map=error_map)
1018
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
1019
-
1020
- deserialized = self._deserialize("StorageAccountListKeysResult", pipeline_response.http_response)
1021
-
1022
- if cls:
1023
- return cls(pipeline_response, deserialized, {}) # type: ignore
1024
-
1025
- return deserialized # type: ignore
1026
-
1027
- @overload
1028
- async def list_account_sas(
1029
- self,
1030
- resource_group_name: str,
1031
- account_name: str,
1032
- parameters: _models.AccountSasParameters,
1033
- *,
1034
- content_type: str = "application/json",
1035
- **kwargs: Any
1036
- ) -> _models.ListAccountSasResponse:
1037
- """List SAS credentials of a storage account.
1038
-
1039
- :param resource_group_name: The name of the resource group within the user's subscription. The
1040
- name is case insensitive. Required.
1041
- :type resource_group_name: str
1042
- :param account_name: The name of the storage account within the specified resource group.
1043
- Storage account names must be between 3 and 24 characters in length and use numbers and
1044
- lower-case letters only. Required.
1045
- :type account_name: str
1046
- :param parameters: The parameters to provide to list SAS credentials for the storage account.
1047
- Required.
1048
- :type parameters: ~azure.mgmt.storage.v2017_10_01.models.AccountSasParameters
1049
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
1050
- Default value is "application/json".
1051
- :paramtype content_type: str
1052
- :return: ListAccountSasResponse or the result of cls(response)
1053
- :rtype: ~azure.mgmt.storage.v2017_10_01.models.ListAccountSasResponse
1054
- :raises ~azure.core.exceptions.HttpResponseError:
1055
- """
1056
-
1057
- @overload
1058
- async def list_account_sas(
1059
- self,
1060
- resource_group_name: str,
1061
- account_name: str,
1062
- parameters: IO[bytes],
1063
- *,
1064
- content_type: str = "application/json",
1065
- **kwargs: Any
1066
- ) -> _models.ListAccountSasResponse:
1067
- """List SAS credentials of a storage account.
1068
-
1069
- :param resource_group_name: The name of the resource group within the user's subscription. The
1070
- name is case insensitive. Required.
1071
- :type resource_group_name: str
1072
- :param account_name: The name of the storage account within the specified resource group.
1073
- Storage account names must be between 3 and 24 characters in length and use numbers and
1074
- lower-case letters only. Required.
1075
- :type account_name: str
1076
- :param parameters: The parameters to provide to list SAS credentials for the storage account.
1077
- Required.
1078
- :type parameters: IO[bytes]
1079
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
1080
- Default value is "application/json".
1081
- :paramtype content_type: str
1082
- :return: ListAccountSasResponse or the result of cls(response)
1083
- :rtype: ~azure.mgmt.storage.v2017_10_01.models.ListAccountSasResponse
1084
- :raises ~azure.core.exceptions.HttpResponseError:
1085
- """
1086
-
1087
- @distributed_trace_async
1088
- async def list_account_sas(
1089
- self,
1090
- resource_group_name: str,
1091
- account_name: str,
1092
- parameters: Union[_models.AccountSasParameters, IO[bytes]],
1093
- **kwargs: Any
1094
- ) -> _models.ListAccountSasResponse:
1095
- """List SAS credentials of a storage account.
1096
-
1097
- :param resource_group_name: The name of the resource group within the user's subscription. The
1098
- name is case insensitive. Required.
1099
- :type resource_group_name: str
1100
- :param account_name: The name of the storage account within the specified resource group.
1101
- Storage account names must be between 3 and 24 characters in length and use numbers and
1102
- lower-case letters only. Required.
1103
- :type account_name: str
1104
- :param parameters: The parameters to provide to list SAS credentials for the storage account.
1105
- Is either a AccountSasParameters type or a IO[bytes] type. Required.
1106
- :type parameters: ~azure.mgmt.storage.v2017_10_01.models.AccountSasParameters or IO[bytes]
1107
- :return: ListAccountSasResponse or the result of cls(response)
1108
- :rtype: ~azure.mgmt.storage.v2017_10_01.models.ListAccountSasResponse
1109
- :raises ~azure.core.exceptions.HttpResponseError:
1110
- """
1111
- error_map: MutableMapping = {
1112
- 401: ClientAuthenticationError,
1113
- 404: ResourceNotFoundError,
1114
- 409: ResourceExistsError,
1115
- 304: ResourceNotModifiedError,
1116
- }
1117
- error_map.update(kwargs.pop("error_map", {}) or {})
1118
-
1119
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
1120
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
1121
-
1122
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-10-01"))
1123
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
1124
- cls: ClsType[_models.ListAccountSasResponse] = kwargs.pop("cls", None)
1125
-
1126
- content_type = content_type or "application/json"
1127
- _json = None
1128
- _content = None
1129
- if isinstance(parameters, (IOBase, bytes)):
1130
- _content = parameters
1131
- else:
1132
- _json = self._serialize.body(parameters, "AccountSasParameters")
1133
-
1134
- _request = build_list_account_sas_request(
1135
- resource_group_name=resource_group_name,
1136
- account_name=account_name,
1137
- subscription_id=self._config.subscription_id,
1138
- api_version=api_version,
1139
- content_type=content_type,
1140
- json=_json,
1141
- content=_content,
1142
- headers=_headers,
1143
- params=_params,
1144
- )
1145
- _request.url = self._client.format_url(_request.url)
1146
-
1147
- _stream = False
1148
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
1149
- _request, stream=_stream, **kwargs
1150
- )
1151
-
1152
- response = pipeline_response.http_response
1153
-
1154
- if response.status_code not in [200]:
1155
- map_error(status_code=response.status_code, response=response, error_map=error_map)
1156
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
1157
-
1158
- deserialized = self._deserialize("ListAccountSasResponse", pipeline_response.http_response)
1159
-
1160
- if cls:
1161
- return cls(pipeline_response, deserialized, {}) # type: ignore
1162
-
1163
- return deserialized # type: ignore
1164
-
1165
- @overload
1166
- async def list_service_sas(
1167
- self,
1168
- resource_group_name: str,
1169
- account_name: str,
1170
- parameters: _models.ServiceSasParameters,
1171
- *,
1172
- content_type: str = "application/json",
1173
- **kwargs: Any
1174
- ) -> _models.ListServiceSasResponse:
1175
- """List service SAS credentials of a specific resource.
1176
-
1177
- :param resource_group_name: The name of the resource group within the user's subscription. The
1178
- name is case insensitive. Required.
1179
- :type resource_group_name: str
1180
- :param account_name: The name of the storage account within the specified resource group.
1181
- Storage account names must be between 3 and 24 characters in length and use numbers and
1182
- lower-case letters only. Required.
1183
- :type account_name: str
1184
- :param parameters: The parameters to provide to list service SAS credentials. Required.
1185
- :type parameters: ~azure.mgmt.storage.v2017_10_01.models.ServiceSasParameters
1186
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
1187
- Default value is "application/json".
1188
- :paramtype content_type: str
1189
- :return: ListServiceSasResponse or the result of cls(response)
1190
- :rtype: ~azure.mgmt.storage.v2017_10_01.models.ListServiceSasResponse
1191
- :raises ~azure.core.exceptions.HttpResponseError:
1192
- """
1193
-
1194
- @overload
1195
- async def list_service_sas(
1196
- self,
1197
- resource_group_name: str,
1198
- account_name: str,
1199
- parameters: IO[bytes],
1200
- *,
1201
- content_type: str = "application/json",
1202
- **kwargs: Any
1203
- ) -> _models.ListServiceSasResponse:
1204
- """List service SAS credentials of a specific resource.
1205
-
1206
- :param resource_group_name: The name of the resource group within the user's subscription. The
1207
- name is case insensitive. Required.
1208
- :type resource_group_name: str
1209
- :param account_name: The name of the storage account within the specified resource group.
1210
- Storage account names must be between 3 and 24 characters in length and use numbers and
1211
- lower-case letters only. Required.
1212
- :type account_name: str
1213
- :param parameters: The parameters to provide to list service SAS credentials. Required.
1214
- :type parameters: IO[bytes]
1215
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
1216
- Default value is "application/json".
1217
- :paramtype content_type: str
1218
- :return: ListServiceSasResponse or the result of cls(response)
1219
- :rtype: ~azure.mgmt.storage.v2017_10_01.models.ListServiceSasResponse
1220
- :raises ~azure.core.exceptions.HttpResponseError:
1221
- """
1222
-
1223
- @distributed_trace_async
1224
- async def list_service_sas(
1225
- self,
1226
- resource_group_name: str,
1227
- account_name: str,
1228
- parameters: Union[_models.ServiceSasParameters, IO[bytes]],
1229
- **kwargs: Any
1230
- ) -> _models.ListServiceSasResponse:
1231
- """List service SAS credentials of a specific resource.
1232
-
1233
- :param resource_group_name: The name of the resource group within the user's subscription. The
1234
- name is case insensitive. Required.
1235
- :type resource_group_name: str
1236
- :param account_name: The name of the storage account within the specified resource group.
1237
- Storage account names must be between 3 and 24 characters in length and use numbers and
1238
- lower-case letters only. Required.
1239
- :type account_name: str
1240
- :param parameters: The parameters to provide to list service SAS credentials. Is either a
1241
- ServiceSasParameters type or a IO[bytes] type. Required.
1242
- :type parameters: ~azure.mgmt.storage.v2017_10_01.models.ServiceSasParameters or IO[bytes]
1243
- :return: ListServiceSasResponse or the result of cls(response)
1244
- :rtype: ~azure.mgmt.storage.v2017_10_01.models.ListServiceSasResponse
1245
- :raises ~azure.core.exceptions.HttpResponseError:
1246
- """
1247
- error_map: MutableMapping = {
1248
- 401: ClientAuthenticationError,
1249
- 404: ResourceNotFoundError,
1250
- 409: ResourceExistsError,
1251
- 304: ResourceNotModifiedError,
1252
- }
1253
- error_map.update(kwargs.pop("error_map", {}) or {})
1254
-
1255
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
1256
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
1257
-
1258
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-10-01"))
1259
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
1260
- cls: ClsType[_models.ListServiceSasResponse] = kwargs.pop("cls", None)
1261
-
1262
- content_type = content_type or "application/json"
1263
- _json = None
1264
- _content = None
1265
- if isinstance(parameters, (IOBase, bytes)):
1266
- _content = parameters
1267
- else:
1268
- _json = self._serialize.body(parameters, "ServiceSasParameters")
1269
-
1270
- _request = build_list_service_sas_request(
1271
- resource_group_name=resource_group_name,
1272
- account_name=account_name,
1273
- subscription_id=self._config.subscription_id,
1274
- api_version=api_version,
1275
- content_type=content_type,
1276
- json=_json,
1277
- content=_content,
1278
- headers=_headers,
1279
- params=_params,
1280
- )
1281
- _request.url = self._client.format_url(_request.url)
1282
-
1283
- _stream = False
1284
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
1285
- _request, stream=_stream, **kwargs
1286
- )
1287
-
1288
- response = pipeline_response.http_response
1289
-
1290
- if response.status_code not in [200]:
1291
- map_error(status_code=response.status_code, response=response, error_map=error_map)
1292
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
1293
-
1294
- deserialized = self._deserialize("ListServiceSasResponse", pipeline_response.http_response)
1295
-
1296
- if cls:
1297
- return cls(pipeline_response, deserialized, {}) # type: ignore
1298
-
1299
- return deserialized # type: ignore