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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) hide show
  1. azure/mgmt/storage/__init__.py +19 -7
  2. azure/mgmt/storage/_configuration.py +27 -29
  3. azure/mgmt/storage/{v2016_01_01/models/_patch.py → _patch.py} +5 -4
  4. azure/mgmt/storage/_storage_management_client.py +184 -499
  5. azure/mgmt/storage/{v2016_01_01/_version.py → _utils/__init__.py} +0 -3
  6. azure/mgmt/storage/{_serialization.py → _utils/serialization.py} +46 -131
  7. azure/mgmt/storage/_version.py +1 -1
  8. azure/mgmt/storage/aio/__init__.py +21 -2
  9. azure/mgmt/storage/aio/_configuration.py +27 -29
  10. azure/mgmt/storage/{v2017_10_01/aio/operations → aio}/_patch.py +5 -4
  11. azure/mgmt/storage/aio/_storage_management_client.py +188 -497
  12. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/__init__.py +1 -0
  13. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_blob_containers_operations.py +66 -69
  14. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_blob_inventory_policies_operations.py +26 -34
  15. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_blob_services_operations.py +20 -22
  16. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_deleted_accounts_operations.py +14 -17
  17. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_encryption_scopes_operations.py +27 -30
  18. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_file_services_operations.py +24 -27
  19. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_file_shares_operations.py +36 -39
  20. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_local_users_operations.py +26 -29
  21. azure/mgmt/storage/{v2019_06_01/aio → aio}/operations/_management_policies_operations.py +23 -30
  22. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_network_security_perimeter_configurations_operations.py +16 -19
  23. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_object_replication_policies_operations.py +21 -23
  24. azure/mgmt/storage/{v2017_10_01/aio → aio}/operations/_operations.py +12 -15
  25. azure/mgmt/storage/{v2016_01_01/aio → aio}/operations/_patch.py +5 -4
  26. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_private_endpoint_connections_operations.py +21 -23
  27. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_private_link_resources_operations.py +11 -13
  28. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_queue_operations.py +27 -30
  29. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_queue_services_operations.py +19 -21
  30. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_skus_operations.py +12 -15
  31. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_storage_accounts_operations.py +81 -96
  32. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_storage_task_assignment_instances_report_operations.py +14 -16
  33. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_storage_task_assignments_instances_report_operations.py +14 -16
  34. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_storage_task_assignments_operations.py +30 -39
  35. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_table_operations.py +27 -29
  36. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_table_services_operations.py +19 -21
  37. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_usages_operations.py +12 -14
  38. azure/mgmt/storage/{v2024_01_01/models → models}/_models_py3.py +870 -927
  39. azure/mgmt/storage/{v2016_01_01/operations → models}/_patch.py +5 -4
  40. azure/mgmt/storage/{v2024_01_01/models → models}/_storage_management_client_enums.py +1 -0
  41. azure/mgmt/storage/{v2024_01_01/operations → operations}/__init__.py +1 -0
  42. azure/mgmt/storage/{v2024_01_01/operations → operations}/_blob_containers_operations.py +81 -84
  43. azure/mgmt/storage/{v2024_01_01/operations → operations}/_blob_inventory_policies_operations.py +31 -39
  44. azure/mgmt/storage/{v2024_01_01/operations → operations}/_blob_services_operations.py +24 -27
  45. azure/mgmt/storage/{v2024_01_01/operations → operations}/_deleted_accounts_operations.py +16 -18
  46. azure/mgmt/storage/{v2024_01_01/operations → operations}/_encryption_scopes_operations.py +32 -34
  47. azure/mgmt/storage/{v2024_01_01/operations → operations}/_file_services_operations.py +30 -32
  48. azure/mgmt/storage/{v2024_01_01/operations → operations}/_file_shares_operations.py +44 -47
  49. azure/mgmt/storage/{v2024_01_01/operations → operations}/_local_users_operations.py +33 -35
  50. azure/mgmt/storage/{v2024_01_01/operations → operations}/_management_policies_operations.py +27 -34
  51. azure/mgmt/storage/{v2024_01_01/operations → operations}/_network_security_perimeter_configurations_operations.py +20 -22
  52. azure/mgmt/storage/{v2024_01_01/operations → operations}/_object_replication_policies_operations.py +26 -29
  53. azure/mgmt/storage/{v2024_01_01/operations → operations}/_operations.py +12 -15
  54. azure/mgmt/storage/operations/_patch.py +21 -0
  55. azure/mgmt/storage/{v2024_01_01/operations → operations}/_private_endpoint_connections_operations.py +26 -29
  56. azure/mgmt/storage/{v2024_01_01/operations → operations}/_private_link_resources_operations.py +13 -15
  57. azure/mgmt/storage/{v2024_01_01/operations → operations}/_queue_operations.py +33 -35
  58. azure/mgmt/storage/{v2024_01_01/operations → operations}/_queue_services_operations.py +23 -25
  59. azure/mgmt/storage/{v2024_01_01/operations → operations}/_skus_operations.py +12 -15
  60. azure/mgmt/storage/{v2024_01_01/operations → operations}/_storage_accounts_operations.py +98 -106
  61. azure/mgmt/storage/{v2024_01_01/operations → operations}/_storage_task_assignment_instances_report_operations.py +15 -19
  62. azure/mgmt/storage/{v2024_01_01/operations → operations}/_storage_task_assignments_instances_report_operations.py +15 -19
  63. azure/mgmt/storage/{v2024_01_01/operations → operations}/_storage_task_assignments_operations.py +36 -47
  64. azure/mgmt/storage/{v2024_01_01/operations → operations}/_table_operations.py +33 -35
  65. azure/mgmt/storage/{v2024_01_01/operations → operations}/_table_services_operations.py +23 -25
  66. azure/mgmt/storage/{v2024_01_01/operations → operations}/_usages_operations.py +13 -16
  67. {azure_mgmt_storage-22.1.1.dist-info → azure_mgmt_storage-23.0.0.dist-info}/METADATA +20 -10
  68. azure_mgmt_storage-23.0.0.dist-info/RECORD +73 -0
  69. {azure_mgmt_storage-22.1.1.dist-info → azure_mgmt_storage-23.0.0.dist-info}/WHEEL +1 -1
  70. azure/mgmt/storage/models.py +0 -8
  71. azure/mgmt/storage/v2016_01_01/__init__.py +0 -32
  72. azure/mgmt/storage/v2016_01_01/_configuration.py +0 -65
  73. azure/mgmt/storage/v2016_01_01/_patch.py +0 -32
  74. azure/mgmt/storage/v2016_01_01/_storage_management_client.py +0 -117
  75. azure/mgmt/storage/v2016_01_01/aio/__init__.py +0 -29
  76. azure/mgmt/storage/v2016_01_01/aio/_configuration.py +0 -65
  77. azure/mgmt/storage/v2016_01_01/aio/_patch.py +0 -32
  78. azure/mgmt/storage/v2016_01_01/aio/_storage_management_client.py +0 -120
  79. azure/mgmt/storage/v2016_01_01/aio/operations/__init__.py +0 -27
  80. azure/mgmt/storage/v2016_01_01/aio/operations/_storage_accounts_operations.py +0 -1023
  81. azure/mgmt/storage/v2016_01_01/aio/operations/_usage_operations.py +0 -130
  82. azure/mgmt/storage/v2016_01_01/models/__init__.py +0 -88
  83. azure/mgmt/storage/v2016_01_01/models/_models_py3.py +0 -829
  84. azure/mgmt/storage/v2016_01_01/models/_storage_management_client_enums.py +0 -99
  85. azure/mgmt/storage/v2016_01_01/operations/__init__.py +0 -27
  86. azure/mgmt/storage/v2016_01_01/operations/_storage_accounts_operations.py +0 -1278
  87. azure/mgmt/storage/v2016_01_01/operations/_usage_operations.py +0 -157
  88. azure/mgmt/storage/v2016_01_01/py.typed +0 -1
  89. azure/mgmt/storage/v2017_10_01/__init__.py +0 -32
  90. azure/mgmt/storage/v2017_10_01/_configuration.py +0 -65
  91. azure/mgmt/storage/v2017_10_01/_patch.py +0 -32
  92. azure/mgmt/storage/v2017_10_01/_storage_management.py +0 -121
  93. azure/mgmt/storage/v2017_10_01/_version.py +0 -9
  94. azure/mgmt/storage/v2017_10_01/aio/__init__.py +0 -29
  95. azure/mgmt/storage/v2017_10_01/aio/_configuration.py +0 -65
  96. azure/mgmt/storage/v2017_10_01/aio/_patch.py +0 -32
  97. azure/mgmt/storage/v2017_10_01/aio/_storage_management.py +0 -124
  98. azure/mgmt/storage/v2017_10_01/aio/operations/__init__.py +0 -31
  99. azure/mgmt/storage/v2017_10_01/aio/operations/_skus_operations.py +0 -130
  100. azure/mgmt/storage/v2017_10_01/aio/operations/_storage_accounts_operations.py +0 -1299
  101. azure/mgmt/storage/v2017_10_01/aio/operations/_usage_operations.py +0 -130
  102. azure/mgmt/storage/v2017_10_01/models/__init__.py +0 -140
  103. azure/mgmt/storage/v2017_10_01/models/_models_py3.py +0 -1851
  104. azure/mgmt/storage/v2017_10_01/models/_patch.py +0 -20
  105. azure/mgmt/storage/v2017_10_01/models/_storage_management_enums.py +0 -192
  106. azure/mgmt/storage/v2017_10_01/operations/__init__.py +0 -31
  107. azure/mgmt/storage/v2017_10_01/operations/_operations.py +0 -151
  108. azure/mgmt/storage/v2017_10_01/operations/_patch.py +0 -20
  109. azure/mgmt/storage/v2017_10_01/operations/_skus_operations.py +0 -157
  110. azure/mgmt/storage/v2017_10_01/operations/_storage_accounts_operations.py +0 -1638
  111. azure/mgmt/storage/v2017_10_01/operations/_usage_operations.py +0 -157
  112. azure/mgmt/storage/v2017_10_01/py.typed +0 -1
  113. azure/mgmt/storage/v2019_06_01/__init__.py +0 -32
  114. azure/mgmt/storage/v2019_06_01/_configuration.py +0 -64
  115. azure/mgmt/storage/v2019_06_01/_patch.py +0 -32
  116. azure/mgmt/storage/v2019_06_01/_storage_management_client.py +0 -213
  117. azure/mgmt/storage/v2019_06_01/_version.py +0 -9
  118. azure/mgmt/storage/v2019_06_01/aio/__init__.py +0 -29
  119. azure/mgmt/storage/v2019_06_01/aio/_configuration.py +0 -64
  120. azure/mgmt/storage/v2019_06_01/aio/_patch.py +0 -32
  121. azure/mgmt/storage/v2019_06_01/aio/_storage_management_client.py +0 -217
  122. azure/mgmt/storage/v2019_06_01/aio/operations/__init__.py +0 -59
  123. azure/mgmt/storage/v2019_06_01/aio/operations/_blob_containers_operations.py +0 -1725
  124. azure/mgmt/storage/v2019_06_01/aio/operations/_blob_inventory_policies_operations.py +0 -437
  125. azure/mgmt/storage/v2019_06_01/aio/operations/_blob_services_operations.py +0 -368
  126. azure/mgmt/storage/v2019_06_01/aio/operations/_encryption_scopes_operations.py +0 -538
  127. azure/mgmt/storage/v2019_06_01/aio/operations/_file_services_operations.py +0 -335
  128. azure/mgmt/storage/v2019_06_01/aio/operations/_file_shares_operations.py +0 -771
  129. azure/mgmt/storage/v2019_06_01/aio/operations/_object_replication_policies_operations.py +0 -428
  130. azure/mgmt/storage/v2019_06_01/aio/operations/_operations.py +0 -130
  131. azure/mgmt/storage/v2019_06_01/aio/operations/_patch.py +0 -20
  132. azure/mgmt/storage/v2019_06_01/aio/operations/_private_endpoint_connections_operations.py +0 -424
  133. azure/mgmt/storage/v2019_06_01/aio/operations/_private_link_resources_operations.py +0 -113
  134. azure/mgmt/storage/v2019_06_01/aio/operations/_queue_operations.py +0 -597
  135. azure/mgmt/storage/v2019_06_01/aio/operations/_queue_services_operations.py +0 -335
  136. azure/mgmt/storage/v2019_06_01/aio/operations/_skus_operations.py +0 -131
  137. azure/mgmt/storage/v2019_06_01/aio/operations/_storage_accounts_operations.py +0 -1696
  138. azure/mgmt/storage/v2019_06_01/aio/operations/_table_operations.py +0 -394
  139. azure/mgmt/storage/v2019_06_01/aio/operations/_table_services_operations.py +0 -335
  140. azure/mgmt/storage/v2019_06_01/aio/operations/_usages_operations.py +0 -134
  141. azure/mgmt/storage/v2019_06_01/models/__init__.py +0 -364
  142. azure/mgmt/storage/v2019_06_01/models/_models_py3.py +0 -6038
  143. azure/mgmt/storage/v2019_06_01/models/_patch.py +0 -20
  144. azure/mgmt/storage/v2019_06_01/models/_storage_management_client_enums.py +0 -456
  145. azure/mgmt/storage/v2019_06_01/operations/__init__.py +0 -59
  146. azure/mgmt/storage/v2019_06_01/operations/_blob_containers_operations.py +0 -2226
  147. azure/mgmt/storage/v2019_06_01/operations/_blob_inventory_policies_operations.py +0 -582
  148. azure/mgmt/storage/v2019_06_01/operations/_blob_services_operations.py +0 -476
  149. azure/mgmt/storage/v2019_06_01/operations/_encryption_scopes_operations.py +0 -677
  150. azure/mgmt/storage/v2019_06_01/operations/_file_services_operations.py +0 -444
  151. azure/mgmt/storage/v2019_06_01/operations/_file_shares_operations.py +0 -1000
  152. azure/mgmt/storage/v2019_06_01/operations/_management_policies_operations.py +0 -453
  153. azure/mgmt/storage/v2019_06_01/operations/_object_replication_policies_operations.py +0 -567
  154. azure/mgmt/storage/v2019_06_01/operations/_operations.py +0 -151
  155. azure/mgmt/storage/v2019_06_01/operations/_patch.py +0 -20
  156. azure/mgmt/storage/v2019_06_01/operations/_private_endpoint_connections_operations.py +0 -575
  157. azure/mgmt/storage/v2019_06_01/operations/_private_link_resources_operations.py +0 -149
  158. azure/mgmt/storage/v2019_06_01/operations/_queue_operations.py +0 -805
  159. azure/mgmt/storage/v2019_06_01/operations/_queue_services_operations.py +0 -444
  160. azure/mgmt/storage/v2019_06_01/operations/_skus_operations.py +0 -157
  161. azure/mgmt/storage/v2019_06_01/operations/_storage_accounts_operations.py +0 -2122
  162. azure/mgmt/storage/v2019_06_01/operations/_table_operations.py +0 -563
  163. azure/mgmt/storage/v2019_06_01/operations/_table_services_operations.py +0 -444
  164. azure/mgmt/storage/v2019_06_01/operations/_usages_operations.py +0 -164
  165. azure/mgmt/storage/v2019_06_01/py.typed +0 -1
  166. azure/mgmt/storage/v2024_01_01/__init__.py +0 -32
  167. azure/mgmt/storage/v2024_01_01/_configuration.py +0 -64
  168. azure/mgmt/storage/v2024_01_01/_patch.py +0 -20
  169. azure/mgmt/storage/v2024_01_01/_storage_management_client.py +0 -256
  170. azure/mgmt/storage/v2024_01_01/_version.py +0 -9
  171. azure/mgmt/storage/v2024_01_01/aio/__init__.py +0 -29
  172. azure/mgmt/storage/v2024_01_01/aio/_configuration.py +0 -64
  173. azure/mgmt/storage/v2024_01_01/aio/_patch.py +0 -20
  174. azure/mgmt/storage/v2024_01_01/aio/_storage_management_client.py +0 -261
  175. azure/mgmt/storage/v2024_01_01/aio/operations/_management_policies_operations.py +0 -343
  176. azure/mgmt/storage/v2024_01_01/aio/operations/_operations.py +0 -130
  177. azure/mgmt/storage/v2024_01_01/aio/operations/_patch.py +0 -20
  178. azure/mgmt/storage/v2024_01_01/models/_patch.py +0 -20
  179. azure/mgmt/storage/v2024_01_01/operations/_patch.py +0 -20
  180. azure/mgmt/storage/v2024_01_01/py.typed +0 -1
  181. azure_mgmt_storage-22.1.1.dist-info/RECORD +0 -183
  182. /azure/mgmt/storage/{v2024_01_01/models → models}/__init__.py +0 -0
  183. {azure_mgmt_storage-22.1.1.dist-info → azure_mgmt_storage-23.0.0.dist-info}/LICENSE +0 -0
  184. {azure_mgmt_storage-22.1.1.dist-info → azure_mgmt_storage-23.0.0.dist-info}/top_level.txt +0 -0
@@ -1,805 +0,0 @@
1
- # coding=utf-8
2
- # --------------------------------------------------------------------------
3
- # Copyright (c) Microsoft Corporation. All rights reserved.
4
- # Licensed under the MIT License. See License.txt in the project root for license information.
5
- # Code generated by Microsoft (R) AutoRest Code Generator.
6
- # Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
- # --------------------------------------------------------------------------
8
- from io import IOBase
9
- import sys
10
- from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
11
- import urllib.parse
12
-
13
- from azure.core.exceptions import (
14
- ClientAuthenticationError,
15
- HttpResponseError,
16
- ResourceExistsError,
17
- ResourceNotFoundError,
18
- ResourceNotModifiedError,
19
- map_error,
20
- )
21
- from azure.core.paging import ItemPaged
22
- from azure.core.pipeline import PipelineResponse
23
- from azure.core.rest import HttpRequest, HttpResponse
24
- from azure.core.tracing.decorator import distributed_trace
25
- from azure.core.utils import case_insensitive_dict
26
- from azure.mgmt.core.exceptions import ARMErrorFormat
27
-
28
- from .. import models as _models
29
- from ..._serialization import Serializer
30
-
31
- if sys.version_info >= (3, 9):
32
- from collections.abc import MutableMapping
33
- else:
34
- from typing import MutableMapping # type: ignore
35
- T = TypeVar("T")
36
- ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
37
-
38
- _SERIALIZER = Serializer()
39
- _SERIALIZER.client_side_validation = False
40
-
41
-
42
- def build_create_request(
43
- resource_group_name: str, account_name: str, queue_name: str, subscription_id: str, **kwargs: Any
44
- ) -> HttpRequest:
45
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
46
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
47
-
48
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01"))
49
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
50
- accept = _headers.pop("Accept", "application/json")
51
-
52
- # Construct URL
53
- _url = kwargs.pop(
54
- "template_url",
55
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}",
56
- ) # pylint: disable=line-too-long
57
- path_format_arguments = {
58
- "resourceGroupName": _SERIALIZER.url(
59
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
60
- ),
61
- "accountName": _SERIALIZER.url("account_name", account_name, "str", max_length=24, min_length=3),
62
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
63
- "queueName": _SERIALIZER.url(
64
- "queue_name",
65
- queue_name,
66
- "str",
67
- max_length=63,
68
- min_length=3,
69
- pattern=r"^[a-z0-9]([a-z0-9]|(-(?!-))){1,61}[a-z0-9]$",
70
- ),
71
- }
72
-
73
- _url: str = _url.format(**path_format_arguments) # type: ignore
74
-
75
- # Construct parameters
76
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
77
-
78
- # Construct headers
79
- if content_type is not None:
80
- _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
81
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
82
-
83
- return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs)
84
-
85
-
86
- def build_update_request(
87
- resource_group_name: str, account_name: str, queue_name: str, subscription_id: str, **kwargs: Any
88
- ) -> HttpRequest:
89
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
90
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
91
-
92
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01"))
93
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
94
- accept = _headers.pop("Accept", "application/json")
95
-
96
- # Construct URL
97
- _url = kwargs.pop(
98
- "template_url",
99
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}",
100
- ) # pylint: disable=line-too-long
101
- path_format_arguments = {
102
- "resourceGroupName": _SERIALIZER.url(
103
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
104
- ),
105
- "accountName": _SERIALIZER.url("account_name", account_name, "str", max_length=24, min_length=3),
106
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
107
- "queueName": _SERIALIZER.url(
108
- "queue_name",
109
- queue_name,
110
- "str",
111
- max_length=63,
112
- min_length=3,
113
- pattern=r"^[a-z0-9]([a-z0-9]|(-(?!-))){1,61}[a-z0-9]$",
114
- ),
115
- }
116
-
117
- _url: str = _url.format(**path_format_arguments) # type: ignore
118
-
119
- # Construct parameters
120
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
121
-
122
- # Construct headers
123
- if content_type is not None:
124
- _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
125
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
126
-
127
- return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs)
128
-
129
-
130
- def build_get_request(
131
- resource_group_name: str, account_name: str, queue_name: str, subscription_id: str, **kwargs: Any
132
- ) -> HttpRequest:
133
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
134
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
135
-
136
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01"))
137
- accept = _headers.pop("Accept", "application/json")
138
-
139
- # Construct URL
140
- _url = kwargs.pop(
141
- "template_url",
142
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}",
143
- ) # pylint: disable=line-too-long
144
- path_format_arguments = {
145
- "resourceGroupName": _SERIALIZER.url(
146
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
147
- ),
148
- "accountName": _SERIALIZER.url("account_name", account_name, "str", max_length=24, min_length=3),
149
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
150
- "queueName": _SERIALIZER.url(
151
- "queue_name",
152
- queue_name,
153
- "str",
154
- max_length=63,
155
- min_length=3,
156
- pattern=r"^[a-z0-9]([a-z0-9]|(-(?!-))){1,61}[a-z0-9]$",
157
- ),
158
- }
159
-
160
- _url: str = _url.format(**path_format_arguments) # type: ignore
161
-
162
- # Construct parameters
163
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
164
-
165
- # Construct headers
166
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
167
-
168
- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
169
-
170
-
171
- def build_delete_request(
172
- resource_group_name: str, account_name: str, queue_name: str, subscription_id: str, **kwargs: Any
173
- ) -> HttpRequest:
174
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
175
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
176
-
177
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01"))
178
- accept = _headers.pop("Accept", "application/json")
179
-
180
- # Construct URL
181
- _url = kwargs.pop(
182
- "template_url",
183
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}",
184
- ) # pylint: disable=line-too-long
185
- path_format_arguments = {
186
- "resourceGroupName": _SERIALIZER.url(
187
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
188
- ),
189
- "accountName": _SERIALIZER.url("account_name", account_name, "str", max_length=24, min_length=3),
190
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
191
- "queueName": _SERIALIZER.url(
192
- "queue_name",
193
- queue_name,
194
- "str",
195
- max_length=63,
196
- min_length=3,
197
- pattern=r"^[a-z0-9]([a-z0-9]|(-(?!-))){1,61}[a-z0-9]$",
198
- ),
199
- }
200
-
201
- _url: str = _url.format(**path_format_arguments) # type: ignore
202
-
203
- # Construct parameters
204
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
205
-
206
- # Construct headers
207
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
208
-
209
- return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs)
210
-
211
-
212
- def build_list_request(
213
- resource_group_name: str,
214
- account_name: str,
215
- subscription_id: str,
216
- *,
217
- maxpagesize: Optional[str] = None,
218
- filter: Optional[str] = None,
219
- **kwargs: Any
220
- ) -> HttpRequest:
221
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
222
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
223
-
224
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01"))
225
- accept = _headers.pop("Accept", "application/json")
226
-
227
- # Construct URL
228
- _url = kwargs.pop(
229
- "template_url",
230
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues",
231
- ) # pylint: disable=line-too-long
232
- path_format_arguments = {
233
- "resourceGroupName": _SERIALIZER.url(
234
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
235
- ),
236
- "accountName": _SERIALIZER.url("account_name", account_name, "str", max_length=24, min_length=3),
237
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
238
- }
239
-
240
- _url: str = _url.format(**path_format_arguments) # type: ignore
241
-
242
- # Construct parameters
243
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
244
- if maxpagesize is not None:
245
- _params["$maxpagesize"] = _SERIALIZER.query("maxpagesize", maxpagesize, "str")
246
- if filter is not None:
247
- _params["$filter"] = _SERIALIZER.query("filter", filter, "str")
248
-
249
- # Construct headers
250
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
251
-
252
- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
253
-
254
-
255
- class QueueOperations:
256
- """
257
- .. warning::
258
- **DO NOT** instantiate this class directly.
259
-
260
- Instead, you should access the following operations through
261
- :class:`~azure.mgmt.storage.v2019_06_01.StorageManagementClient`'s
262
- :attr:`queue` attribute.
263
- """
264
-
265
- models = _models
266
-
267
- def __init__(self, *args, **kwargs):
268
- input_args = list(args)
269
- self._client = input_args.pop(0) if input_args else kwargs.pop("client")
270
- self._config = input_args.pop(0) if input_args else kwargs.pop("config")
271
- self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
272
- self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
273
- self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
274
-
275
- @overload
276
- def create(
277
- self,
278
- resource_group_name: str,
279
- account_name: str,
280
- queue_name: str,
281
- queue: _models.StorageQueue,
282
- *,
283
- content_type: str = "application/json",
284
- **kwargs: Any
285
- ) -> _models.StorageQueue:
286
- """Creates a new queue with the specified queue name, under the specified account.
287
-
288
- :param resource_group_name: The name of the resource group within the user's subscription. The
289
- name is case insensitive. Required.
290
- :type resource_group_name: str
291
- :param account_name: The name of the storage account within the specified resource group.
292
- Storage account names must be between 3 and 24 characters in length and use numbers and
293
- lower-case letters only. Required.
294
- :type account_name: str
295
- :param queue_name: A queue name must be unique within a storage account and must be between 3
296
- and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only,
297
- it should begin and end with an alphanumeric character and it cannot have two consecutive
298
- dash(-) characters. Required.
299
- :type queue_name: str
300
- :param queue: Queue properties and metadata to be created with. Required.
301
- :type queue: ~azure.mgmt.storage.v2019_06_01.models.StorageQueue
302
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
303
- Default value is "application/json".
304
- :paramtype content_type: str
305
- :return: StorageQueue or the result of cls(response)
306
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.StorageQueue
307
- :raises ~azure.core.exceptions.HttpResponseError:
308
- """
309
-
310
- @overload
311
- def create(
312
- self,
313
- resource_group_name: str,
314
- account_name: str,
315
- queue_name: str,
316
- queue: IO[bytes],
317
- *,
318
- content_type: str = "application/json",
319
- **kwargs: Any
320
- ) -> _models.StorageQueue:
321
- """Creates a new queue with the specified queue name, under the specified account.
322
-
323
- :param resource_group_name: The name of the resource group within the user's subscription. The
324
- name is case insensitive. Required.
325
- :type resource_group_name: str
326
- :param account_name: The name of the storage account within the specified resource group.
327
- Storage account names must be between 3 and 24 characters in length and use numbers and
328
- lower-case letters only. Required.
329
- :type account_name: str
330
- :param queue_name: A queue name must be unique within a storage account and must be between 3
331
- and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only,
332
- it should begin and end with an alphanumeric character and it cannot have two consecutive
333
- dash(-) characters. Required.
334
- :type queue_name: str
335
- :param queue: Queue properties and metadata to be created with. Required.
336
- :type queue: IO[bytes]
337
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
338
- Default value is "application/json".
339
- :paramtype content_type: str
340
- :return: StorageQueue or the result of cls(response)
341
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.StorageQueue
342
- :raises ~azure.core.exceptions.HttpResponseError:
343
- """
344
-
345
- @distributed_trace
346
- def create(
347
- self,
348
- resource_group_name: str,
349
- account_name: str,
350
- queue_name: str,
351
- queue: Union[_models.StorageQueue, IO[bytes]],
352
- **kwargs: Any
353
- ) -> _models.StorageQueue:
354
- """Creates a new queue with the specified queue name, under the specified account.
355
-
356
- :param resource_group_name: The name of the resource group within the user's subscription. The
357
- name is case insensitive. Required.
358
- :type resource_group_name: str
359
- :param account_name: The name of the storage account within the specified resource group.
360
- Storage account names must be between 3 and 24 characters in length and use numbers and
361
- lower-case letters only. Required.
362
- :type account_name: str
363
- :param queue_name: A queue name must be unique within a storage account and must be between 3
364
- and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only,
365
- it should begin and end with an alphanumeric character and it cannot have two consecutive
366
- dash(-) characters. Required.
367
- :type queue_name: str
368
- :param queue: Queue properties and metadata to be created with. Is either a StorageQueue type
369
- or a IO[bytes] type. Required.
370
- :type queue: ~azure.mgmt.storage.v2019_06_01.models.StorageQueue or IO[bytes]
371
- :return: StorageQueue or the result of cls(response)
372
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.StorageQueue
373
- :raises ~azure.core.exceptions.HttpResponseError:
374
- """
375
- error_map: MutableMapping = {
376
- 401: ClientAuthenticationError,
377
- 404: ResourceNotFoundError,
378
- 409: ResourceExistsError,
379
- 304: ResourceNotModifiedError,
380
- }
381
- error_map.update(kwargs.pop("error_map", {}) or {})
382
-
383
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
384
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
385
-
386
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
387
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
388
- cls: ClsType[_models.StorageQueue] = kwargs.pop("cls", None)
389
-
390
- content_type = content_type or "application/json"
391
- _json = None
392
- _content = None
393
- if isinstance(queue, (IOBase, bytes)):
394
- _content = queue
395
- else:
396
- _json = self._serialize.body(queue, "StorageQueue")
397
-
398
- _request = build_create_request(
399
- resource_group_name=resource_group_name,
400
- account_name=account_name,
401
- queue_name=queue_name,
402
- subscription_id=self._config.subscription_id,
403
- api_version=api_version,
404
- content_type=content_type,
405
- json=_json,
406
- content=_content,
407
- headers=_headers,
408
- params=_params,
409
- )
410
- _request.url = self._client.format_url(_request.url)
411
-
412
- _stream = False
413
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
414
- _request, stream=_stream, **kwargs
415
- )
416
-
417
- response = pipeline_response.http_response
418
-
419
- if response.status_code not in [200]:
420
- map_error(status_code=response.status_code, response=response, error_map=error_map)
421
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
422
-
423
- deserialized = self._deserialize("StorageQueue", pipeline_response.http_response)
424
-
425
- if cls:
426
- return cls(pipeline_response, deserialized, {}) # type: ignore
427
-
428
- return deserialized # type: ignore
429
-
430
- @overload
431
- def update(
432
- self,
433
- resource_group_name: str,
434
- account_name: str,
435
- queue_name: str,
436
- queue: _models.StorageQueue,
437
- *,
438
- content_type: str = "application/json",
439
- **kwargs: Any
440
- ) -> _models.StorageQueue:
441
- """Creates a new queue with the specified queue name, under the specified account.
442
-
443
- :param resource_group_name: The name of the resource group within the user's subscription. The
444
- name is case insensitive. Required.
445
- :type resource_group_name: str
446
- :param account_name: The name of the storage account within the specified resource group.
447
- Storage account names must be between 3 and 24 characters in length and use numbers and
448
- lower-case letters only. Required.
449
- :type account_name: str
450
- :param queue_name: A queue name must be unique within a storage account and must be between 3
451
- and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only,
452
- it should begin and end with an alphanumeric character and it cannot have two consecutive
453
- dash(-) characters. Required.
454
- :type queue_name: str
455
- :param queue: Queue properties and metadata to be created with. Required.
456
- :type queue: ~azure.mgmt.storage.v2019_06_01.models.StorageQueue
457
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
458
- Default value is "application/json".
459
- :paramtype content_type: str
460
- :return: StorageQueue or the result of cls(response)
461
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.StorageQueue
462
- :raises ~azure.core.exceptions.HttpResponseError:
463
- """
464
-
465
- @overload
466
- def update(
467
- self,
468
- resource_group_name: str,
469
- account_name: str,
470
- queue_name: str,
471
- queue: IO[bytes],
472
- *,
473
- content_type: str = "application/json",
474
- **kwargs: Any
475
- ) -> _models.StorageQueue:
476
- """Creates a new queue with the specified queue name, under the specified account.
477
-
478
- :param resource_group_name: The name of the resource group within the user's subscription. The
479
- name is case insensitive. Required.
480
- :type resource_group_name: str
481
- :param account_name: The name of the storage account within the specified resource group.
482
- Storage account names must be between 3 and 24 characters in length and use numbers and
483
- lower-case letters only. Required.
484
- :type account_name: str
485
- :param queue_name: A queue name must be unique within a storage account and must be between 3
486
- and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only,
487
- it should begin and end with an alphanumeric character and it cannot have two consecutive
488
- dash(-) characters. Required.
489
- :type queue_name: str
490
- :param queue: Queue properties and metadata to be created with. Required.
491
- :type queue: IO[bytes]
492
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
493
- Default value is "application/json".
494
- :paramtype content_type: str
495
- :return: StorageQueue or the result of cls(response)
496
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.StorageQueue
497
- :raises ~azure.core.exceptions.HttpResponseError:
498
- """
499
-
500
- @distributed_trace
501
- def update(
502
- self,
503
- resource_group_name: str,
504
- account_name: str,
505
- queue_name: str,
506
- queue: Union[_models.StorageQueue, IO[bytes]],
507
- **kwargs: Any
508
- ) -> _models.StorageQueue:
509
- """Creates a new queue with the specified queue name, under the specified account.
510
-
511
- :param resource_group_name: The name of the resource group within the user's subscription. The
512
- name is case insensitive. Required.
513
- :type resource_group_name: str
514
- :param account_name: The name of the storage account within the specified resource group.
515
- Storage account names must be between 3 and 24 characters in length and use numbers and
516
- lower-case letters only. Required.
517
- :type account_name: str
518
- :param queue_name: A queue name must be unique within a storage account and must be between 3
519
- and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only,
520
- it should begin and end with an alphanumeric character and it cannot have two consecutive
521
- dash(-) characters. Required.
522
- :type queue_name: str
523
- :param queue: Queue properties and metadata to be created with. Is either a StorageQueue type
524
- or a IO[bytes] type. Required.
525
- :type queue: ~azure.mgmt.storage.v2019_06_01.models.StorageQueue or IO[bytes]
526
- :return: StorageQueue or the result of cls(response)
527
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.StorageQueue
528
- :raises ~azure.core.exceptions.HttpResponseError:
529
- """
530
- error_map: MutableMapping = {
531
- 401: ClientAuthenticationError,
532
- 404: ResourceNotFoundError,
533
- 409: ResourceExistsError,
534
- 304: ResourceNotModifiedError,
535
- }
536
- error_map.update(kwargs.pop("error_map", {}) or {})
537
-
538
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
539
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
540
-
541
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
542
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
543
- cls: ClsType[_models.StorageQueue] = kwargs.pop("cls", None)
544
-
545
- content_type = content_type or "application/json"
546
- _json = None
547
- _content = None
548
- if isinstance(queue, (IOBase, bytes)):
549
- _content = queue
550
- else:
551
- _json = self._serialize.body(queue, "StorageQueue")
552
-
553
- _request = build_update_request(
554
- resource_group_name=resource_group_name,
555
- account_name=account_name,
556
- queue_name=queue_name,
557
- subscription_id=self._config.subscription_id,
558
- api_version=api_version,
559
- content_type=content_type,
560
- json=_json,
561
- content=_content,
562
- headers=_headers,
563
- params=_params,
564
- )
565
- _request.url = self._client.format_url(_request.url)
566
-
567
- _stream = False
568
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
569
- _request, stream=_stream, **kwargs
570
- )
571
-
572
- response = pipeline_response.http_response
573
-
574
- if response.status_code not in [200]:
575
- map_error(status_code=response.status_code, response=response, error_map=error_map)
576
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
577
-
578
- deserialized = self._deserialize("StorageQueue", pipeline_response.http_response)
579
-
580
- if cls:
581
- return cls(pipeline_response, deserialized, {}) # type: ignore
582
-
583
- return deserialized # type: ignore
584
-
585
- @distributed_trace
586
- def get(self, resource_group_name: str, account_name: str, queue_name: str, **kwargs: Any) -> _models.StorageQueue:
587
- """Gets the queue with the specified queue name, under the specified account if it exists.
588
-
589
- :param resource_group_name: The name of the resource group within the user's subscription. The
590
- name is case insensitive. Required.
591
- :type resource_group_name: str
592
- :param account_name: The name of the storage account within the specified resource group.
593
- Storage account names must be between 3 and 24 characters in length and use numbers and
594
- lower-case letters only. Required.
595
- :type account_name: str
596
- :param queue_name: A queue name must be unique within a storage account and must be between 3
597
- and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only,
598
- it should begin and end with an alphanumeric character and it cannot have two consecutive
599
- dash(-) characters. Required.
600
- :type queue_name: str
601
- :return: StorageQueue or the result of cls(response)
602
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.StorageQueue
603
- :raises ~azure.core.exceptions.HttpResponseError:
604
- """
605
- error_map: MutableMapping = {
606
- 401: ClientAuthenticationError,
607
- 404: ResourceNotFoundError,
608
- 409: ResourceExistsError,
609
- 304: ResourceNotModifiedError,
610
- }
611
- error_map.update(kwargs.pop("error_map", {}) or {})
612
-
613
- _headers = kwargs.pop("headers", {}) or {}
614
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
615
-
616
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
617
- cls: ClsType[_models.StorageQueue] = kwargs.pop("cls", None)
618
-
619
- _request = build_get_request(
620
- resource_group_name=resource_group_name,
621
- account_name=account_name,
622
- queue_name=queue_name,
623
- subscription_id=self._config.subscription_id,
624
- api_version=api_version,
625
- headers=_headers,
626
- params=_params,
627
- )
628
- _request.url = self._client.format_url(_request.url)
629
-
630
- _stream = False
631
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
632
- _request, stream=_stream, **kwargs
633
- )
634
-
635
- response = pipeline_response.http_response
636
-
637
- if response.status_code not in [200]:
638
- map_error(status_code=response.status_code, response=response, error_map=error_map)
639
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
640
-
641
- deserialized = self._deserialize("StorageQueue", pipeline_response.http_response)
642
-
643
- if cls:
644
- return cls(pipeline_response, deserialized, {}) # type: ignore
645
-
646
- return deserialized # type: ignore
647
-
648
- @distributed_trace
649
- def delete( # pylint: disable=inconsistent-return-statements
650
- self, resource_group_name: str, account_name: str, queue_name: str, **kwargs: Any
651
- ) -> None:
652
- """Deletes the queue with the specified queue name, under the specified account if it exists.
653
-
654
- :param resource_group_name: The name of the resource group within the user's subscription. The
655
- name is case insensitive. Required.
656
- :type resource_group_name: str
657
- :param account_name: The name of the storage account within the specified resource group.
658
- Storage account names must be between 3 and 24 characters in length and use numbers and
659
- lower-case letters only. Required.
660
- :type account_name: str
661
- :param queue_name: A queue name must be unique within a storage account and must be between 3
662
- and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only,
663
- it should begin and end with an alphanumeric character and it cannot have two consecutive
664
- dash(-) characters. Required.
665
- :type queue_name: str
666
- :return: None or the result of cls(response)
667
- :rtype: None
668
- :raises ~azure.core.exceptions.HttpResponseError:
669
- """
670
- error_map: MutableMapping = {
671
- 401: ClientAuthenticationError,
672
- 404: ResourceNotFoundError,
673
- 409: ResourceExistsError,
674
- 304: ResourceNotModifiedError,
675
- }
676
- error_map.update(kwargs.pop("error_map", {}) or {})
677
-
678
- _headers = kwargs.pop("headers", {}) or {}
679
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
680
-
681
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
682
- cls: ClsType[None] = kwargs.pop("cls", None)
683
-
684
- _request = build_delete_request(
685
- resource_group_name=resource_group_name,
686
- account_name=account_name,
687
- queue_name=queue_name,
688
- subscription_id=self._config.subscription_id,
689
- api_version=api_version,
690
- headers=_headers,
691
- params=_params,
692
- )
693
- _request.url = self._client.format_url(_request.url)
694
-
695
- _stream = False
696
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
697
- _request, stream=_stream, **kwargs
698
- )
699
-
700
- response = pipeline_response.http_response
701
-
702
- if response.status_code not in [204]:
703
- map_error(status_code=response.status_code, response=response, error_map=error_map)
704
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
705
-
706
- if cls:
707
- return cls(pipeline_response, None, {}) # type: ignore
708
-
709
- @distributed_trace
710
- def list(
711
- self,
712
- resource_group_name: str,
713
- account_name: str,
714
- maxpagesize: Optional[str] = None,
715
- filter: Optional[str] = None,
716
- **kwargs: Any
717
- ) -> Iterable["_models.ListQueue"]:
718
- """Gets a list of all the queues under the specified storage account.
719
-
720
- :param resource_group_name: The name of the resource group within the user's subscription. The
721
- name is case insensitive. Required.
722
- :type resource_group_name: str
723
- :param account_name: The name of the storage account within the specified resource group.
724
- Storage account names must be between 3 and 24 characters in length and use numbers and
725
- lower-case letters only. Required.
726
- :type account_name: str
727
- :param maxpagesize: Optional, a maximum number of queues that should be included in a list
728
- queue response. Default value is None.
729
- :type maxpagesize: str
730
- :param filter: Optional, When specified, only the queues with a name starting with the given
731
- filter will be listed. Default value is None.
732
- :type filter: str
733
- :return: An iterator like instance of either ListQueue or the result of cls(response)
734
- :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2019_06_01.models.ListQueue]
735
- :raises ~azure.core.exceptions.HttpResponseError:
736
- """
737
- _headers = kwargs.pop("headers", {}) or {}
738
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
739
-
740
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
741
- cls: ClsType[_models.ListQueueResource] = kwargs.pop("cls", None)
742
-
743
- error_map: MutableMapping = {
744
- 401: ClientAuthenticationError,
745
- 404: ResourceNotFoundError,
746
- 409: ResourceExistsError,
747
- 304: ResourceNotModifiedError,
748
- }
749
- error_map.update(kwargs.pop("error_map", {}) or {})
750
-
751
- def prepare_request(next_link=None):
752
- if not next_link:
753
-
754
- _request = build_list_request(
755
- resource_group_name=resource_group_name,
756
- account_name=account_name,
757
- subscription_id=self._config.subscription_id,
758
- maxpagesize=maxpagesize,
759
- filter=filter,
760
- api_version=api_version,
761
- headers=_headers,
762
- params=_params,
763
- )
764
- _request.url = self._client.format_url(_request.url)
765
-
766
- else:
767
- # make call to next link with the client's api-version
768
- _parsed_next_link = urllib.parse.urlparse(next_link)
769
- _next_request_params = case_insensitive_dict(
770
- {
771
- key: [urllib.parse.quote(v) for v in value]
772
- for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
773
- }
774
- )
775
- _next_request_params["api-version"] = self._api_version
776
- _request = HttpRequest(
777
- "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
778
- )
779
- _request.url = self._client.format_url(_request.url)
780
- _request.method = "GET"
781
- return _request
782
-
783
- def extract_data(pipeline_response):
784
- deserialized = self._deserialize("ListQueueResource", pipeline_response)
785
- list_of_elem = deserialized.value
786
- if cls:
787
- list_of_elem = cls(list_of_elem) # type: ignore
788
- return deserialized.next_link or None, iter(list_of_elem)
789
-
790
- def get_next(next_link=None):
791
- _request = prepare_request(next_link)
792
-
793
- _stream = False
794
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
795
- _request, stream=_stream, **kwargs
796
- )
797
- response = pipeline_response.http_response
798
-
799
- if response.status_code not in [200]:
800
- map_error(status_code=response.status_code, response=response, error_map=error_map)
801
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
802
-
803
- return pipeline_response
804
-
805
- return ItemPaged(get_next, extract_data)