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,1638 +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", "2017-10-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", "2017-10-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(
93
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
94
- ),
95
- "accountName": _SERIALIZER.url("account_name", account_name, "str", max_length=24, min_length=3),
96
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
97
- }
98
-
99
- _url: str = _url.format(**path_format_arguments) # type: ignore
100
-
101
- # Construct parameters
102
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
103
-
104
- # Construct headers
105
- if content_type is not None:
106
- _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
107
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
108
-
109
- return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs)
110
-
111
-
112
- def build_delete_request(
113
- resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any
114
- ) -> HttpRequest:
115
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
116
-
117
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-10-01"))
118
- # Construct URL
119
- _url = kwargs.pop(
120
- "template_url",
121
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}",
122
- ) # pylint: disable=line-too-long
123
- path_format_arguments = {
124
- "resourceGroupName": _SERIALIZER.url(
125
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
126
- ),
127
- "accountName": _SERIALIZER.url("account_name", account_name, "str", max_length=24, min_length=3),
128
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
129
- }
130
-
131
- _url: str = _url.format(**path_format_arguments) # type: ignore
132
-
133
- # Construct parameters
134
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
135
-
136
- return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs)
137
-
138
-
139
- def build_get_properties_request(
140
- resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any
141
- ) -> HttpRequest:
142
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
143
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
144
-
145
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-10-01"))
146
- accept = _headers.pop("Accept", "application/json, text/json")
147
-
148
- # Construct URL
149
- _url = kwargs.pop(
150
- "template_url",
151
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}",
152
- ) # pylint: disable=line-too-long
153
- path_format_arguments = {
154
- "resourceGroupName": _SERIALIZER.url(
155
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
156
- ),
157
- "accountName": _SERIALIZER.url("account_name", account_name, "str", max_length=24, min_length=3),
158
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
159
- }
160
-
161
- _url: str = _url.format(**path_format_arguments) # type: ignore
162
-
163
- # Construct parameters
164
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
165
-
166
- # Construct headers
167
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
168
-
169
- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
170
-
171
-
172
- def build_update_request(
173
- resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any
174
- ) -> HttpRequest:
175
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
176
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
177
-
178
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-10-01"))
179
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
180
- accept = _headers.pop("Accept", "application/json, text/json")
181
-
182
- # Construct URL
183
- _url = kwargs.pop(
184
- "template_url",
185
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}",
186
- ) # pylint: disable=line-too-long
187
- path_format_arguments = {
188
- "resourceGroupName": _SERIALIZER.url(
189
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
190
- ),
191
- "accountName": _SERIALIZER.url("account_name", account_name, "str", max_length=24, min_length=3),
192
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
193
- }
194
-
195
- _url: str = _url.format(**path_format_arguments) # type: ignore
196
-
197
- # Construct parameters
198
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
199
-
200
- # Construct headers
201
- if content_type is not None:
202
- _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
203
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
204
-
205
- return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs)
206
-
207
-
208
- def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest:
209
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
210
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
211
-
212
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-10-01"))
213
- accept = _headers.pop("Accept", "application/json, text/json")
214
-
215
- # Construct URL
216
- _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts")
217
- path_format_arguments = {
218
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
219
- }
220
-
221
- _url: str = _url.format(**path_format_arguments) # type: ignore
222
-
223
- # Construct parameters
224
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
225
-
226
- # Construct headers
227
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
228
-
229
- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
230
-
231
-
232
- def build_list_by_resource_group_request(resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest:
233
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
234
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
235
-
236
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-10-01"))
237
- accept = _headers.pop("Accept", "application/json, text/json")
238
-
239
- # Construct URL
240
- _url = kwargs.pop(
241
- "template_url",
242
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts",
243
- ) # pylint: disable=line-too-long
244
- path_format_arguments = {
245
- "resourceGroupName": _SERIALIZER.url(
246
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
247
- ),
248
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
249
- }
250
-
251
- _url: str = _url.format(**path_format_arguments) # type: ignore
252
-
253
- # Construct parameters
254
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
255
-
256
- # Construct headers
257
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
258
-
259
- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
260
-
261
-
262
- def build_list_keys_request(
263
- resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any
264
- ) -> HttpRequest:
265
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
266
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
267
-
268
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-10-01"))
269
- accept = _headers.pop("Accept", "application/json, text/json")
270
-
271
- # Construct URL
272
- _url = kwargs.pop(
273
- "template_url",
274
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys",
275
- ) # pylint: disable=line-too-long
276
- path_format_arguments = {
277
- "resourceGroupName": _SERIALIZER.url(
278
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
279
- ),
280
- "accountName": _SERIALIZER.url("account_name", account_name, "str", max_length=24, min_length=3),
281
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
282
- }
283
-
284
- _url: str = _url.format(**path_format_arguments) # type: ignore
285
-
286
- # Construct parameters
287
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
288
-
289
- # Construct headers
290
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
291
-
292
- return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
293
-
294
-
295
- def build_regenerate_key_request(
296
- resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any
297
- ) -> HttpRequest:
298
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
299
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
300
-
301
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-10-01"))
302
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
303
- accept = _headers.pop("Accept", "application/json, text/json")
304
-
305
- # Construct URL
306
- _url = kwargs.pop(
307
- "template_url",
308
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey",
309
- ) # pylint: disable=line-too-long
310
- path_format_arguments = {
311
- "resourceGroupName": _SERIALIZER.url(
312
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
313
- ),
314
- "accountName": _SERIALIZER.url("account_name", account_name, "str", max_length=24, min_length=3),
315
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
316
- }
317
-
318
- _url: str = _url.format(**path_format_arguments) # type: ignore
319
-
320
- # Construct parameters
321
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
322
-
323
- # Construct headers
324
- if content_type is not None:
325
- _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
326
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
327
-
328
- return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
329
-
330
-
331
- def build_list_account_sas_request(
332
- resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any
333
- ) -> HttpRequest:
334
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
335
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
336
-
337
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-10-01"))
338
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
339
- accept = _headers.pop("Accept", "application/json, text/json")
340
-
341
- # Construct URL
342
- _url = kwargs.pop(
343
- "template_url",
344
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas",
345
- ) # pylint: disable=line-too-long
346
- path_format_arguments = {
347
- "resourceGroupName": _SERIALIZER.url(
348
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
349
- ),
350
- "accountName": _SERIALIZER.url("account_name", account_name, "str", max_length=24, min_length=3),
351
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
352
- }
353
-
354
- _url: str = _url.format(**path_format_arguments) # type: ignore
355
-
356
- # Construct parameters
357
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
358
-
359
- # Construct headers
360
- if content_type is not None:
361
- _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
362
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
363
-
364
- return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
365
-
366
-
367
- def build_list_service_sas_request(
368
- resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any
369
- ) -> HttpRequest:
370
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
371
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
372
-
373
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-10-01"))
374
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
375
- accept = _headers.pop("Accept", "application/json, text/json")
376
-
377
- # Construct URL
378
- _url = kwargs.pop(
379
- "template_url",
380
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas",
381
- ) # pylint: disable=line-too-long
382
- path_format_arguments = {
383
- "resourceGroupName": _SERIALIZER.url(
384
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
385
- ),
386
- "accountName": _SERIALIZER.url("account_name", account_name, "str", max_length=24, min_length=3),
387
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
388
- }
389
-
390
- _url: str = _url.format(**path_format_arguments) # type: ignore
391
-
392
- # Construct parameters
393
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
394
-
395
- # Construct headers
396
- if content_type is not None:
397
- _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
398
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
399
-
400
- return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
401
-
402
-
403
- class StorageAccountsOperations:
404
- """
405
- .. warning::
406
- **DO NOT** instantiate this class directly.
407
-
408
- Instead, you should access the following operations through
409
- :class:`~azure.mgmt.storage.v2017_10_01.StorageManagement`'s
410
- :attr:`storage_accounts` attribute.
411
- """
412
-
413
- models = _models
414
-
415
- def __init__(self, *args, **kwargs):
416
- input_args = list(args)
417
- self._client = input_args.pop(0) if input_args else kwargs.pop("client")
418
- self._config = input_args.pop(0) if input_args else kwargs.pop("config")
419
- self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
420
- self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
421
- self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
422
-
423
- @overload
424
- def check_name_availability(
425
- self,
426
- account_name: _models.StorageAccountCheckNameAvailabilityParameters,
427
- *,
428
- content_type: str = "application/json",
429
- **kwargs: Any
430
- ) -> _models.CheckNameAvailabilityResult:
431
- """Checks that the storage account name is valid and is not already in use.
432
-
433
- :param account_name: The name of the storage account within the specified resource group.
434
- Storage account names must be between 3 and 24 characters in length and use numbers and
435
- lower-case letters only. Required.
436
- :type account_name:
437
- ~azure.mgmt.storage.v2017_10_01.models.StorageAccountCheckNameAvailabilityParameters
438
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
439
- Default value is "application/json".
440
- :paramtype content_type: str
441
- :return: CheckNameAvailabilityResult or the result of cls(response)
442
- :rtype: ~azure.mgmt.storage.v2017_10_01.models.CheckNameAvailabilityResult
443
- :raises ~azure.core.exceptions.HttpResponseError:
444
- """
445
-
446
- @overload
447
- def check_name_availability(
448
- self, account_name: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
449
- ) -> _models.CheckNameAvailabilityResult:
450
- """Checks that the storage account name is valid and is not already in use.
451
-
452
- :param account_name: The name of the storage account within the specified resource group.
453
- Storage account names must be between 3 and 24 characters in length and use numbers and
454
- lower-case letters only. Required.
455
- :type account_name: IO[bytes]
456
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
457
- Default value is "application/json".
458
- :paramtype content_type: str
459
- :return: CheckNameAvailabilityResult or the result of cls(response)
460
- :rtype: ~azure.mgmt.storage.v2017_10_01.models.CheckNameAvailabilityResult
461
- :raises ~azure.core.exceptions.HttpResponseError:
462
- """
463
-
464
- @distributed_trace
465
- def check_name_availability(
466
- self, account_name: Union[_models.StorageAccountCheckNameAvailabilityParameters, IO[bytes]], **kwargs: Any
467
- ) -> _models.CheckNameAvailabilityResult:
468
- """Checks that the storage account name is valid and is not already in use.
469
-
470
- :param account_name: The name of the storage account within the specified resource group.
471
- Storage account names must be between 3 and 24 characters in length and use numbers and
472
- lower-case letters only. Is either a StorageAccountCheckNameAvailabilityParameters type or a
473
- IO[bytes] type. Required.
474
- :type account_name:
475
- ~azure.mgmt.storage.v2017_10_01.models.StorageAccountCheckNameAvailabilityParameters or
476
- IO[bytes]
477
- :return: CheckNameAvailabilityResult or the result of cls(response)
478
- :rtype: ~azure.mgmt.storage.v2017_10_01.models.CheckNameAvailabilityResult
479
- :raises ~azure.core.exceptions.HttpResponseError:
480
- """
481
- error_map: MutableMapping = {
482
- 401: ClientAuthenticationError,
483
- 404: ResourceNotFoundError,
484
- 409: ResourceExistsError,
485
- 304: ResourceNotModifiedError,
486
- }
487
- error_map.update(kwargs.pop("error_map", {}) or {})
488
-
489
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
490
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
491
-
492
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-10-01"))
493
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
494
- cls: ClsType[_models.CheckNameAvailabilityResult] = kwargs.pop("cls", None)
495
-
496
- content_type = content_type or "application/json"
497
- _json = None
498
- _content = None
499
- if isinstance(account_name, (IOBase, bytes)):
500
- _content = account_name
501
- else:
502
- _json = self._serialize.body(account_name, "StorageAccountCheckNameAvailabilityParameters")
503
-
504
- _request = build_check_name_availability_request(
505
- subscription_id=self._config.subscription_id,
506
- api_version=api_version,
507
- content_type=content_type,
508
- json=_json,
509
- content=_content,
510
- headers=_headers,
511
- params=_params,
512
- )
513
- _request.url = self._client.format_url(_request.url)
514
-
515
- _stream = False
516
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
517
- _request, stream=_stream, **kwargs
518
- )
519
-
520
- response = pipeline_response.http_response
521
-
522
- if response.status_code not in [200]:
523
- map_error(status_code=response.status_code, response=response, error_map=error_map)
524
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
525
-
526
- deserialized = self._deserialize("CheckNameAvailabilityResult", pipeline_response.http_response)
527
-
528
- if cls:
529
- return cls(pipeline_response, deserialized, {}) # type: ignore
530
-
531
- return deserialized # type: ignore
532
-
533
- def _create_initial(
534
- self,
535
- resource_group_name: str,
536
- account_name: str,
537
- parameters: Union[_models.StorageAccountCreateParameters, IO[bytes]],
538
- **kwargs: Any
539
- ) -> Iterator[bytes]:
540
- error_map: MutableMapping = {
541
- 401: ClientAuthenticationError,
542
- 404: ResourceNotFoundError,
543
- 409: ResourceExistsError,
544
- 304: ResourceNotModifiedError,
545
- }
546
- error_map.update(kwargs.pop("error_map", {}) or {})
547
-
548
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
549
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
550
-
551
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-10-01"))
552
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
553
- cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
554
-
555
- content_type = content_type or "application/json"
556
- _json = None
557
- _content = None
558
- if isinstance(parameters, (IOBase, bytes)):
559
- _content = parameters
560
- else:
561
- _json = self._serialize.body(parameters, "StorageAccountCreateParameters")
562
-
563
- _request = build_create_request(
564
- resource_group_name=resource_group_name,
565
- account_name=account_name,
566
- subscription_id=self._config.subscription_id,
567
- api_version=api_version,
568
- content_type=content_type,
569
- json=_json,
570
- content=_content,
571
- headers=_headers,
572
- params=_params,
573
- )
574
- _request.url = self._client.format_url(_request.url)
575
-
576
- _decompress = kwargs.pop("decompress", True)
577
- _stream = True
578
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
579
- _request, stream=_stream, **kwargs
580
- )
581
-
582
- response = pipeline_response.http_response
583
-
584
- if response.status_code not in [200, 202]:
585
- try:
586
- response.read() # Load the body in memory and close the socket
587
- except (StreamConsumedError, StreamClosedError):
588
- pass
589
- map_error(status_code=response.status_code, response=response, error_map=error_map)
590
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
591
-
592
- deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
593
-
594
- if cls:
595
- return cls(pipeline_response, deserialized, {}) # type: ignore
596
-
597
- return deserialized # type: ignore
598
-
599
- @overload
600
- def begin_create(
601
- self,
602
- resource_group_name: str,
603
- account_name: str,
604
- parameters: _models.StorageAccountCreateParameters,
605
- *,
606
- content_type: str = "application/json",
607
- **kwargs: Any
608
- ) -> LROPoller[_models.StorageAccount]:
609
- """Asynchronously creates a new storage account with the specified parameters. If an account is
610
- already created and a subsequent create request is issued with different properties, the
611
- account properties will be updated. If an account is already created and a subsequent create or
612
- update request is issued with the exact same set of properties, the request will succeed.
613
-
614
- :param resource_group_name: The name of the resource group within the user's subscription. The
615
- name is case insensitive. Required.
616
- :type resource_group_name: str
617
- :param account_name: The name of the storage account within the specified resource group.
618
- Storage account names must be between 3 and 24 characters in length and use numbers and
619
- lower-case letters only. Required.
620
- :type account_name: str
621
- :param parameters: The parameters to provide for the created account. Required.
622
- :type parameters: ~azure.mgmt.storage.v2017_10_01.models.StorageAccountCreateParameters
623
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
624
- Default value is "application/json".
625
- :paramtype content_type: str
626
- :return: An instance of LROPoller that returns either StorageAccount or the result of
627
- cls(response)
628
- :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.storage.v2017_10_01.models.StorageAccount]
629
- :raises ~azure.core.exceptions.HttpResponseError:
630
- """
631
-
632
- @overload
633
- def begin_create(
634
- self,
635
- resource_group_name: str,
636
- account_name: str,
637
- parameters: IO[bytes],
638
- *,
639
- content_type: str = "application/json",
640
- **kwargs: Any
641
- ) -> LROPoller[_models.StorageAccount]:
642
- """Asynchronously creates a new storage account with the specified parameters. If an account is
643
- already created and a subsequent create request is issued with different properties, the
644
- account properties will be updated. If an account is already created and a subsequent create or
645
- update request is issued with the exact same set of properties, the request will succeed.
646
-
647
- :param resource_group_name: The name of the resource group within the user's subscription. The
648
- name is case insensitive. Required.
649
- :type resource_group_name: str
650
- :param account_name: The name of the storage account within the specified resource group.
651
- Storage account names must be between 3 and 24 characters in length and use numbers and
652
- lower-case letters only. Required.
653
- :type account_name: str
654
- :param parameters: The parameters to provide for the created account. Required.
655
- :type parameters: IO[bytes]
656
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
657
- Default value is "application/json".
658
- :paramtype content_type: str
659
- :return: An instance of LROPoller that returns either StorageAccount or the result of
660
- cls(response)
661
- :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.storage.v2017_10_01.models.StorageAccount]
662
- :raises ~azure.core.exceptions.HttpResponseError:
663
- """
664
-
665
- @distributed_trace
666
- def begin_create(
667
- self,
668
- resource_group_name: str,
669
- account_name: str,
670
- parameters: Union[_models.StorageAccountCreateParameters, IO[bytes]],
671
- **kwargs: Any
672
- ) -> LROPoller[_models.StorageAccount]:
673
- """Asynchronously creates a new storage account with the specified parameters. If an account is
674
- already created and a subsequent create request is issued with different properties, the
675
- account properties will be updated. If an account is already created and a subsequent create or
676
- update request is issued with the exact same set of properties, the request will succeed.
677
-
678
- :param resource_group_name: The name of the resource group within the user's subscription. The
679
- name is case insensitive. Required.
680
- :type resource_group_name: str
681
- :param account_name: The name of the storage account within the specified resource group.
682
- Storage account names must be between 3 and 24 characters in length and use numbers and
683
- lower-case letters only. Required.
684
- :type account_name: str
685
- :param parameters: The parameters to provide for the created account. Is either a
686
- StorageAccountCreateParameters type or a IO[bytes] type. Required.
687
- :type parameters: ~azure.mgmt.storage.v2017_10_01.models.StorageAccountCreateParameters or
688
- IO[bytes]
689
- :return: An instance of LROPoller that returns either StorageAccount or the result of
690
- cls(response)
691
- :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.storage.v2017_10_01.models.StorageAccount]
692
- :raises ~azure.core.exceptions.HttpResponseError:
693
- """
694
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
695
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
696
-
697
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-10-01"))
698
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
699
- cls: ClsType[_models.StorageAccount] = kwargs.pop("cls", None)
700
- polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
701
- lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
702
- cont_token: Optional[str] = kwargs.pop("continuation_token", None)
703
- if cont_token is None:
704
- raw_result = self._create_initial(
705
- resource_group_name=resource_group_name,
706
- account_name=account_name,
707
- parameters=parameters,
708
- api_version=api_version,
709
- content_type=content_type,
710
- cls=lambda x, y, z: x,
711
- headers=_headers,
712
- params=_params,
713
- **kwargs
714
- )
715
- raw_result.http_response.read() # type: ignore
716
- kwargs.pop("error_map", None)
717
-
718
- def get_long_running_output(pipeline_response):
719
- deserialized = self._deserialize("StorageAccount", pipeline_response.http_response)
720
- if cls:
721
- return cls(pipeline_response, deserialized, {}) # type: ignore
722
- return deserialized
723
-
724
- if polling is True:
725
- polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs))
726
- elif polling is False:
727
- polling_method = cast(PollingMethod, NoPolling())
728
- else:
729
- polling_method = polling
730
- if cont_token:
731
- return LROPoller[_models.StorageAccount].from_continuation_token(
732
- polling_method=polling_method,
733
- continuation_token=cont_token,
734
- client=self._client,
735
- deserialization_callback=get_long_running_output,
736
- )
737
- return LROPoller[_models.StorageAccount](
738
- self._client, raw_result, get_long_running_output, polling_method # type: ignore
739
- )
740
-
741
- @distributed_trace
742
- def delete( # pylint: disable=inconsistent-return-statements
743
- self, resource_group_name: str, account_name: str, **kwargs: Any
744
- ) -> None:
745
- """Deletes a storage account in Microsoft Azure.
746
-
747
- :param resource_group_name: The name of the resource group within the user's subscription. The
748
- name is case insensitive. Required.
749
- :type resource_group_name: str
750
- :param account_name: The name of the storage account within the specified resource group.
751
- Storage account names must be between 3 and 24 characters in length and use numbers and
752
- lower-case letters only. Required.
753
- :type account_name: str
754
- :return: None or the result of cls(response)
755
- :rtype: None
756
- :raises ~azure.core.exceptions.HttpResponseError:
757
- """
758
- error_map: MutableMapping = {
759
- 401: ClientAuthenticationError,
760
- 404: ResourceNotFoundError,
761
- 409: ResourceExistsError,
762
- 304: ResourceNotModifiedError,
763
- }
764
- error_map.update(kwargs.pop("error_map", {}) or {})
765
-
766
- _headers = kwargs.pop("headers", {}) or {}
767
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
768
-
769
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-10-01"))
770
- cls: ClsType[None] = kwargs.pop("cls", None)
771
-
772
- _request = build_delete_request(
773
- resource_group_name=resource_group_name,
774
- account_name=account_name,
775
- subscription_id=self._config.subscription_id,
776
- api_version=api_version,
777
- headers=_headers,
778
- params=_params,
779
- )
780
- _request.url = self._client.format_url(_request.url)
781
-
782
- _stream = False
783
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
784
- _request, stream=_stream, **kwargs
785
- )
786
-
787
- response = pipeline_response.http_response
788
-
789
- if response.status_code not in [200, 204]:
790
- map_error(status_code=response.status_code, response=response, error_map=error_map)
791
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
792
-
793
- if cls:
794
- return cls(pipeline_response, None, {}) # type: ignore
795
-
796
- @distributed_trace
797
- def get_properties(self, resource_group_name: str, account_name: str, **kwargs: Any) -> _models.StorageAccount:
798
- """Returns the properties for the specified storage account including but not limited to name, SKU
799
- name, location, and account status. The ListKeys operation should be used to retrieve storage
800
- keys.
801
-
802
- :param resource_group_name: The name of the resource group within the user's subscription. The
803
- name is case insensitive. Required.
804
- :type resource_group_name: str
805
- :param account_name: The name of the storage account within the specified resource group.
806
- Storage account names must be between 3 and 24 characters in length and use numbers and
807
- lower-case letters only. Required.
808
- :type account_name: str
809
- :return: StorageAccount or the result of cls(response)
810
- :rtype: ~azure.mgmt.storage.v2017_10_01.models.StorageAccount
811
- :raises ~azure.core.exceptions.HttpResponseError:
812
- """
813
- error_map: MutableMapping = {
814
- 401: ClientAuthenticationError,
815
- 404: ResourceNotFoundError,
816
- 409: ResourceExistsError,
817
- 304: ResourceNotModifiedError,
818
- }
819
- error_map.update(kwargs.pop("error_map", {}) or {})
820
-
821
- _headers = kwargs.pop("headers", {}) or {}
822
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
823
-
824
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-10-01"))
825
- cls: ClsType[_models.StorageAccount] = kwargs.pop("cls", None)
826
-
827
- _request = build_get_properties_request(
828
- resource_group_name=resource_group_name,
829
- account_name=account_name,
830
- subscription_id=self._config.subscription_id,
831
- api_version=api_version,
832
- headers=_headers,
833
- params=_params,
834
- )
835
- _request.url = self._client.format_url(_request.url)
836
-
837
- _stream = False
838
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
839
- _request, stream=_stream, **kwargs
840
- )
841
-
842
- response = pipeline_response.http_response
843
-
844
- if response.status_code not in [200]:
845
- map_error(status_code=response.status_code, response=response, error_map=error_map)
846
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
847
-
848
- deserialized = self._deserialize("StorageAccount", pipeline_response.http_response)
849
-
850
- if cls:
851
- return cls(pipeline_response, deserialized, {}) # type: ignore
852
-
853
- return deserialized # type: ignore
854
-
855
- @overload
856
- def update(
857
- self,
858
- resource_group_name: str,
859
- account_name: str,
860
- parameters: _models.StorageAccountUpdateParameters,
861
- *,
862
- content_type: str = "application/json",
863
- **kwargs: Any
864
- ) -> _models.StorageAccount:
865
- """The update operation can be used to update the SKU, encryption, access tier, or tags for a
866
- storage account. It can also be used to map the account to a custom domain. Only one custom
867
- domain is supported per storage account; the replacement/change of custom domain is not
868
- supported. In order to replace an old custom domain, the old value must be cleared/unregistered
869
- before a new value can be set. The update of multiple properties is supported. This call does
870
- not change the storage keys for the account. If you want to change the storage account keys,
871
- use the regenerate keys operation. The location and name of the storage account cannot be
872
- changed after creation.
873
-
874
- :param resource_group_name: The name of the resource group within the user's subscription. The
875
- name is case insensitive. Required.
876
- :type resource_group_name: str
877
- :param account_name: The name of the storage account within the specified resource group.
878
- Storage account names must be between 3 and 24 characters in length and use numbers and
879
- lower-case letters only. Required.
880
- :type account_name: str
881
- :param parameters: The parameters to provide for the updated account. Required.
882
- :type parameters: ~azure.mgmt.storage.v2017_10_01.models.StorageAccountUpdateParameters
883
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
884
- Default value is "application/json".
885
- :paramtype content_type: str
886
- :return: StorageAccount or the result of cls(response)
887
- :rtype: ~azure.mgmt.storage.v2017_10_01.models.StorageAccount
888
- :raises ~azure.core.exceptions.HttpResponseError:
889
- """
890
-
891
- @overload
892
- def update(
893
- self,
894
- resource_group_name: str,
895
- account_name: str,
896
- parameters: IO[bytes],
897
- *,
898
- content_type: str = "application/json",
899
- **kwargs: Any
900
- ) -> _models.StorageAccount:
901
- """The update operation can be used to update the SKU, encryption, access tier, or tags for a
902
- storage account. It can also be used to map the account to a custom domain. Only one custom
903
- domain is supported per storage account; the replacement/change of custom domain is not
904
- supported. In order to replace an old custom domain, the old value must be cleared/unregistered
905
- before a new value can be set. The update of multiple properties is supported. This call does
906
- not change the storage keys for the account. If you want to change the storage account keys,
907
- use the regenerate keys operation. The location and name of the storage account cannot be
908
- changed after creation.
909
-
910
- :param resource_group_name: The name of the resource group within the user's subscription. The
911
- name is case insensitive. Required.
912
- :type resource_group_name: str
913
- :param account_name: The name of the storage account within the specified resource group.
914
- Storage account names must be between 3 and 24 characters in length and use numbers and
915
- lower-case letters only. Required.
916
- :type account_name: str
917
- :param parameters: The parameters to provide for the updated account. Required.
918
- :type parameters: IO[bytes]
919
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
920
- Default value is "application/json".
921
- :paramtype content_type: str
922
- :return: StorageAccount or the result of cls(response)
923
- :rtype: ~azure.mgmt.storage.v2017_10_01.models.StorageAccount
924
- :raises ~azure.core.exceptions.HttpResponseError:
925
- """
926
-
927
- @distributed_trace
928
- def update(
929
- self,
930
- resource_group_name: str,
931
- account_name: str,
932
- parameters: Union[_models.StorageAccountUpdateParameters, IO[bytes]],
933
- **kwargs: Any
934
- ) -> _models.StorageAccount:
935
- """The update operation can be used to update the SKU, encryption, access tier, or tags for a
936
- storage account. It can also be used to map the account to a custom domain. Only one custom
937
- domain is supported per storage account; the replacement/change of custom domain is not
938
- supported. In order to replace an old custom domain, the old value must be cleared/unregistered
939
- before a new value can be set. The update of multiple properties is supported. This call does
940
- not change the storage keys for the account. If you want to change the storage account keys,
941
- use the regenerate keys operation. The location and name of the storage account cannot be
942
- changed after creation.
943
-
944
- :param resource_group_name: The name of the resource group within the user's subscription. The
945
- name is case insensitive. Required.
946
- :type resource_group_name: str
947
- :param account_name: The name of the storage account within the specified resource group.
948
- Storage account names must be between 3 and 24 characters in length and use numbers and
949
- lower-case letters only. Required.
950
- :type account_name: str
951
- :param parameters: The parameters to provide for the updated account. Is either a
952
- StorageAccountUpdateParameters type or a IO[bytes] type. Required.
953
- :type parameters: ~azure.mgmt.storage.v2017_10_01.models.StorageAccountUpdateParameters or
954
- IO[bytes]
955
- :return: StorageAccount or the result of cls(response)
956
- :rtype: ~azure.mgmt.storage.v2017_10_01.models.StorageAccount
957
- :raises ~azure.core.exceptions.HttpResponseError:
958
- """
959
- error_map: MutableMapping = {
960
- 401: ClientAuthenticationError,
961
- 404: ResourceNotFoundError,
962
- 409: ResourceExistsError,
963
- 304: ResourceNotModifiedError,
964
- }
965
- error_map.update(kwargs.pop("error_map", {}) or {})
966
-
967
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
968
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
969
-
970
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-10-01"))
971
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
972
- cls: ClsType[_models.StorageAccount] = kwargs.pop("cls", None)
973
-
974
- content_type = content_type or "application/json"
975
- _json = None
976
- _content = None
977
- if isinstance(parameters, (IOBase, bytes)):
978
- _content = parameters
979
- else:
980
- _json = self._serialize.body(parameters, "StorageAccountUpdateParameters")
981
-
982
- _request = build_update_request(
983
- resource_group_name=resource_group_name,
984
- account_name=account_name,
985
- subscription_id=self._config.subscription_id,
986
- api_version=api_version,
987
- content_type=content_type,
988
- json=_json,
989
- content=_content,
990
- headers=_headers,
991
- params=_params,
992
- )
993
- _request.url = self._client.format_url(_request.url)
994
-
995
- _stream = False
996
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
997
- _request, stream=_stream, **kwargs
998
- )
999
-
1000
- response = pipeline_response.http_response
1001
-
1002
- if response.status_code not in [200]:
1003
- map_error(status_code=response.status_code, response=response, error_map=error_map)
1004
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
1005
-
1006
- deserialized = self._deserialize("StorageAccount", pipeline_response.http_response)
1007
-
1008
- if cls:
1009
- return cls(pipeline_response, deserialized, {}) # type: ignore
1010
-
1011
- return deserialized # type: ignore
1012
-
1013
- @distributed_trace
1014
- def list(self, **kwargs: Any) -> Iterable["_models.StorageAccount"]:
1015
- """Lists all the storage accounts available under the subscription. Note that storage keys are not
1016
- returned; use the ListKeys operation for this.
1017
-
1018
- :return: An iterator like instance of either StorageAccount or the result of cls(response)
1019
- :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2017_10_01.models.StorageAccount]
1020
- :raises ~azure.core.exceptions.HttpResponseError:
1021
- """
1022
- _headers = kwargs.pop("headers", {}) or {}
1023
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
1024
-
1025
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-10-01"))
1026
- cls: ClsType[_models.StorageAccountListResult] = kwargs.pop("cls", None)
1027
-
1028
- error_map: MutableMapping = {
1029
- 401: ClientAuthenticationError,
1030
- 404: ResourceNotFoundError,
1031
- 409: ResourceExistsError,
1032
- 304: ResourceNotModifiedError,
1033
- }
1034
- error_map.update(kwargs.pop("error_map", {}) or {})
1035
-
1036
- def prepare_request(next_link=None):
1037
- if not next_link:
1038
-
1039
- _request = build_list_request(
1040
- subscription_id=self._config.subscription_id,
1041
- api_version=api_version,
1042
- headers=_headers,
1043
- params=_params,
1044
- )
1045
- _request.url = self._client.format_url(_request.url)
1046
-
1047
- else:
1048
- # make call to next link with the client's api-version
1049
- _parsed_next_link = urllib.parse.urlparse(next_link)
1050
- _next_request_params = case_insensitive_dict(
1051
- {
1052
- key: [urllib.parse.quote(v) for v in value]
1053
- for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
1054
- }
1055
- )
1056
- _next_request_params["api-version"] = self._api_version
1057
- _request = HttpRequest(
1058
- "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
1059
- )
1060
- _request.url = self._client.format_url(_request.url)
1061
- _request.method = "GET"
1062
- return _request
1063
-
1064
- def extract_data(pipeline_response):
1065
- deserialized = self._deserialize("StorageAccountListResult", pipeline_response)
1066
- list_of_elem = deserialized.value
1067
- if cls:
1068
- list_of_elem = cls(list_of_elem) # type: ignore
1069
- return None, iter(list_of_elem)
1070
-
1071
- def get_next(next_link=None):
1072
- _request = prepare_request(next_link)
1073
-
1074
- _stream = False
1075
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
1076
- _request, stream=_stream, **kwargs
1077
- )
1078
- response = pipeline_response.http_response
1079
-
1080
- if response.status_code not in [200]:
1081
- map_error(status_code=response.status_code, response=response, error_map=error_map)
1082
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
1083
-
1084
- return pipeline_response
1085
-
1086
- return ItemPaged(get_next, extract_data)
1087
-
1088
- @distributed_trace
1089
- def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.StorageAccount"]:
1090
- """Lists all the storage accounts available under the given resource group. Note that storage keys
1091
- are not returned; use the ListKeys operation for this.
1092
-
1093
- :param resource_group_name: The name of the resource group within the user's subscription. The
1094
- name is case insensitive. Required.
1095
- :type resource_group_name: str
1096
- :return: An iterator like instance of either StorageAccount or the result of cls(response)
1097
- :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2017_10_01.models.StorageAccount]
1098
- :raises ~azure.core.exceptions.HttpResponseError:
1099
- """
1100
- _headers = kwargs.pop("headers", {}) or {}
1101
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
1102
-
1103
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-10-01"))
1104
- cls: ClsType[_models.StorageAccountListResult] = kwargs.pop("cls", None)
1105
-
1106
- error_map: MutableMapping = {
1107
- 401: ClientAuthenticationError,
1108
- 404: ResourceNotFoundError,
1109
- 409: ResourceExistsError,
1110
- 304: ResourceNotModifiedError,
1111
- }
1112
- error_map.update(kwargs.pop("error_map", {}) or {})
1113
-
1114
- def prepare_request(next_link=None):
1115
- if not next_link:
1116
-
1117
- _request = build_list_by_resource_group_request(
1118
- resource_group_name=resource_group_name,
1119
- subscription_id=self._config.subscription_id,
1120
- api_version=api_version,
1121
- headers=_headers,
1122
- params=_params,
1123
- )
1124
- _request.url = self._client.format_url(_request.url)
1125
-
1126
- else:
1127
- # make call to next link with the client's api-version
1128
- _parsed_next_link = urllib.parse.urlparse(next_link)
1129
- _next_request_params = case_insensitive_dict(
1130
- {
1131
- key: [urllib.parse.quote(v) for v in value]
1132
- for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
1133
- }
1134
- )
1135
- _next_request_params["api-version"] = self._api_version
1136
- _request = HttpRequest(
1137
- "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
1138
- )
1139
- _request.url = self._client.format_url(_request.url)
1140
- _request.method = "GET"
1141
- return _request
1142
-
1143
- def extract_data(pipeline_response):
1144
- deserialized = self._deserialize("StorageAccountListResult", pipeline_response)
1145
- list_of_elem = deserialized.value
1146
- if cls:
1147
- list_of_elem = cls(list_of_elem) # type: ignore
1148
- return None, iter(list_of_elem)
1149
-
1150
- def get_next(next_link=None):
1151
- _request = prepare_request(next_link)
1152
-
1153
- _stream = False
1154
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
1155
- _request, stream=_stream, **kwargs
1156
- )
1157
- response = pipeline_response.http_response
1158
-
1159
- if response.status_code not in [200]:
1160
- map_error(status_code=response.status_code, response=response, error_map=error_map)
1161
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
1162
-
1163
- return pipeline_response
1164
-
1165
- return ItemPaged(get_next, extract_data)
1166
-
1167
- @distributed_trace
1168
- def list_keys(
1169
- self, resource_group_name: str, account_name: str, **kwargs: Any
1170
- ) -> _models.StorageAccountListKeysResult:
1171
- """Lists the access keys for the specified storage account.
1172
-
1173
- :param resource_group_name: The name of the resource group within the user's subscription. The
1174
- name is case insensitive. Required.
1175
- :type resource_group_name: str
1176
- :param account_name: The name of the storage account within the specified resource group.
1177
- Storage account names must be between 3 and 24 characters in length and use numbers and
1178
- lower-case letters only. Required.
1179
- :type account_name: str
1180
- :return: StorageAccountListKeysResult or the result of cls(response)
1181
- :rtype: ~azure.mgmt.storage.v2017_10_01.models.StorageAccountListKeysResult
1182
- :raises ~azure.core.exceptions.HttpResponseError:
1183
- """
1184
- error_map: MutableMapping = {
1185
- 401: ClientAuthenticationError,
1186
- 404: ResourceNotFoundError,
1187
- 409: ResourceExistsError,
1188
- 304: ResourceNotModifiedError,
1189
- }
1190
- error_map.update(kwargs.pop("error_map", {}) or {})
1191
-
1192
- _headers = kwargs.pop("headers", {}) or {}
1193
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
1194
-
1195
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-10-01"))
1196
- cls: ClsType[_models.StorageAccountListKeysResult] = kwargs.pop("cls", None)
1197
-
1198
- _request = build_list_keys_request(
1199
- resource_group_name=resource_group_name,
1200
- account_name=account_name,
1201
- subscription_id=self._config.subscription_id,
1202
- api_version=api_version,
1203
- headers=_headers,
1204
- params=_params,
1205
- )
1206
- _request.url = self._client.format_url(_request.url)
1207
-
1208
- _stream = False
1209
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
1210
- _request, stream=_stream, **kwargs
1211
- )
1212
-
1213
- response = pipeline_response.http_response
1214
-
1215
- if response.status_code not in [200]:
1216
- map_error(status_code=response.status_code, response=response, error_map=error_map)
1217
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
1218
-
1219
- deserialized = self._deserialize("StorageAccountListKeysResult", pipeline_response.http_response)
1220
-
1221
- if cls:
1222
- return cls(pipeline_response, deserialized, {}) # type: ignore
1223
-
1224
- return deserialized # type: ignore
1225
-
1226
- @overload
1227
- def regenerate_key(
1228
- self,
1229
- resource_group_name: str,
1230
- account_name: str,
1231
- regenerate_key: _models.StorageAccountRegenerateKeyParameters,
1232
- *,
1233
- content_type: str = "application/json",
1234
- **kwargs: Any
1235
- ) -> _models.StorageAccountListKeysResult:
1236
- """Regenerates one of the access keys for the specified storage account.
1237
-
1238
- :param resource_group_name: The name of the resource group within the user's subscription. The
1239
- name is case insensitive. Required.
1240
- :type resource_group_name: str
1241
- :param account_name: The name of the storage account within the specified resource group.
1242
- Storage account names must be between 3 and 24 characters in length and use numbers and
1243
- lower-case letters only. Required.
1244
- :type account_name: str
1245
- :param regenerate_key: Specifies name of the key which should be regenerated -- key1 or key2.
1246
- Required.
1247
- :type regenerate_key:
1248
- ~azure.mgmt.storage.v2017_10_01.models.StorageAccountRegenerateKeyParameters
1249
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
1250
- Default value is "application/json".
1251
- :paramtype content_type: str
1252
- :return: StorageAccountListKeysResult or the result of cls(response)
1253
- :rtype: ~azure.mgmt.storage.v2017_10_01.models.StorageAccountListKeysResult
1254
- :raises ~azure.core.exceptions.HttpResponseError:
1255
- """
1256
-
1257
- @overload
1258
- def regenerate_key(
1259
- self,
1260
- resource_group_name: str,
1261
- account_name: str,
1262
- regenerate_key: IO[bytes],
1263
- *,
1264
- content_type: str = "application/json",
1265
- **kwargs: Any
1266
- ) -> _models.StorageAccountListKeysResult:
1267
- """Regenerates one of the access keys for the specified storage account.
1268
-
1269
- :param resource_group_name: The name of the resource group within the user's subscription. The
1270
- name is case insensitive. Required.
1271
- :type resource_group_name: str
1272
- :param account_name: The name of the storage account within the specified resource group.
1273
- Storage account names must be between 3 and 24 characters in length and use numbers and
1274
- lower-case letters only. Required.
1275
- :type account_name: str
1276
- :param regenerate_key: Specifies name of the key which should be regenerated -- key1 or key2.
1277
- Required.
1278
- :type regenerate_key: IO[bytes]
1279
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
1280
- Default value is "application/json".
1281
- :paramtype content_type: str
1282
- :return: StorageAccountListKeysResult or the result of cls(response)
1283
- :rtype: ~azure.mgmt.storage.v2017_10_01.models.StorageAccountListKeysResult
1284
- :raises ~azure.core.exceptions.HttpResponseError:
1285
- """
1286
-
1287
- @distributed_trace
1288
- def regenerate_key(
1289
- self,
1290
- resource_group_name: str,
1291
- account_name: str,
1292
- regenerate_key: Union[_models.StorageAccountRegenerateKeyParameters, IO[bytes]],
1293
- **kwargs: Any
1294
- ) -> _models.StorageAccountListKeysResult:
1295
- """Regenerates one of the access keys for the specified storage account.
1296
-
1297
- :param resource_group_name: The name of the resource group within the user's subscription. The
1298
- name is case insensitive. Required.
1299
- :type resource_group_name: str
1300
- :param account_name: The name of the storage account within the specified resource group.
1301
- Storage account names must be between 3 and 24 characters in length and use numbers and
1302
- lower-case letters only. Required.
1303
- :type account_name: str
1304
- :param regenerate_key: Specifies name of the key which should be regenerated -- key1 or key2.
1305
- Is either a StorageAccountRegenerateKeyParameters type or a IO[bytes] type. Required.
1306
- :type regenerate_key:
1307
- ~azure.mgmt.storage.v2017_10_01.models.StorageAccountRegenerateKeyParameters or IO[bytes]
1308
- :return: StorageAccountListKeysResult or the result of cls(response)
1309
- :rtype: ~azure.mgmt.storage.v2017_10_01.models.StorageAccountListKeysResult
1310
- :raises ~azure.core.exceptions.HttpResponseError:
1311
- """
1312
- error_map: MutableMapping = {
1313
- 401: ClientAuthenticationError,
1314
- 404: ResourceNotFoundError,
1315
- 409: ResourceExistsError,
1316
- 304: ResourceNotModifiedError,
1317
- }
1318
- error_map.update(kwargs.pop("error_map", {}) or {})
1319
-
1320
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
1321
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
1322
-
1323
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-10-01"))
1324
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
1325
- cls: ClsType[_models.StorageAccountListKeysResult] = kwargs.pop("cls", None)
1326
-
1327
- content_type = content_type or "application/json"
1328
- _json = None
1329
- _content = None
1330
- if isinstance(regenerate_key, (IOBase, bytes)):
1331
- _content = regenerate_key
1332
- else:
1333
- _json = self._serialize.body(regenerate_key, "StorageAccountRegenerateKeyParameters")
1334
-
1335
- _request = build_regenerate_key_request(
1336
- resource_group_name=resource_group_name,
1337
- account_name=account_name,
1338
- subscription_id=self._config.subscription_id,
1339
- api_version=api_version,
1340
- content_type=content_type,
1341
- json=_json,
1342
- content=_content,
1343
- headers=_headers,
1344
- params=_params,
1345
- )
1346
- _request.url = self._client.format_url(_request.url)
1347
-
1348
- _stream = False
1349
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
1350
- _request, stream=_stream, **kwargs
1351
- )
1352
-
1353
- response = pipeline_response.http_response
1354
-
1355
- if response.status_code not in [200]:
1356
- map_error(status_code=response.status_code, response=response, error_map=error_map)
1357
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
1358
-
1359
- deserialized = self._deserialize("StorageAccountListKeysResult", pipeline_response.http_response)
1360
-
1361
- if cls:
1362
- return cls(pipeline_response, deserialized, {}) # type: ignore
1363
-
1364
- return deserialized # type: ignore
1365
-
1366
- @overload
1367
- def list_account_sas(
1368
- self,
1369
- resource_group_name: str,
1370
- account_name: str,
1371
- parameters: _models.AccountSasParameters,
1372
- *,
1373
- content_type: str = "application/json",
1374
- **kwargs: Any
1375
- ) -> _models.ListAccountSasResponse:
1376
- """List SAS credentials of a storage account.
1377
-
1378
- :param resource_group_name: The name of the resource group within the user's subscription. The
1379
- name is case insensitive. Required.
1380
- :type resource_group_name: str
1381
- :param account_name: The name of the storage account within the specified resource group.
1382
- Storage account names must be between 3 and 24 characters in length and use numbers and
1383
- lower-case letters only. Required.
1384
- :type account_name: str
1385
- :param parameters: The parameters to provide to list SAS credentials for the storage account.
1386
- Required.
1387
- :type parameters: ~azure.mgmt.storage.v2017_10_01.models.AccountSasParameters
1388
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
1389
- Default value is "application/json".
1390
- :paramtype content_type: str
1391
- :return: ListAccountSasResponse or the result of cls(response)
1392
- :rtype: ~azure.mgmt.storage.v2017_10_01.models.ListAccountSasResponse
1393
- :raises ~azure.core.exceptions.HttpResponseError:
1394
- """
1395
-
1396
- @overload
1397
- def list_account_sas(
1398
- self,
1399
- resource_group_name: str,
1400
- account_name: str,
1401
- parameters: IO[bytes],
1402
- *,
1403
- content_type: str = "application/json",
1404
- **kwargs: Any
1405
- ) -> _models.ListAccountSasResponse:
1406
- """List SAS credentials of a storage account.
1407
-
1408
- :param resource_group_name: The name of the resource group within the user's subscription. The
1409
- name is case insensitive. Required.
1410
- :type resource_group_name: str
1411
- :param account_name: The name of the storage account within the specified resource group.
1412
- Storage account names must be between 3 and 24 characters in length and use numbers and
1413
- lower-case letters only. Required.
1414
- :type account_name: str
1415
- :param parameters: The parameters to provide to list SAS credentials for the storage account.
1416
- Required.
1417
- :type parameters: IO[bytes]
1418
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
1419
- Default value is "application/json".
1420
- :paramtype content_type: str
1421
- :return: ListAccountSasResponse or the result of cls(response)
1422
- :rtype: ~azure.mgmt.storage.v2017_10_01.models.ListAccountSasResponse
1423
- :raises ~azure.core.exceptions.HttpResponseError:
1424
- """
1425
-
1426
- @distributed_trace
1427
- def list_account_sas(
1428
- self,
1429
- resource_group_name: str,
1430
- account_name: str,
1431
- parameters: Union[_models.AccountSasParameters, IO[bytes]],
1432
- **kwargs: Any
1433
- ) -> _models.ListAccountSasResponse:
1434
- """List SAS credentials of a storage account.
1435
-
1436
- :param resource_group_name: The name of the resource group within the user's subscription. The
1437
- name is case insensitive. Required.
1438
- :type resource_group_name: str
1439
- :param account_name: The name of the storage account within the specified resource group.
1440
- Storage account names must be between 3 and 24 characters in length and use numbers and
1441
- lower-case letters only. Required.
1442
- :type account_name: str
1443
- :param parameters: The parameters to provide to list SAS credentials for the storage account.
1444
- Is either a AccountSasParameters type or a IO[bytes] type. Required.
1445
- :type parameters: ~azure.mgmt.storage.v2017_10_01.models.AccountSasParameters or IO[bytes]
1446
- :return: ListAccountSasResponse or the result of cls(response)
1447
- :rtype: ~azure.mgmt.storage.v2017_10_01.models.ListAccountSasResponse
1448
- :raises ~azure.core.exceptions.HttpResponseError:
1449
- """
1450
- error_map: MutableMapping = {
1451
- 401: ClientAuthenticationError,
1452
- 404: ResourceNotFoundError,
1453
- 409: ResourceExistsError,
1454
- 304: ResourceNotModifiedError,
1455
- }
1456
- error_map.update(kwargs.pop("error_map", {}) or {})
1457
-
1458
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
1459
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
1460
-
1461
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-10-01"))
1462
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
1463
- cls: ClsType[_models.ListAccountSasResponse] = kwargs.pop("cls", None)
1464
-
1465
- content_type = content_type or "application/json"
1466
- _json = None
1467
- _content = None
1468
- if isinstance(parameters, (IOBase, bytes)):
1469
- _content = parameters
1470
- else:
1471
- _json = self._serialize.body(parameters, "AccountSasParameters")
1472
-
1473
- _request = build_list_account_sas_request(
1474
- resource_group_name=resource_group_name,
1475
- account_name=account_name,
1476
- subscription_id=self._config.subscription_id,
1477
- api_version=api_version,
1478
- content_type=content_type,
1479
- json=_json,
1480
- content=_content,
1481
- headers=_headers,
1482
- params=_params,
1483
- )
1484
- _request.url = self._client.format_url(_request.url)
1485
-
1486
- _stream = False
1487
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
1488
- _request, stream=_stream, **kwargs
1489
- )
1490
-
1491
- response = pipeline_response.http_response
1492
-
1493
- if response.status_code not in [200]:
1494
- map_error(status_code=response.status_code, response=response, error_map=error_map)
1495
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
1496
-
1497
- deserialized = self._deserialize("ListAccountSasResponse", pipeline_response.http_response)
1498
-
1499
- if cls:
1500
- return cls(pipeline_response, deserialized, {}) # type: ignore
1501
-
1502
- return deserialized # type: ignore
1503
-
1504
- @overload
1505
- def list_service_sas(
1506
- self,
1507
- resource_group_name: str,
1508
- account_name: str,
1509
- parameters: _models.ServiceSasParameters,
1510
- *,
1511
- content_type: str = "application/json",
1512
- **kwargs: Any
1513
- ) -> _models.ListServiceSasResponse:
1514
- """List service SAS credentials of a specific resource.
1515
-
1516
- :param resource_group_name: The name of the resource group within the user's subscription. The
1517
- name is case insensitive. Required.
1518
- :type resource_group_name: str
1519
- :param account_name: The name of the storage account within the specified resource group.
1520
- Storage account names must be between 3 and 24 characters in length and use numbers and
1521
- lower-case letters only. Required.
1522
- :type account_name: str
1523
- :param parameters: The parameters to provide to list service SAS credentials. Required.
1524
- :type parameters: ~azure.mgmt.storage.v2017_10_01.models.ServiceSasParameters
1525
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
1526
- Default value is "application/json".
1527
- :paramtype content_type: str
1528
- :return: ListServiceSasResponse or the result of cls(response)
1529
- :rtype: ~azure.mgmt.storage.v2017_10_01.models.ListServiceSasResponse
1530
- :raises ~azure.core.exceptions.HttpResponseError:
1531
- """
1532
-
1533
- @overload
1534
- def list_service_sas(
1535
- self,
1536
- resource_group_name: str,
1537
- account_name: str,
1538
- parameters: IO[bytes],
1539
- *,
1540
- content_type: str = "application/json",
1541
- **kwargs: Any
1542
- ) -> _models.ListServiceSasResponse:
1543
- """List service SAS credentials of a specific resource.
1544
-
1545
- :param resource_group_name: The name of the resource group within the user's subscription. The
1546
- name is case insensitive. Required.
1547
- :type resource_group_name: str
1548
- :param account_name: The name of the storage account within the specified resource group.
1549
- Storage account names must be between 3 and 24 characters in length and use numbers and
1550
- lower-case letters only. Required.
1551
- :type account_name: str
1552
- :param parameters: The parameters to provide to list service SAS credentials. Required.
1553
- :type parameters: IO[bytes]
1554
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
1555
- Default value is "application/json".
1556
- :paramtype content_type: str
1557
- :return: ListServiceSasResponse or the result of cls(response)
1558
- :rtype: ~azure.mgmt.storage.v2017_10_01.models.ListServiceSasResponse
1559
- :raises ~azure.core.exceptions.HttpResponseError:
1560
- """
1561
-
1562
- @distributed_trace
1563
- def list_service_sas(
1564
- self,
1565
- resource_group_name: str,
1566
- account_name: str,
1567
- parameters: Union[_models.ServiceSasParameters, IO[bytes]],
1568
- **kwargs: Any
1569
- ) -> _models.ListServiceSasResponse:
1570
- """List service SAS credentials of a specific resource.
1571
-
1572
- :param resource_group_name: The name of the resource group within the user's subscription. The
1573
- name is case insensitive. Required.
1574
- :type resource_group_name: str
1575
- :param account_name: The name of the storage account within the specified resource group.
1576
- Storage account names must be between 3 and 24 characters in length and use numbers and
1577
- lower-case letters only. Required.
1578
- :type account_name: str
1579
- :param parameters: The parameters to provide to list service SAS credentials. Is either a
1580
- ServiceSasParameters type or a IO[bytes] type. Required.
1581
- :type parameters: ~azure.mgmt.storage.v2017_10_01.models.ServiceSasParameters or IO[bytes]
1582
- :return: ListServiceSasResponse or the result of cls(response)
1583
- :rtype: ~azure.mgmt.storage.v2017_10_01.models.ListServiceSasResponse
1584
- :raises ~azure.core.exceptions.HttpResponseError:
1585
- """
1586
- error_map: MutableMapping = {
1587
- 401: ClientAuthenticationError,
1588
- 404: ResourceNotFoundError,
1589
- 409: ResourceExistsError,
1590
- 304: ResourceNotModifiedError,
1591
- }
1592
- error_map.update(kwargs.pop("error_map", {}) or {})
1593
-
1594
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
1595
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
1596
-
1597
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-10-01"))
1598
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
1599
- cls: ClsType[_models.ListServiceSasResponse] = kwargs.pop("cls", None)
1600
-
1601
- content_type = content_type or "application/json"
1602
- _json = None
1603
- _content = None
1604
- if isinstance(parameters, (IOBase, bytes)):
1605
- _content = parameters
1606
- else:
1607
- _json = self._serialize.body(parameters, "ServiceSasParameters")
1608
-
1609
- _request = build_list_service_sas_request(
1610
- resource_group_name=resource_group_name,
1611
- account_name=account_name,
1612
- subscription_id=self._config.subscription_id,
1613
- api_version=api_version,
1614
- content_type=content_type,
1615
- json=_json,
1616
- content=_content,
1617
- headers=_headers,
1618
- params=_params,
1619
- )
1620
- _request.url = self._client.format_url(_request.url)
1621
-
1622
- _stream = False
1623
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
1624
- _request, stream=_stream, **kwargs
1625
- )
1626
-
1627
- response = pipeline_response.http_response
1628
-
1629
- if response.status_code not in [200]:
1630
- map_error(status_code=response.status_code, response=response, error_map=error_map)
1631
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
1632
-
1633
- deserialized = self._deserialize("ListServiceSasResponse", pipeline_response.http_response)
1634
-
1635
- if cls:
1636
- return cls(pipeline_response, deserialized, {}) # type: ignore
1637
-
1638
- return deserialized # type: ignore