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