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,2226 +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, Optional, TypeVar, Union, overload
12
- import urllib.parse
13
-
14
- from azure.core.exceptions import (
15
- ClientAuthenticationError,
16
- HttpResponseError,
17
- ResourceExistsError,
18
- ResourceNotFoundError,
19
- ResourceNotModifiedError,
20
- map_error,
21
- )
22
- from azure.core.paging import ItemPaged
23
- from azure.core.pipeline import PipelineResponse
24
- from azure.core.rest import HttpRequest, HttpResponse
25
- from azure.core.tracing.decorator import distributed_trace
26
- from azure.core.utils import case_insensitive_dict
27
- from azure.mgmt.core.exceptions import ARMErrorFormat
28
-
29
- from .. import models as _models
30
- from ..._serialization import Serializer
31
-
32
- if sys.version_info >= (3, 9):
33
- from collections.abc import MutableMapping
34
- else:
35
- from typing import MutableMapping # type: ignore
36
- T = TypeVar("T")
37
- ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
38
-
39
- _SERIALIZER = Serializer()
40
- _SERIALIZER.client_side_validation = False
41
-
42
-
43
- def build_list_request(
44
- resource_group_name: str,
45
- account_name: str,
46
- subscription_id: str,
47
- *,
48
- maxpagesize: Optional[str] = None,
49
- filter: Optional[str] = None,
50
- include: Optional[Union[str, _models.ListContainersInclude]] = None,
51
- **kwargs: Any
52
- ) -> HttpRequest:
53
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
54
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
55
-
56
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01"))
57
- accept = _headers.pop("Accept", "application/json")
58
-
59
- # Construct URL
60
- _url = kwargs.pop(
61
- "template_url",
62
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers",
63
- ) # pylint: disable=line-too-long
64
- path_format_arguments = {
65
- "resourceGroupName": _SERIALIZER.url(
66
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
67
- ),
68
- "accountName": _SERIALIZER.url("account_name", account_name, "str", max_length=24, min_length=3),
69
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
70
- }
71
-
72
- _url: str = _url.format(**path_format_arguments) # type: ignore
73
-
74
- # Construct parameters
75
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
76
- if maxpagesize is not None:
77
- _params["$maxpagesize"] = _SERIALIZER.query("maxpagesize", maxpagesize, "str")
78
- if filter is not None:
79
- _params["$filter"] = _SERIALIZER.query("filter", filter, "str")
80
- if include is not None:
81
- _params["$include"] = _SERIALIZER.query("include", include, "str")
82
-
83
- # Construct headers
84
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
85
-
86
- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
87
-
88
-
89
- def build_create_request(
90
- resource_group_name: str, account_name: str, container_name: str, subscription_id: str, **kwargs: Any
91
- ) -> HttpRequest:
92
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
93
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
94
-
95
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01"))
96
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
97
- accept = _headers.pop("Accept", "application/json")
98
-
99
- # Construct URL
100
- _url = kwargs.pop(
101
- "template_url",
102
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}",
103
- ) # pylint: disable=line-too-long
104
- path_format_arguments = {
105
- "resourceGroupName": _SERIALIZER.url(
106
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
107
- ),
108
- "accountName": _SERIALIZER.url("account_name", account_name, "str", max_length=24, min_length=3),
109
- "containerName": _SERIALIZER.url("container_name", container_name, "str", max_length=63, min_length=3),
110
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
111
- }
112
-
113
- _url: str = _url.format(**path_format_arguments) # type: ignore
114
-
115
- # Construct parameters
116
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
117
-
118
- # Construct headers
119
- if content_type is not None:
120
- _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
121
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
122
-
123
- return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs)
124
-
125
-
126
- def build_update_request(
127
- resource_group_name: str, account_name: str, container_name: str, subscription_id: str, **kwargs: Any
128
- ) -> HttpRequest:
129
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
130
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
131
-
132
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01"))
133
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
134
- accept = _headers.pop("Accept", "application/json")
135
-
136
- # Construct URL
137
- _url = kwargs.pop(
138
- "template_url",
139
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}",
140
- ) # pylint: disable=line-too-long
141
- path_format_arguments = {
142
- "resourceGroupName": _SERIALIZER.url(
143
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
144
- ),
145
- "accountName": _SERIALIZER.url("account_name", account_name, "str", max_length=24, min_length=3),
146
- "containerName": _SERIALIZER.url("container_name", container_name, "str", max_length=63, min_length=3),
147
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
148
- }
149
-
150
- _url: str = _url.format(**path_format_arguments) # type: ignore
151
-
152
- # Construct parameters
153
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
154
-
155
- # Construct headers
156
- if content_type is not None:
157
- _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
158
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
159
-
160
- return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs)
161
-
162
-
163
- def build_get_request(
164
- resource_group_name: str, account_name: str, container_name: str, subscription_id: str, **kwargs: Any
165
- ) -> HttpRequest:
166
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
167
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
168
-
169
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01"))
170
- accept = _headers.pop("Accept", "application/json")
171
-
172
- # Construct URL
173
- _url = kwargs.pop(
174
- "template_url",
175
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}",
176
- ) # pylint: disable=line-too-long
177
- path_format_arguments = {
178
- "resourceGroupName": _SERIALIZER.url(
179
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
180
- ),
181
- "accountName": _SERIALIZER.url("account_name", account_name, "str", max_length=24, min_length=3),
182
- "containerName": _SERIALIZER.url("container_name", container_name, "str", max_length=63, min_length=3),
183
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
184
- }
185
-
186
- _url: str = _url.format(**path_format_arguments) # type: ignore
187
-
188
- # Construct parameters
189
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
190
-
191
- # Construct headers
192
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
193
-
194
- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
195
-
196
-
197
- def build_delete_request(
198
- resource_group_name: str, account_name: str, container_name: str, subscription_id: str, **kwargs: Any
199
- ) -> HttpRequest:
200
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
201
-
202
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01"))
203
- # Construct URL
204
- _url = kwargs.pop(
205
- "template_url",
206
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}",
207
- ) # pylint: disable=line-too-long
208
- path_format_arguments = {
209
- "resourceGroupName": _SERIALIZER.url(
210
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
211
- ),
212
- "accountName": _SERIALIZER.url("account_name", account_name, "str", max_length=24, min_length=3),
213
- "containerName": _SERIALIZER.url("container_name", container_name, "str", max_length=63, min_length=3),
214
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
215
- }
216
-
217
- _url: str = _url.format(**path_format_arguments) # type: ignore
218
-
219
- # Construct parameters
220
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
221
-
222
- return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs)
223
-
224
-
225
- def build_set_legal_hold_request(
226
- resource_group_name: str, account_name: str, container_name: str, subscription_id: str, **kwargs: Any
227
- ) -> HttpRequest:
228
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
229
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
230
-
231
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01"))
232
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
233
- accept = _headers.pop("Accept", "application/json")
234
-
235
- # Construct URL
236
- _url = kwargs.pop(
237
- "template_url",
238
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/setLegalHold",
239
- ) # pylint: disable=line-too-long
240
- path_format_arguments = {
241
- "resourceGroupName": _SERIALIZER.url(
242
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
243
- ),
244
- "accountName": _SERIALIZER.url("account_name", account_name, "str", max_length=24, min_length=3),
245
- "containerName": _SERIALIZER.url("container_name", container_name, "str", max_length=63, min_length=3),
246
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
247
- }
248
-
249
- _url: str = _url.format(**path_format_arguments) # type: ignore
250
-
251
- # Construct parameters
252
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
253
-
254
- # Construct headers
255
- if content_type is not None:
256
- _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
257
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
258
-
259
- return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
260
-
261
-
262
- def build_clear_legal_hold_request(
263
- resource_group_name: str, account_name: str, container_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", "2019-06-01"))
269
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
270
- accept = _headers.pop("Accept", "application/json")
271
-
272
- # Construct URL
273
- _url = kwargs.pop(
274
- "template_url",
275
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/clearLegalHold",
276
- ) # pylint: disable=line-too-long
277
- path_format_arguments = {
278
- "resourceGroupName": _SERIALIZER.url(
279
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
280
- ),
281
- "accountName": _SERIALIZER.url("account_name", account_name, "str", max_length=24, min_length=3),
282
- "containerName": _SERIALIZER.url("container_name", container_name, "str", max_length=63, min_length=3),
283
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
284
- }
285
-
286
- _url: str = _url.format(**path_format_arguments) # type: ignore
287
-
288
- # Construct parameters
289
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
290
-
291
- # Construct headers
292
- if content_type is not None:
293
- _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
294
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
295
-
296
- return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
297
-
298
-
299
- def build_create_or_update_immutability_policy_request( # pylint: disable=name-too-long
300
- resource_group_name: str,
301
- account_name: str,
302
- container_name: str,
303
- immutability_policy_name: Union[str, _models.Enum27],
304
- subscription_id: str,
305
- *,
306
- if_match: Optional[str] = None,
307
- **kwargs: Any
308
- ) -> HttpRequest:
309
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
310
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
311
-
312
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01"))
313
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
314
- accept = _headers.pop("Accept", "application/json")
315
-
316
- # Construct URL
317
- _url = kwargs.pop(
318
- "template_url",
319
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}",
320
- ) # pylint: disable=line-too-long
321
- path_format_arguments = {
322
- "resourceGroupName": _SERIALIZER.url(
323
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
324
- ),
325
- "accountName": _SERIALIZER.url("account_name", account_name, "str", max_length=24, min_length=3),
326
- "containerName": _SERIALIZER.url("container_name", container_name, "str", max_length=63, min_length=3),
327
- "immutabilityPolicyName": _SERIALIZER.url("immutability_policy_name", immutability_policy_name, "str"),
328
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
329
- }
330
-
331
- _url: str = _url.format(**path_format_arguments) # type: ignore
332
-
333
- # Construct parameters
334
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
335
-
336
- # Construct headers
337
- if if_match is not None:
338
- _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str")
339
- if content_type is not None:
340
- _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
341
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
342
-
343
- return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs)
344
-
345
-
346
- def build_get_immutability_policy_request(
347
- resource_group_name: str,
348
- account_name: str,
349
- container_name: str,
350
- immutability_policy_name: Union[str, _models.Enum27],
351
- subscription_id: str,
352
- *,
353
- if_match: Optional[str] = None,
354
- **kwargs: Any
355
- ) -> HttpRequest:
356
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
357
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
358
-
359
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01"))
360
- accept = _headers.pop("Accept", "application/json")
361
-
362
- # Construct URL
363
- _url = kwargs.pop(
364
- "template_url",
365
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}",
366
- ) # pylint: disable=line-too-long
367
- path_format_arguments = {
368
- "resourceGroupName": _SERIALIZER.url(
369
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
370
- ),
371
- "accountName": _SERIALIZER.url("account_name", account_name, "str", max_length=24, min_length=3),
372
- "containerName": _SERIALIZER.url("container_name", container_name, "str", max_length=63, min_length=3),
373
- "immutabilityPolicyName": _SERIALIZER.url("immutability_policy_name", immutability_policy_name, "str"),
374
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
375
- }
376
-
377
- _url: str = _url.format(**path_format_arguments) # type: ignore
378
-
379
- # Construct parameters
380
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
381
-
382
- # Construct headers
383
- if if_match is not None:
384
- _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str")
385
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
386
-
387
- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
388
-
389
-
390
- def build_delete_immutability_policy_request(
391
- resource_group_name: str,
392
- account_name: str,
393
- container_name: str,
394
- immutability_policy_name: Union[str, _models.Enum27],
395
- subscription_id: str,
396
- *,
397
- if_match: str,
398
- **kwargs: Any
399
- ) -> HttpRequest:
400
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
401
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
402
-
403
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01"))
404
- accept = _headers.pop("Accept", "application/json")
405
-
406
- # Construct URL
407
- _url = kwargs.pop(
408
- "template_url",
409
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}",
410
- ) # pylint: disable=line-too-long
411
- path_format_arguments = {
412
- "resourceGroupName": _SERIALIZER.url(
413
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
414
- ),
415
- "accountName": _SERIALIZER.url("account_name", account_name, "str", max_length=24, min_length=3),
416
- "containerName": _SERIALIZER.url("container_name", container_name, "str", max_length=63, min_length=3),
417
- "immutabilityPolicyName": _SERIALIZER.url("immutability_policy_name", immutability_policy_name, "str"),
418
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
419
- }
420
-
421
- _url: str = _url.format(**path_format_arguments) # type: ignore
422
-
423
- # Construct parameters
424
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
425
-
426
- # Construct headers
427
- _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str")
428
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
429
-
430
- return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs)
431
-
432
-
433
- def build_lock_immutability_policy_request(
434
- resource_group_name: str,
435
- account_name: str,
436
- container_name: str,
437
- subscription_id: str,
438
- *,
439
- if_match: str,
440
- **kwargs: Any
441
- ) -> HttpRequest:
442
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
443
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
444
-
445
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01"))
446
- accept = _headers.pop("Accept", "application/json")
447
-
448
- # Construct URL
449
- _url = kwargs.pop(
450
- "template_url",
451
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/lock",
452
- ) # pylint: disable=line-too-long
453
- path_format_arguments = {
454
- "resourceGroupName": _SERIALIZER.url(
455
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
456
- ),
457
- "accountName": _SERIALIZER.url("account_name", account_name, "str", max_length=24, min_length=3),
458
- "containerName": _SERIALIZER.url("container_name", container_name, "str", max_length=63, min_length=3),
459
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
460
- }
461
-
462
- _url: str = _url.format(**path_format_arguments) # type: ignore
463
-
464
- # Construct parameters
465
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
466
-
467
- # Construct headers
468
- _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str")
469
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
470
-
471
- return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
472
-
473
-
474
- def build_extend_immutability_policy_request(
475
- resource_group_name: str,
476
- account_name: str,
477
- container_name: str,
478
- subscription_id: str,
479
- *,
480
- if_match: str,
481
- **kwargs: Any
482
- ) -> HttpRequest:
483
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
484
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
485
-
486
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01"))
487
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
488
- accept = _headers.pop("Accept", "application/json")
489
-
490
- # Construct URL
491
- _url = kwargs.pop(
492
- "template_url",
493
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/extend",
494
- ) # pylint: disable=line-too-long
495
- path_format_arguments = {
496
- "resourceGroupName": _SERIALIZER.url(
497
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
498
- ),
499
- "accountName": _SERIALIZER.url("account_name", account_name, "str", max_length=24, min_length=3),
500
- "containerName": _SERIALIZER.url("container_name", container_name, "str", max_length=63, min_length=3),
501
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
502
- }
503
-
504
- _url: str = _url.format(**path_format_arguments) # type: ignore
505
-
506
- # Construct parameters
507
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
508
-
509
- # Construct headers
510
- _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str")
511
- if content_type is not None:
512
- _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
513
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
514
-
515
- return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
516
-
517
-
518
- def build_lease_request(
519
- resource_group_name: str, account_name: str, container_name: str, subscription_id: str, **kwargs: Any
520
- ) -> HttpRequest:
521
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
522
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
523
-
524
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01"))
525
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
526
- accept = _headers.pop("Accept", "application/json")
527
-
528
- # Construct URL
529
- _url = kwargs.pop(
530
- "template_url",
531
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/lease",
532
- ) # pylint: disable=line-too-long
533
- path_format_arguments = {
534
- "resourceGroupName": _SERIALIZER.url(
535
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
536
- ),
537
- "accountName": _SERIALIZER.url("account_name", account_name, "str", max_length=24, min_length=3),
538
- "containerName": _SERIALIZER.url("container_name", container_name, "str", max_length=63, min_length=3),
539
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
540
- }
541
-
542
- _url: str = _url.format(**path_format_arguments) # type: ignore
543
-
544
- # Construct parameters
545
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
546
-
547
- # Construct headers
548
- if content_type is not None:
549
- _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
550
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
551
-
552
- return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
553
-
554
-
555
- class BlobContainersOperations:
556
- """
557
- .. warning::
558
- **DO NOT** instantiate this class directly.
559
-
560
- Instead, you should access the following operations through
561
- :class:`~azure.mgmt.storage.v2019_06_01.StorageManagementClient`'s
562
- :attr:`blob_containers` attribute.
563
- """
564
-
565
- models = _models
566
-
567
- def __init__(self, *args, **kwargs):
568
- input_args = list(args)
569
- self._client = input_args.pop(0) if input_args else kwargs.pop("client")
570
- self._config = input_args.pop(0) if input_args else kwargs.pop("config")
571
- self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
572
- self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
573
- self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
574
-
575
- @distributed_trace
576
- def list(
577
- self,
578
- resource_group_name: str,
579
- account_name: str,
580
- maxpagesize: Optional[str] = None,
581
- filter: Optional[str] = None,
582
- include: Optional[Union[str, _models.ListContainersInclude]] = None,
583
- **kwargs: Any
584
- ) -> Iterable["_models.ListContainerItem"]:
585
- """Lists all containers and does not support a prefix like data plane. Also SRP today does not
586
- return continuation token.
587
-
588
- :param resource_group_name: The name of the resource group within the user's subscription. The
589
- name is case insensitive. Required.
590
- :type resource_group_name: str
591
- :param account_name: The name of the storage account within the specified resource group.
592
- Storage account names must be between 3 and 24 characters in length and use numbers and
593
- lower-case letters only. Required.
594
- :type account_name: str
595
- :param maxpagesize: Optional. Specified maximum number of containers that can be included in
596
- the list. Default value is None.
597
- :type maxpagesize: str
598
- :param filter: Optional. When specified, only container names starting with the filter will be
599
- listed. Default value is None.
600
- :type filter: str
601
- :param include: Optional, used to include the properties for soft deleted blob containers.
602
- "deleted" Default value is None.
603
- :type include: str or ~azure.mgmt.storage.v2019_06_01.models.ListContainersInclude
604
- :return: An iterator like instance of either ListContainerItem or the result of cls(response)
605
- :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2019_06_01.models.ListContainerItem]
606
- :raises ~azure.core.exceptions.HttpResponseError:
607
- """
608
- _headers = kwargs.pop("headers", {}) or {}
609
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
610
-
611
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
612
- cls: ClsType[_models.ListContainerItems] = kwargs.pop("cls", None)
613
-
614
- error_map: MutableMapping = {
615
- 401: ClientAuthenticationError,
616
- 404: ResourceNotFoundError,
617
- 409: ResourceExistsError,
618
- 304: ResourceNotModifiedError,
619
- }
620
- error_map.update(kwargs.pop("error_map", {}) or {})
621
-
622
- def prepare_request(next_link=None):
623
- if not next_link:
624
-
625
- _request = build_list_request(
626
- resource_group_name=resource_group_name,
627
- account_name=account_name,
628
- subscription_id=self._config.subscription_id,
629
- maxpagesize=maxpagesize,
630
- filter=filter,
631
- include=include,
632
- api_version=api_version,
633
- headers=_headers,
634
- params=_params,
635
- )
636
- _request.url = self._client.format_url(_request.url)
637
-
638
- else:
639
- # make call to next link with the client's api-version
640
- _parsed_next_link = urllib.parse.urlparse(next_link)
641
- _next_request_params = case_insensitive_dict(
642
- {
643
- key: [urllib.parse.quote(v) for v in value]
644
- for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
645
- }
646
- )
647
- _next_request_params["api-version"] = self._api_version
648
- _request = HttpRequest(
649
- "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
650
- )
651
- _request.url = self._client.format_url(_request.url)
652
- _request.method = "GET"
653
- return _request
654
-
655
- def extract_data(pipeline_response):
656
- deserialized = self._deserialize("ListContainerItems", pipeline_response)
657
- list_of_elem = deserialized.value
658
- if cls:
659
- list_of_elem = cls(list_of_elem) # type: ignore
660
- return deserialized.next_link or None, iter(list_of_elem)
661
-
662
- def get_next(next_link=None):
663
- _request = prepare_request(next_link)
664
-
665
- _stream = False
666
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
667
- _request, stream=_stream, **kwargs
668
- )
669
- response = pipeline_response.http_response
670
-
671
- if response.status_code not in [200]:
672
- map_error(status_code=response.status_code, response=response, error_map=error_map)
673
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
674
-
675
- return pipeline_response
676
-
677
- return ItemPaged(get_next, extract_data)
678
-
679
- @overload
680
- def create(
681
- self,
682
- resource_group_name: str,
683
- account_name: str,
684
- container_name: str,
685
- blob_container: _models.BlobContainer,
686
- *,
687
- content_type: str = "application/json",
688
- **kwargs: Any
689
- ) -> _models.BlobContainer:
690
- """Creates a new container under the specified account as described by request body. The container
691
- resource includes metadata and properties for that container. It does not include a list of the
692
- blobs contained by the container.
693
-
694
- :param resource_group_name: The name of the resource group within the user's subscription. The
695
- name is case insensitive. Required.
696
- :type resource_group_name: str
697
- :param account_name: The name of the storage account within the specified resource group.
698
- Storage account names must be between 3 and 24 characters in length and use numbers and
699
- lower-case letters only. Required.
700
- :type account_name: str
701
- :param container_name: The name of the blob container within the specified storage account.
702
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
703
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
704
- by a letter or number. Required.
705
- :type container_name: str
706
- :param blob_container: Properties of the blob container to create. Required.
707
- :type blob_container: ~azure.mgmt.storage.v2019_06_01.models.BlobContainer
708
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
709
- Default value is "application/json".
710
- :paramtype content_type: str
711
- :return: BlobContainer or the result of cls(response)
712
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.BlobContainer
713
- :raises ~azure.core.exceptions.HttpResponseError:
714
- """
715
-
716
- @overload
717
- def create(
718
- self,
719
- resource_group_name: str,
720
- account_name: str,
721
- container_name: str,
722
- blob_container: IO[bytes],
723
- *,
724
- content_type: str = "application/json",
725
- **kwargs: Any
726
- ) -> _models.BlobContainer:
727
- """Creates a new container under the specified account as described by request body. The container
728
- resource includes metadata and properties for that container. It does not include a list of the
729
- blobs contained by the container.
730
-
731
- :param resource_group_name: The name of the resource group within the user's subscription. The
732
- name is case insensitive. Required.
733
- :type resource_group_name: str
734
- :param account_name: The name of the storage account within the specified resource group.
735
- Storage account names must be between 3 and 24 characters in length and use numbers and
736
- lower-case letters only. Required.
737
- :type account_name: str
738
- :param container_name: The name of the blob container within the specified storage account.
739
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
740
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
741
- by a letter or number. Required.
742
- :type container_name: str
743
- :param blob_container: Properties of the blob container to create. Required.
744
- :type blob_container: IO[bytes]
745
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
746
- Default value is "application/json".
747
- :paramtype content_type: str
748
- :return: BlobContainer or the result of cls(response)
749
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.BlobContainer
750
- :raises ~azure.core.exceptions.HttpResponseError:
751
- """
752
-
753
- @distributed_trace
754
- def create(
755
- self,
756
- resource_group_name: str,
757
- account_name: str,
758
- container_name: str,
759
- blob_container: Union[_models.BlobContainer, IO[bytes]],
760
- **kwargs: Any
761
- ) -> _models.BlobContainer:
762
- """Creates a new container under the specified account as described by request body. The container
763
- resource includes metadata and properties for that container. It does not include a list of the
764
- blobs contained by the container.
765
-
766
- :param resource_group_name: The name of the resource group within the user's subscription. The
767
- name is case insensitive. Required.
768
- :type resource_group_name: str
769
- :param account_name: The name of the storage account within the specified resource group.
770
- Storage account names must be between 3 and 24 characters in length and use numbers and
771
- lower-case letters only. Required.
772
- :type account_name: str
773
- :param container_name: The name of the blob container within the specified storage account.
774
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
775
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
776
- by a letter or number. Required.
777
- :type container_name: str
778
- :param blob_container: Properties of the blob container to create. Is either a BlobContainer
779
- type or a IO[bytes] type. Required.
780
- :type blob_container: ~azure.mgmt.storage.v2019_06_01.models.BlobContainer or IO[bytes]
781
- :return: BlobContainer or the result of cls(response)
782
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.BlobContainer
783
- :raises ~azure.core.exceptions.HttpResponseError:
784
- """
785
- error_map: MutableMapping = {
786
- 401: ClientAuthenticationError,
787
- 404: ResourceNotFoundError,
788
- 409: ResourceExistsError,
789
- 304: ResourceNotModifiedError,
790
- }
791
- error_map.update(kwargs.pop("error_map", {}) or {})
792
-
793
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
794
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
795
-
796
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
797
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
798
- cls: ClsType[_models.BlobContainer] = kwargs.pop("cls", None)
799
-
800
- content_type = content_type or "application/json"
801
- _json = None
802
- _content = None
803
- if isinstance(blob_container, (IOBase, bytes)):
804
- _content = blob_container
805
- else:
806
- _json = self._serialize.body(blob_container, "BlobContainer")
807
-
808
- _request = build_create_request(
809
- resource_group_name=resource_group_name,
810
- account_name=account_name,
811
- container_name=container_name,
812
- subscription_id=self._config.subscription_id,
813
- api_version=api_version,
814
- content_type=content_type,
815
- json=_json,
816
- content=_content,
817
- headers=_headers,
818
- params=_params,
819
- )
820
- _request.url = self._client.format_url(_request.url)
821
-
822
- _stream = False
823
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
824
- _request, stream=_stream, **kwargs
825
- )
826
-
827
- response = pipeline_response.http_response
828
-
829
- if response.status_code not in [200, 201]:
830
- map_error(status_code=response.status_code, response=response, error_map=error_map)
831
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
832
-
833
- deserialized = self._deserialize("BlobContainer", pipeline_response.http_response)
834
-
835
- if cls:
836
- return cls(pipeline_response, deserialized, {}) # type: ignore
837
-
838
- return deserialized # type: ignore
839
-
840
- @overload
841
- def update(
842
- self,
843
- resource_group_name: str,
844
- account_name: str,
845
- container_name: str,
846
- blob_container: _models.BlobContainer,
847
- *,
848
- content_type: str = "application/json",
849
- **kwargs: Any
850
- ) -> _models.BlobContainer:
851
- """Updates container properties as specified in request body. Properties not mentioned in the
852
- request will be unchanged. Update fails if the specified container doesn't already exist.
853
-
854
- :param resource_group_name: The name of the resource group within the user's subscription. The
855
- name is case insensitive. Required.
856
- :type resource_group_name: str
857
- :param account_name: The name of the storage account within the specified resource group.
858
- Storage account names must be between 3 and 24 characters in length and use numbers and
859
- lower-case letters only. Required.
860
- :type account_name: str
861
- :param container_name: The name of the blob container within the specified storage account.
862
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
863
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
864
- by a letter or number. Required.
865
- :type container_name: str
866
- :param blob_container: Properties to update for the blob container. Required.
867
- :type blob_container: ~azure.mgmt.storage.v2019_06_01.models.BlobContainer
868
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
869
- Default value is "application/json".
870
- :paramtype content_type: str
871
- :return: BlobContainer or the result of cls(response)
872
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.BlobContainer
873
- :raises ~azure.core.exceptions.HttpResponseError:
874
- """
875
-
876
- @overload
877
- def update(
878
- self,
879
- resource_group_name: str,
880
- account_name: str,
881
- container_name: str,
882
- blob_container: IO[bytes],
883
- *,
884
- content_type: str = "application/json",
885
- **kwargs: Any
886
- ) -> _models.BlobContainer:
887
- """Updates container properties as specified in request body. Properties not mentioned in the
888
- request will be unchanged. Update fails if the specified container doesn't already exist.
889
-
890
- :param resource_group_name: The name of the resource group within the user's subscription. The
891
- name is case insensitive. Required.
892
- :type resource_group_name: str
893
- :param account_name: The name of the storage account within the specified resource group.
894
- Storage account names must be between 3 and 24 characters in length and use numbers and
895
- lower-case letters only. Required.
896
- :type account_name: str
897
- :param container_name: The name of the blob container within the specified storage account.
898
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
899
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
900
- by a letter or number. Required.
901
- :type container_name: str
902
- :param blob_container: Properties to update for the blob container. Required.
903
- :type blob_container: IO[bytes]
904
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
905
- Default value is "application/json".
906
- :paramtype content_type: str
907
- :return: BlobContainer or the result of cls(response)
908
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.BlobContainer
909
- :raises ~azure.core.exceptions.HttpResponseError:
910
- """
911
-
912
- @distributed_trace
913
- def update(
914
- self,
915
- resource_group_name: str,
916
- account_name: str,
917
- container_name: str,
918
- blob_container: Union[_models.BlobContainer, IO[bytes]],
919
- **kwargs: Any
920
- ) -> _models.BlobContainer:
921
- """Updates container properties as specified in request body. Properties not mentioned in the
922
- request will be unchanged. Update fails if the specified container doesn't already exist.
923
-
924
- :param resource_group_name: The name of the resource group within the user's subscription. The
925
- name is case insensitive. Required.
926
- :type resource_group_name: str
927
- :param account_name: The name of the storage account within the specified resource group.
928
- Storage account names must be between 3 and 24 characters in length and use numbers and
929
- lower-case letters only. Required.
930
- :type account_name: str
931
- :param container_name: The name of the blob container within the specified storage account.
932
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
933
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
934
- by a letter or number. Required.
935
- :type container_name: str
936
- :param blob_container: Properties to update for the blob container. Is either a BlobContainer
937
- type or a IO[bytes] type. Required.
938
- :type blob_container: ~azure.mgmt.storage.v2019_06_01.models.BlobContainer or IO[bytes]
939
- :return: BlobContainer or the result of cls(response)
940
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.BlobContainer
941
- :raises ~azure.core.exceptions.HttpResponseError:
942
- """
943
- error_map: MutableMapping = {
944
- 401: ClientAuthenticationError,
945
- 404: ResourceNotFoundError,
946
- 409: ResourceExistsError,
947
- 304: ResourceNotModifiedError,
948
- }
949
- error_map.update(kwargs.pop("error_map", {}) or {})
950
-
951
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
952
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
953
-
954
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
955
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
956
- cls: ClsType[_models.BlobContainer] = kwargs.pop("cls", None)
957
-
958
- content_type = content_type or "application/json"
959
- _json = None
960
- _content = None
961
- if isinstance(blob_container, (IOBase, bytes)):
962
- _content = blob_container
963
- else:
964
- _json = self._serialize.body(blob_container, "BlobContainer")
965
-
966
- _request = build_update_request(
967
- resource_group_name=resource_group_name,
968
- account_name=account_name,
969
- container_name=container_name,
970
- subscription_id=self._config.subscription_id,
971
- api_version=api_version,
972
- content_type=content_type,
973
- json=_json,
974
- content=_content,
975
- headers=_headers,
976
- params=_params,
977
- )
978
- _request.url = self._client.format_url(_request.url)
979
-
980
- _stream = False
981
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
982
- _request, stream=_stream, **kwargs
983
- )
984
-
985
- response = pipeline_response.http_response
986
-
987
- if response.status_code not in [200]:
988
- map_error(status_code=response.status_code, response=response, error_map=error_map)
989
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
990
-
991
- deserialized = self._deserialize("BlobContainer", pipeline_response.http_response)
992
-
993
- if cls:
994
- return cls(pipeline_response, deserialized, {}) # type: ignore
995
-
996
- return deserialized # type: ignore
997
-
998
- @distributed_trace
999
- def get(
1000
- self, resource_group_name: str, account_name: str, container_name: str, **kwargs: Any
1001
- ) -> _models.BlobContainer:
1002
- """Gets properties of a specified container.
1003
-
1004
- :param resource_group_name: The name of the resource group within the user's subscription. The
1005
- name is case insensitive. Required.
1006
- :type resource_group_name: str
1007
- :param account_name: The name of the storage account within the specified resource group.
1008
- Storage account names must be between 3 and 24 characters in length and use numbers and
1009
- lower-case letters only. Required.
1010
- :type account_name: str
1011
- :param container_name: The name of the blob container within the specified storage account.
1012
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
1013
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
1014
- by a letter or number. Required.
1015
- :type container_name: str
1016
- :return: BlobContainer or the result of cls(response)
1017
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.BlobContainer
1018
- :raises ~azure.core.exceptions.HttpResponseError:
1019
- """
1020
- error_map: MutableMapping = {
1021
- 401: ClientAuthenticationError,
1022
- 404: ResourceNotFoundError,
1023
- 409: ResourceExistsError,
1024
- 304: ResourceNotModifiedError,
1025
- }
1026
- error_map.update(kwargs.pop("error_map", {}) or {})
1027
-
1028
- _headers = kwargs.pop("headers", {}) or {}
1029
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
1030
-
1031
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
1032
- cls: ClsType[_models.BlobContainer] = kwargs.pop("cls", None)
1033
-
1034
- _request = build_get_request(
1035
- resource_group_name=resource_group_name,
1036
- account_name=account_name,
1037
- container_name=container_name,
1038
- subscription_id=self._config.subscription_id,
1039
- api_version=api_version,
1040
- headers=_headers,
1041
- params=_params,
1042
- )
1043
- _request.url = self._client.format_url(_request.url)
1044
-
1045
- _stream = False
1046
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
1047
- _request, stream=_stream, **kwargs
1048
- )
1049
-
1050
- response = pipeline_response.http_response
1051
-
1052
- if response.status_code not in [200]:
1053
- map_error(status_code=response.status_code, response=response, error_map=error_map)
1054
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
1055
-
1056
- deserialized = self._deserialize("BlobContainer", pipeline_response.http_response)
1057
-
1058
- if cls:
1059
- return cls(pipeline_response, deserialized, {}) # type: ignore
1060
-
1061
- return deserialized # type: ignore
1062
-
1063
- @distributed_trace
1064
- def delete( # pylint: disable=inconsistent-return-statements
1065
- self, resource_group_name: str, account_name: str, container_name: str, **kwargs: Any
1066
- ) -> None:
1067
- """Deletes specified container under its account.
1068
-
1069
- :param resource_group_name: The name of the resource group within the user's subscription. The
1070
- name is case insensitive. Required.
1071
- :type resource_group_name: str
1072
- :param account_name: The name of the storage account within the specified resource group.
1073
- Storage account names must be between 3 and 24 characters in length and use numbers and
1074
- lower-case letters only. Required.
1075
- :type account_name: str
1076
- :param container_name: The name of the blob container within the specified storage account.
1077
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
1078
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
1079
- by a letter or number. Required.
1080
- :type container_name: str
1081
- :return: None or the result of cls(response)
1082
- :rtype: None
1083
- :raises ~azure.core.exceptions.HttpResponseError:
1084
- """
1085
- error_map: MutableMapping = {
1086
- 401: ClientAuthenticationError,
1087
- 404: ResourceNotFoundError,
1088
- 409: ResourceExistsError,
1089
- 304: ResourceNotModifiedError,
1090
- }
1091
- error_map.update(kwargs.pop("error_map", {}) or {})
1092
-
1093
- _headers = kwargs.pop("headers", {}) or {}
1094
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
1095
-
1096
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
1097
- cls: ClsType[None] = kwargs.pop("cls", None)
1098
-
1099
- _request = build_delete_request(
1100
- resource_group_name=resource_group_name,
1101
- account_name=account_name,
1102
- container_name=container_name,
1103
- subscription_id=self._config.subscription_id,
1104
- api_version=api_version,
1105
- headers=_headers,
1106
- params=_params,
1107
- )
1108
- _request.url = self._client.format_url(_request.url)
1109
-
1110
- _stream = False
1111
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
1112
- _request, stream=_stream, **kwargs
1113
- )
1114
-
1115
- response = pipeline_response.http_response
1116
-
1117
- if response.status_code not in [200, 204]:
1118
- map_error(status_code=response.status_code, response=response, error_map=error_map)
1119
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
1120
-
1121
- if cls:
1122
- return cls(pipeline_response, None, {}) # type: ignore
1123
-
1124
- @overload
1125
- def set_legal_hold(
1126
- self,
1127
- resource_group_name: str,
1128
- account_name: str,
1129
- container_name: str,
1130
- legal_hold: _models.LegalHold,
1131
- *,
1132
- content_type: str = "application/json",
1133
- **kwargs: Any
1134
- ) -> _models.LegalHold:
1135
- """Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold
1136
- follows an append pattern and does not clear out the existing tags that are not specified in
1137
- the request.
1138
-
1139
- :param resource_group_name: The name of the resource group within the user's subscription. The
1140
- name is case insensitive. Required.
1141
- :type resource_group_name: str
1142
- :param account_name: The name of the storage account within the specified resource group.
1143
- Storage account names must be between 3 and 24 characters in length and use numbers and
1144
- lower-case letters only. Required.
1145
- :type account_name: str
1146
- :param container_name: The name of the blob container within the specified storage account.
1147
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
1148
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
1149
- by a letter or number. Required.
1150
- :type container_name: str
1151
- :param legal_hold: The LegalHold property that will be set to a blob container. Required.
1152
- :type legal_hold: ~azure.mgmt.storage.v2019_06_01.models.LegalHold
1153
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
1154
- Default value is "application/json".
1155
- :paramtype content_type: str
1156
- :return: LegalHold or the result of cls(response)
1157
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.LegalHold
1158
- :raises ~azure.core.exceptions.HttpResponseError:
1159
- """
1160
-
1161
- @overload
1162
- def set_legal_hold(
1163
- self,
1164
- resource_group_name: str,
1165
- account_name: str,
1166
- container_name: str,
1167
- legal_hold: IO[bytes],
1168
- *,
1169
- content_type: str = "application/json",
1170
- **kwargs: Any
1171
- ) -> _models.LegalHold:
1172
- """Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold
1173
- follows an append pattern and does not clear out the existing tags that are not specified in
1174
- the request.
1175
-
1176
- :param resource_group_name: The name of the resource group within the user's subscription. The
1177
- name is case insensitive. Required.
1178
- :type resource_group_name: str
1179
- :param account_name: The name of the storage account within the specified resource group.
1180
- Storage account names must be between 3 and 24 characters in length and use numbers and
1181
- lower-case letters only. Required.
1182
- :type account_name: str
1183
- :param container_name: The name of the blob container within the specified storage account.
1184
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
1185
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
1186
- by a letter or number. Required.
1187
- :type container_name: str
1188
- :param legal_hold: The LegalHold property that will be set to a blob container. Required.
1189
- :type legal_hold: IO[bytes]
1190
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
1191
- Default value is "application/json".
1192
- :paramtype content_type: str
1193
- :return: LegalHold or the result of cls(response)
1194
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.LegalHold
1195
- :raises ~azure.core.exceptions.HttpResponseError:
1196
- """
1197
-
1198
- @distributed_trace
1199
- def set_legal_hold(
1200
- self,
1201
- resource_group_name: str,
1202
- account_name: str,
1203
- container_name: str,
1204
- legal_hold: Union[_models.LegalHold, IO[bytes]],
1205
- **kwargs: Any
1206
- ) -> _models.LegalHold:
1207
- """Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold
1208
- follows an append pattern and does not clear out the existing tags that are not specified in
1209
- the request.
1210
-
1211
- :param resource_group_name: The name of the resource group within the user's subscription. The
1212
- name is case insensitive. Required.
1213
- :type resource_group_name: str
1214
- :param account_name: The name of the storage account within the specified resource group.
1215
- Storage account names must be between 3 and 24 characters in length and use numbers and
1216
- lower-case letters only. Required.
1217
- :type account_name: str
1218
- :param container_name: The name of the blob container within the specified storage account.
1219
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
1220
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
1221
- by a letter or number. Required.
1222
- :type container_name: str
1223
- :param legal_hold: The LegalHold property that will be set to a blob container. Is either a
1224
- LegalHold type or a IO[bytes] type. Required.
1225
- :type legal_hold: ~azure.mgmt.storage.v2019_06_01.models.LegalHold or IO[bytes]
1226
- :return: LegalHold or the result of cls(response)
1227
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.LegalHold
1228
- :raises ~azure.core.exceptions.HttpResponseError:
1229
- """
1230
- error_map: MutableMapping = {
1231
- 401: ClientAuthenticationError,
1232
- 404: ResourceNotFoundError,
1233
- 409: ResourceExistsError,
1234
- 304: ResourceNotModifiedError,
1235
- }
1236
- error_map.update(kwargs.pop("error_map", {}) or {})
1237
-
1238
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
1239
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
1240
-
1241
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
1242
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
1243
- cls: ClsType[_models.LegalHold] = kwargs.pop("cls", None)
1244
-
1245
- content_type = content_type or "application/json"
1246
- _json = None
1247
- _content = None
1248
- if isinstance(legal_hold, (IOBase, bytes)):
1249
- _content = legal_hold
1250
- else:
1251
- _json = self._serialize.body(legal_hold, "LegalHold")
1252
-
1253
- _request = build_set_legal_hold_request(
1254
- resource_group_name=resource_group_name,
1255
- account_name=account_name,
1256
- container_name=container_name,
1257
- subscription_id=self._config.subscription_id,
1258
- api_version=api_version,
1259
- content_type=content_type,
1260
- json=_json,
1261
- content=_content,
1262
- headers=_headers,
1263
- params=_params,
1264
- )
1265
- _request.url = self._client.format_url(_request.url)
1266
-
1267
- _stream = False
1268
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
1269
- _request, stream=_stream, **kwargs
1270
- )
1271
-
1272
- response = pipeline_response.http_response
1273
-
1274
- if response.status_code not in [200]:
1275
- map_error(status_code=response.status_code, response=response, error_map=error_map)
1276
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
1277
-
1278
- deserialized = self._deserialize("LegalHold", pipeline_response.http_response)
1279
-
1280
- if cls:
1281
- return cls(pipeline_response, deserialized, {}) # type: ignore
1282
-
1283
- return deserialized # type: ignore
1284
-
1285
- @overload
1286
- def clear_legal_hold(
1287
- self,
1288
- resource_group_name: str,
1289
- account_name: str,
1290
- container_name: str,
1291
- legal_hold: _models.LegalHold,
1292
- *,
1293
- content_type: str = "application/json",
1294
- **kwargs: Any
1295
- ) -> _models.LegalHold:
1296
- """Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent
1297
- operation. ClearLegalHold clears out only the specified tags in the request.
1298
-
1299
- :param resource_group_name: The name of the resource group within the user's subscription. The
1300
- name is case insensitive. Required.
1301
- :type resource_group_name: str
1302
- :param account_name: The name of the storage account within the specified resource group.
1303
- Storage account names must be between 3 and 24 characters in length and use numbers and
1304
- lower-case letters only. Required.
1305
- :type account_name: str
1306
- :param container_name: The name of the blob container within the specified storage account.
1307
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
1308
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
1309
- by a letter or number. Required.
1310
- :type container_name: str
1311
- :param legal_hold: The LegalHold property that will be clear from a blob container. Required.
1312
- :type legal_hold: ~azure.mgmt.storage.v2019_06_01.models.LegalHold
1313
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
1314
- Default value is "application/json".
1315
- :paramtype content_type: str
1316
- :return: LegalHold or the result of cls(response)
1317
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.LegalHold
1318
- :raises ~azure.core.exceptions.HttpResponseError:
1319
- """
1320
-
1321
- @overload
1322
- def clear_legal_hold(
1323
- self,
1324
- resource_group_name: str,
1325
- account_name: str,
1326
- container_name: str,
1327
- legal_hold: IO[bytes],
1328
- *,
1329
- content_type: str = "application/json",
1330
- **kwargs: Any
1331
- ) -> _models.LegalHold:
1332
- """Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent
1333
- operation. ClearLegalHold clears out only the specified tags in the request.
1334
-
1335
- :param resource_group_name: The name of the resource group within the user's subscription. The
1336
- name is case insensitive. Required.
1337
- :type resource_group_name: str
1338
- :param account_name: The name of the storage account within the specified resource group.
1339
- Storage account names must be between 3 and 24 characters in length and use numbers and
1340
- lower-case letters only. Required.
1341
- :type account_name: str
1342
- :param container_name: The name of the blob container within the specified storage account.
1343
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
1344
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
1345
- by a letter or number. Required.
1346
- :type container_name: str
1347
- :param legal_hold: The LegalHold property that will be clear from a blob container. Required.
1348
- :type legal_hold: IO[bytes]
1349
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
1350
- Default value is "application/json".
1351
- :paramtype content_type: str
1352
- :return: LegalHold or the result of cls(response)
1353
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.LegalHold
1354
- :raises ~azure.core.exceptions.HttpResponseError:
1355
- """
1356
-
1357
- @distributed_trace
1358
- def clear_legal_hold(
1359
- self,
1360
- resource_group_name: str,
1361
- account_name: str,
1362
- container_name: str,
1363
- legal_hold: Union[_models.LegalHold, IO[bytes]],
1364
- **kwargs: Any
1365
- ) -> _models.LegalHold:
1366
- """Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent
1367
- operation. ClearLegalHold clears out only the specified tags in the request.
1368
-
1369
- :param resource_group_name: The name of the resource group within the user's subscription. The
1370
- name is case insensitive. Required.
1371
- :type resource_group_name: str
1372
- :param account_name: The name of the storage account within the specified resource group.
1373
- Storage account names must be between 3 and 24 characters in length and use numbers and
1374
- lower-case letters only. Required.
1375
- :type account_name: str
1376
- :param container_name: The name of the blob container within the specified storage account.
1377
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
1378
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
1379
- by a letter or number. Required.
1380
- :type container_name: str
1381
- :param legal_hold: The LegalHold property that will be clear from a blob container. Is either a
1382
- LegalHold type or a IO[bytes] type. Required.
1383
- :type legal_hold: ~azure.mgmt.storage.v2019_06_01.models.LegalHold or IO[bytes]
1384
- :return: LegalHold or the result of cls(response)
1385
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.LegalHold
1386
- :raises ~azure.core.exceptions.HttpResponseError:
1387
- """
1388
- error_map: MutableMapping = {
1389
- 401: ClientAuthenticationError,
1390
- 404: ResourceNotFoundError,
1391
- 409: ResourceExistsError,
1392
- 304: ResourceNotModifiedError,
1393
- }
1394
- error_map.update(kwargs.pop("error_map", {}) or {})
1395
-
1396
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
1397
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
1398
-
1399
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
1400
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
1401
- cls: ClsType[_models.LegalHold] = kwargs.pop("cls", None)
1402
-
1403
- content_type = content_type or "application/json"
1404
- _json = None
1405
- _content = None
1406
- if isinstance(legal_hold, (IOBase, bytes)):
1407
- _content = legal_hold
1408
- else:
1409
- _json = self._serialize.body(legal_hold, "LegalHold")
1410
-
1411
- _request = build_clear_legal_hold_request(
1412
- resource_group_name=resource_group_name,
1413
- account_name=account_name,
1414
- container_name=container_name,
1415
- subscription_id=self._config.subscription_id,
1416
- api_version=api_version,
1417
- content_type=content_type,
1418
- json=_json,
1419
- content=_content,
1420
- headers=_headers,
1421
- params=_params,
1422
- )
1423
- _request.url = self._client.format_url(_request.url)
1424
-
1425
- _stream = False
1426
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
1427
- _request, stream=_stream, **kwargs
1428
- )
1429
-
1430
- response = pipeline_response.http_response
1431
-
1432
- if response.status_code not in [200]:
1433
- map_error(status_code=response.status_code, response=response, error_map=error_map)
1434
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
1435
-
1436
- deserialized = self._deserialize("LegalHold", pipeline_response.http_response)
1437
-
1438
- if cls:
1439
- return cls(pipeline_response, deserialized, {}) # type: ignore
1440
-
1441
- return deserialized # type: ignore
1442
-
1443
- @overload
1444
- def create_or_update_immutability_policy(
1445
- self,
1446
- resource_group_name: str,
1447
- account_name: str,
1448
- container_name: str,
1449
- immutability_policy_name: Union[str, _models.Enum27],
1450
- if_match: Optional[str] = None,
1451
- parameters: Optional[_models.ImmutabilityPolicy] = None,
1452
- *,
1453
- content_type: str = "application/json",
1454
- **kwargs: Any
1455
- ) -> _models.ImmutabilityPolicy:
1456
- """Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but
1457
- not required for this operation.
1458
-
1459
- :param resource_group_name: The name of the resource group within the user's subscription. The
1460
- name is case insensitive. Required.
1461
- :type resource_group_name: str
1462
- :param account_name: The name of the storage account within the specified resource group.
1463
- Storage account names must be between 3 and 24 characters in length and use numbers and
1464
- lower-case letters only. Required.
1465
- :type account_name: str
1466
- :param container_name: The name of the blob container within the specified storage account.
1467
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
1468
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
1469
- by a letter or number. Required.
1470
- :type container_name: str
1471
- :param immutability_policy_name: The name of the blob container immutabilityPolicy within the
1472
- specified storage account. ImmutabilityPolicy Name must be 'default'. "default" Required.
1473
- :type immutability_policy_name: str or ~azure.mgmt.storage.v2019_06_01.models.Enum27
1474
- :param if_match: The entity state (ETag) version of the immutability policy to update. A value
1475
- of "*" can be used to apply the operation only if the immutability policy already exists. If
1476
- omitted, this operation will always be applied. Default value is None.
1477
- :type if_match: str
1478
- :param parameters: The ImmutabilityPolicy Properties that will be created or updated to a blob
1479
- container. Default value is None.
1480
- :type parameters: ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicy
1481
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
1482
- Default value is "application/json".
1483
- :paramtype content_type: str
1484
- :return: ImmutabilityPolicy or the result of cls(response)
1485
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicy
1486
- :raises ~azure.core.exceptions.HttpResponseError:
1487
- """
1488
-
1489
- @overload
1490
- def create_or_update_immutability_policy(
1491
- self,
1492
- resource_group_name: str,
1493
- account_name: str,
1494
- container_name: str,
1495
- immutability_policy_name: Union[str, _models.Enum27],
1496
- if_match: Optional[str] = None,
1497
- parameters: Optional[IO[bytes]] = None,
1498
- *,
1499
- content_type: str = "application/json",
1500
- **kwargs: Any
1501
- ) -> _models.ImmutabilityPolicy:
1502
- """Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but
1503
- not required for this operation.
1504
-
1505
- :param resource_group_name: The name of the resource group within the user's subscription. The
1506
- name is case insensitive. Required.
1507
- :type resource_group_name: str
1508
- :param account_name: The name of the storage account within the specified resource group.
1509
- Storage account names must be between 3 and 24 characters in length and use numbers and
1510
- lower-case letters only. Required.
1511
- :type account_name: str
1512
- :param container_name: The name of the blob container within the specified storage account.
1513
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
1514
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
1515
- by a letter or number. Required.
1516
- :type container_name: str
1517
- :param immutability_policy_name: The name of the blob container immutabilityPolicy within the
1518
- specified storage account. ImmutabilityPolicy Name must be 'default'. "default" Required.
1519
- :type immutability_policy_name: str or ~azure.mgmt.storage.v2019_06_01.models.Enum27
1520
- :param if_match: The entity state (ETag) version of the immutability policy to update. A value
1521
- of "*" can be used to apply the operation only if the immutability policy already exists. If
1522
- omitted, this operation will always be applied. Default value is None.
1523
- :type if_match: str
1524
- :param parameters: The ImmutabilityPolicy Properties that will be created or updated to a blob
1525
- container. Default value is None.
1526
- :type parameters: IO[bytes]
1527
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
1528
- Default value is "application/json".
1529
- :paramtype content_type: str
1530
- :return: ImmutabilityPolicy or the result of cls(response)
1531
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicy
1532
- :raises ~azure.core.exceptions.HttpResponseError:
1533
- """
1534
-
1535
- @distributed_trace
1536
- def create_or_update_immutability_policy(
1537
- self,
1538
- resource_group_name: str,
1539
- account_name: str,
1540
- container_name: str,
1541
- immutability_policy_name: Union[str, _models.Enum27],
1542
- if_match: Optional[str] = None,
1543
- parameters: Optional[Union[_models.ImmutabilityPolicy, IO[bytes]]] = None,
1544
- **kwargs: Any
1545
- ) -> _models.ImmutabilityPolicy:
1546
- """Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but
1547
- not required for this operation.
1548
-
1549
- :param resource_group_name: The name of the resource group within the user's subscription. The
1550
- name is case insensitive. Required.
1551
- :type resource_group_name: str
1552
- :param account_name: The name of the storage account within the specified resource group.
1553
- Storage account names must be between 3 and 24 characters in length and use numbers and
1554
- lower-case letters only. Required.
1555
- :type account_name: str
1556
- :param container_name: The name of the blob container within the specified storage account.
1557
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
1558
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
1559
- by a letter or number. Required.
1560
- :type container_name: str
1561
- :param immutability_policy_name: The name of the blob container immutabilityPolicy within the
1562
- specified storage account. ImmutabilityPolicy Name must be 'default'. "default" Required.
1563
- :type immutability_policy_name: str or ~azure.mgmt.storage.v2019_06_01.models.Enum27
1564
- :param if_match: The entity state (ETag) version of the immutability policy to update. A value
1565
- of "*" can be used to apply the operation only if the immutability policy already exists. If
1566
- omitted, this operation will always be applied. Default value is None.
1567
- :type if_match: str
1568
- :param parameters: The ImmutabilityPolicy Properties that will be created or updated to a blob
1569
- container. Is either a ImmutabilityPolicy type or a IO[bytes] type. Default value is None.
1570
- :type parameters: ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicy or IO[bytes]
1571
- :return: ImmutabilityPolicy or the result of cls(response)
1572
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicy
1573
- :raises ~azure.core.exceptions.HttpResponseError:
1574
- """
1575
- error_map: MutableMapping = {
1576
- 401: ClientAuthenticationError,
1577
- 404: ResourceNotFoundError,
1578
- 409: ResourceExistsError,
1579
- 304: ResourceNotModifiedError,
1580
- }
1581
- error_map.update(kwargs.pop("error_map", {}) or {})
1582
-
1583
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
1584
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
1585
-
1586
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
1587
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
1588
- cls: ClsType[_models.ImmutabilityPolicy] = kwargs.pop("cls", None)
1589
-
1590
- content_type = content_type or "application/json"
1591
- _json = None
1592
- _content = None
1593
- if isinstance(parameters, (IOBase, bytes)):
1594
- _content = parameters
1595
- else:
1596
- if parameters is not None:
1597
- _json = self._serialize.body(parameters, "ImmutabilityPolicy")
1598
- else:
1599
- _json = None
1600
-
1601
- _request = build_create_or_update_immutability_policy_request(
1602
- resource_group_name=resource_group_name,
1603
- account_name=account_name,
1604
- container_name=container_name,
1605
- immutability_policy_name=immutability_policy_name,
1606
- subscription_id=self._config.subscription_id,
1607
- if_match=if_match,
1608
- api_version=api_version,
1609
- content_type=content_type,
1610
- json=_json,
1611
- content=_content,
1612
- headers=_headers,
1613
- params=_params,
1614
- )
1615
- _request.url = self._client.format_url(_request.url)
1616
-
1617
- _stream = False
1618
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
1619
- _request, stream=_stream, **kwargs
1620
- )
1621
-
1622
- response = pipeline_response.http_response
1623
-
1624
- if response.status_code not in [200]:
1625
- map_error(status_code=response.status_code, response=response, error_map=error_map)
1626
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
1627
-
1628
- response_headers = {}
1629
- response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag"))
1630
-
1631
- deserialized = self._deserialize("ImmutabilityPolicy", pipeline_response.http_response)
1632
-
1633
- if cls:
1634
- return cls(pipeline_response, deserialized, response_headers) # type: ignore
1635
-
1636
- return deserialized # type: ignore
1637
-
1638
- @distributed_trace
1639
- def get_immutability_policy(
1640
- self,
1641
- resource_group_name: str,
1642
- account_name: str,
1643
- container_name: str,
1644
- immutability_policy_name: Union[str, _models.Enum27],
1645
- if_match: Optional[str] = None,
1646
- **kwargs: Any
1647
- ) -> _models.ImmutabilityPolicy:
1648
- """Gets the existing immutability policy along with the corresponding ETag in response headers and
1649
- body.
1650
-
1651
- :param resource_group_name: The name of the resource group within the user's subscription. The
1652
- name is case insensitive. Required.
1653
- :type resource_group_name: str
1654
- :param account_name: The name of the storage account within the specified resource group.
1655
- Storage account names must be between 3 and 24 characters in length and use numbers and
1656
- lower-case letters only. Required.
1657
- :type account_name: str
1658
- :param container_name: The name of the blob container within the specified storage account.
1659
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
1660
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
1661
- by a letter or number. Required.
1662
- :type container_name: str
1663
- :param immutability_policy_name: The name of the blob container immutabilityPolicy within the
1664
- specified storage account. ImmutabilityPolicy Name must be 'default'. "default" Required.
1665
- :type immutability_policy_name: str or ~azure.mgmt.storage.v2019_06_01.models.Enum27
1666
- :param if_match: The entity state (ETag) version of the immutability policy to update. A value
1667
- of "*" can be used to apply the operation only if the immutability policy already exists. If
1668
- omitted, this operation will always be applied. Default value is None.
1669
- :type if_match: str
1670
- :return: ImmutabilityPolicy or the result of cls(response)
1671
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicy
1672
- :raises ~azure.core.exceptions.HttpResponseError:
1673
- """
1674
- error_map: MutableMapping = {
1675
- 401: ClientAuthenticationError,
1676
- 404: ResourceNotFoundError,
1677
- 409: ResourceExistsError,
1678
- 304: ResourceNotModifiedError,
1679
- }
1680
- error_map.update(kwargs.pop("error_map", {}) or {})
1681
-
1682
- _headers = kwargs.pop("headers", {}) or {}
1683
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
1684
-
1685
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
1686
- cls: ClsType[_models.ImmutabilityPolicy] = kwargs.pop("cls", None)
1687
-
1688
- _request = build_get_immutability_policy_request(
1689
- resource_group_name=resource_group_name,
1690
- account_name=account_name,
1691
- container_name=container_name,
1692
- immutability_policy_name=immutability_policy_name,
1693
- subscription_id=self._config.subscription_id,
1694
- if_match=if_match,
1695
- api_version=api_version,
1696
- headers=_headers,
1697
- params=_params,
1698
- )
1699
- _request.url = self._client.format_url(_request.url)
1700
-
1701
- _stream = False
1702
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
1703
- _request, stream=_stream, **kwargs
1704
- )
1705
-
1706
- response = pipeline_response.http_response
1707
-
1708
- if response.status_code not in [200]:
1709
- map_error(status_code=response.status_code, response=response, error_map=error_map)
1710
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
1711
-
1712
- response_headers = {}
1713
- response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag"))
1714
-
1715
- deserialized = self._deserialize("ImmutabilityPolicy", pipeline_response.http_response)
1716
-
1717
- if cls:
1718
- return cls(pipeline_response, deserialized, response_headers) # type: ignore
1719
-
1720
- return deserialized # type: ignore
1721
-
1722
- @distributed_trace
1723
- def delete_immutability_policy(
1724
- self,
1725
- resource_group_name: str,
1726
- account_name: str,
1727
- container_name: str,
1728
- immutability_policy_name: Union[str, _models.Enum27],
1729
- if_match: str,
1730
- **kwargs: Any
1731
- ) -> _models.ImmutabilityPolicy:
1732
- """Aborts an unlocked immutability policy. The response of delete has
1733
- immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this
1734
- operation. Deleting a locked immutability policy is not allowed, the only way is to delete the
1735
- container after deleting all expired blobs inside the policy locked container.
1736
-
1737
- :param resource_group_name: The name of the resource group within the user's subscription. The
1738
- name is case insensitive. Required.
1739
- :type resource_group_name: str
1740
- :param account_name: The name of the storage account within the specified resource group.
1741
- Storage account names must be between 3 and 24 characters in length and use numbers and
1742
- lower-case letters only. Required.
1743
- :type account_name: str
1744
- :param container_name: The name of the blob container within the specified storage account.
1745
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
1746
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
1747
- by a letter or number. Required.
1748
- :type container_name: str
1749
- :param immutability_policy_name: The name of the blob container immutabilityPolicy within the
1750
- specified storage account. ImmutabilityPolicy Name must be 'default'. "default" Required.
1751
- :type immutability_policy_name: str or ~azure.mgmt.storage.v2019_06_01.models.Enum27
1752
- :param if_match: The entity state (ETag) version of the immutability policy to update. A value
1753
- of "*" can be used to apply the operation only if the immutability policy already exists. If
1754
- omitted, this operation will always be applied. Required.
1755
- :type if_match: str
1756
- :return: ImmutabilityPolicy or the result of cls(response)
1757
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicy
1758
- :raises ~azure.core.exceptions.HttpResponseError:
1759
- """
1760
- error_map: MutableMapping = {
1761
- 401: ClientAuthenticationError,
1762
- 404: ResourceNotFoundError,
1763
- 409: ResourceExistsError,
1764
- 304: ResourceNotModifiedError,
1765
- }
1766
- error_map.update(kwargs.pop("error_map", {}) or {})
1767
-
1768
- _headers = kwargs.pop("headers", {}) or {}
1769
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
1770
-
1771
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
1772
- cls: ClsType[_models.ImmutabilityPolicy] = kwargs.pop("cls", None)
1773
-
1774
- _request = build_delete_immutability_policy_request(
1775
- resource_group_name=resource_group_name,
1776
- account_name=account_name,
1777
- container_name=container_name,
1778
- immutability_policy_name=immutability_policy_name,
1779
- subscription_id=self._config.subscription_id,
1780
- if_match=if_match,
1781
- api_version=api_version,
1782
- headers=_headers,
1783
- params=_params,
1784
- )
1785
- _request.url = self._client.format_url(_request.url)
1786
-
1787
- _stream = False
1788
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
1789
- _request, stream=_stream, **kwargs
1790
- )
1791
-
1792
- response = pipeline_response.http_response
1793
-
1794
- if response.status_code not in [200]:
1795
- map_error(status_code=response.status_code, response=response, error_map=error_map)
1796
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
1797
-
1798
- response_headers = {}
1799
- response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag"))
1800
-
1801
- deserialized = self._deserialize("ImmutabilityPolicy", pipeline_response.http_response)
1802
-
1803
- if cls:
1804
- return cls(pipeline_response, deserialized, response_headers) # type: ignore
1805
-
1806
- return deserialized # type: ignore
1807
-
1808
- @distributed_trace
1809
- def lock_immutability_policy(
1810
- self, resource_group_name: str, account_name: str, container_name: str, if_match: str, **kwargs: Any
1811
- ) -> _models.ImmutabilityPolicy:
1812
- """Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is
1813
- ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation.
1814
-
1815
- :param resource_group_name: The name of the resource group within the user's subscription. The
1816
- name is case insensitive. Required.
1817
- :type resource_group_name: str
1818
- :param account_name: The name of the storage account within the specified resource group.
1819
- Storage account names must be between 3 and 24 characters in length and use numbers and
1820
- lower-case letters only. Required.
1821
- :type account_name: str
1822
- :param container_name: The name of the blob container within the specified storage account.
1823
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
1824
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
1825
- by a letter or number. Required.
1826
- :type container_name: str
1827
- :param if_match: The entity state (ETag) version of the immutability policy to update. A value
1828
- of "*" can be used to apply the operation only if the immutability policy already exists. If
1829
- omitted, this operation will always be applied. Required.
1830
- :type if_match: str
1831
- :return: ImmutabilityPolicy or the result of cls(response)
1832
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicy
1833
- :raises ~azure.core.exceptions.HttpResponseError:
1834
- """
1835
- error_map: MutableMapping = {
1836
- 401: ClientAuthenticationError,
1837
- 404: ResourceNotFoundError,
1838
- 409: ResourceExistsError,
1839
- 304: ResourceNotModifiedError,
1840
- }
1841
- error_map.update(kwargs.pop("error_map", {}) or {})
1842
-
1843
- _headers = kwargs.pop("headers", {}) or {}
1844
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
1845
-
1846
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
1847
- cls: ClsType[_models.ImmutabilityPolicy] = kwargs.pop("cls", None)
1848
-
1849
- _request = build_lock_immutability_policy_request(
1850
- resource_group_name=resource_group_name,
1851
- account_name=account_name,
1852
- container_name=container_name,
1853
- subscription_id=self._config.subscription_id,
1854
- if_match=if_match,
1855
- api_version=api_version,
1856
- headers=_headers,
1857
- params=_params,
1858
- )
1859
- _request.url = self._client.format_url(_request.url)
1860
-
1861
- _stream = False
1862
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
1863
- _request, stream=_stream, **kwargs
1864
- )
1865
-
1866
- response = pipeline_response.http_response
1867
-
1868
- if response.status_code not in [200]:
1869
- map_error(status_code=response.status_code, response=response, error_map=error_map)
1870
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
1871
-
1872
- response_headers = {}
1873
- response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag"))
1874
-
1875
- deserialized = self._deserialize("ImmutabilityPolicy", pipeline_response.http_response)
1876
-
1877
- if cls:
1878
- return cls(pipeline_response, deserialized, response_headers) # type: ignore
1879
-
1880
- return deserialized # type: ignore
1881
-
1882
- @overload
1883
- def extend_immutability_policy(
1884
- self,
1885
- resource_group_name: str,
1886
- account_name: str,
1887
- container_name: str,
1888
- if_match: str,
1889
- parameters: Optional[_models.ImmutabilityPolicy] = None,
1890
- *,
1891
- content_type: str = "application/json",
1892
- **kwargs: Any
1893
- ) -> _models.ImmutabilityPolicy:
1894
- """Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only
1895
- action allowed on a Locked policy will be this action. ETag in If-Match is required for this
1896
- operation.
1897
-
1898
- :param resource_group_name: The name of the resource group within the user's subscription. The
1899
- name is case insensitive. Required.
1900
- :type resource_group_name: str
1901
- :param account_name: The name of the storage account within the specified resource group.
1902
- Storage account names must be between 3 and 24 characters in length and use numbers and
1903
- lower-case letters only. Required.
1904
- :type account_name: str
1905
- :param container_name: The name of the blob container within the specified storage account.
1906
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
1907
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
1908
- by a letter or number. Required.
1909
- :type container_name: str
1910
- :param if_match: The entity state (ETag) version of the immutability policy to update. A value
1911
- of "*" can be used to apply the operation only if the immutability policy already exists. If
1912
- omitted, this operation will always be applied. Required.
1913
- :type if_match: str
1914
- :param parameters: The ImmutabilityPolicy Properties that will be extended for a blob
1915
- container. Default value is None.
1916
- :type parameters: ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicy
1917
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
1918
- Default value is "application/json".
1919
- :paramtype content_type: str
1920
- :return: ImmutabilityPolicy or the result of cls(response)
1921
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicy
1922
- :raises ~azure.core.exceptions.HttpResponseError:
1923
- """
1924
-
1925
- @overload
1926
- def extend_immutability_policy(
1927
- self,
1928
- resource_group_name: str,
1929
- account_name: str,
1930
- container_name: str,
1931
- if_match: str,
1932
- parameters: Optional[IO[bytes]] = None,
1933
- *,
1934
- content_type: str = "application/json",
1935
- **kwargs: Any
1936
- ) -> _models.ImmutabilityPolicy:
1937
- """Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only
1938
- action allowed on a Locked policy will be this action. ETag in If-Match is required for this
1939
- operation.
1940
-
1941
- :param resource_group_name: The name of the resource group within the user's subscription. The
1942
- name is case insensitive. Required.
1943
- :type resource_group_name: str
1944
- :param account_name: The name of the storage account within the specified resource group.
1945
- Storage account names must be between 3 and 24 characters in length and use numbers and
1946
- lower-case letters only. Required.
1947
- :type account_name: str
1948
- :param container_name: The name of the blob container within the specified storage account.
1949
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
1950
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
1951
- by a letter or number. Required.
1952
- :type container_name: str
1953
- :param if_match: The entity state (ETag) version of the immutability policy to update. A value
1954
- of "*" can be used to apply the operation only if the immutability policy already exists. If
1955
- omitted, this operation will always be applied. Required.
1956
- :type if_match: str
1957
- :param parameters: The ImmutabilityPolicy Properties that will be extended for a blob
1958
- container. Default value is None.
1959
- :type parameters: IO[bytes]
1960
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
1961
- Default value is "application/json".
1962
- :paramtype content_type: str
1963
- :return: ImmutabilityPolicy or the result of cls(response)
1964
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicy
1965
- :raises ~azure.core.exceptions.HttpResponseError:
1966
- """
1967
-
1968
- @distributed_trace
1969
- def extend_immutability_policy(
1970
- self,
1971
- resource_group_name: str,
1972
- account_name: str,
1973
- container_name: str,
1974
- if_match: str,
1975
- parameters: Optional[Union[_models.ImmutabilityPolicy, IO[bytes]]] = None,
1976
- **kwargs: Any
1977
- ) -> _models.ImmutabilityPolicy:
1978
- """Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only
1979
- action allowed on a Locked policy will be this action. ETag in If-Match is required for this
1980
- operation.
1981
-
1982
- :param resource_group_name: The name of the resource group within the user's subscription. The
1983
- name is case insensitive. Required.
1984
- :type resource_group_name: str
1985
- :param account_name: The name of the storage account within the specified resource group.
1986
- Storage account names must be between 3 and 24 characters in length and use numbers and
1987
- lower-case letters only. Required.
1988
- :type account_name: str
1989
- :param container_name: The name of the blob container within the specified storage account.
1990
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
1991
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
1992
- by a letter or number. Required.
1993
- :type container_name: str
1994
- :param if_match: The entity state (ETag) version of the immutability policy to update. A value
1995
- of "*" can be used to apply the operation only if the immutability policy already exists. If
1996
- omitted, this operation will always be applied. Required.
1997
- :type if_match: str
1998
- :param parameters: The ImmutabilityPolicy Properties that will be extended for a blob
1999
- container. Is either a ImmutabilityPolicy type or a IO[bytes] type. Default value is None.
2000
- :type parameters: ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicy or IO[bytes]
2001
- :return: ImmutabilityPolicy or the result of cls(response)
2002
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicy
2003
- :raises ~azure.core.exceptions.HttpResponseError:
2004
- """
2005
- error_map: MutableMapping = {
2006
- 401: ClientAuthenticationError,
2007
- 404: ResourceNotFoundError,
2008
- 409: ResourceExistsError,
2009
- 304: ResourceNotModifiedError,
2010
- }
2011
- error_map.update(kwargs.pop("error_map", {}) or {})
2012
-
2013
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
2014
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
2015
-
2016
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
2017
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
2018
- cls: ClsType[_models.ImmutabilityPolicy] = kwargs.pop("cls", None)
2019
-
2020
- content_type = content_type or "application/json"
2021
- _json = None
2022
- _content = None
2023
- if isinstance(parameters, (IOBase, bytes)):
2024
- _content = parameters
2025
- else:
2026
- if parameters is not None:
2027
- _json = self._serialize.body(parameters, "ImmutabilityPolicy")
2028
- else:
2029
- _json = None
2030
-
2031
- _request = build_extend_immutability_policy_request(
2032
- resource_group_name=resource_group_name,
2033
- account_name=account_name,
2034
- container_name=container_name,
2035
- subscription_id=self._config.subscription_id,
2036
- if_match=if_match,
2037
- api_version=api_version,
2038
- content_type=content_type,
2039
- json=_json,
2040
- content=_content,
2041
- headers=_headers,
2042
- params=_params,
2043
- )
2044
- _request.url = self._client.format_url(_request.url)
2045
-
2046
- _stream = False
2047
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
2048
- _request, stream=_stream, **kwargs
2049
- )
2050
-
2051
- response = pipeline_response.http_response
2052
-
2053
- if response.status_code not in [200]:
2054
- map_error(status_code=response.status_code, response=response, error_map=error_map)
2055
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
2056
-
2057
- response_headers = {}
2058
- response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag"))
2059
-
2060
- deserialized = self._deserialize("ImmutabilityPolicy", pipeline_response.http_response)
2061
-
2062
- if cls:
2063
- return cls(pipeline_response, deserialized, response_headers) # type: ignore
2064
-
2065
- return deserialized # type: ignore
2066
-
2067
- @overload
2068
- def lease(
2069
- self,
2070
- resource_group_name: str,
2071
- account_name: str,
2072
- container_name: str,
2073
- parameters: Optional[_models.LeaseContainerRequest] = None,
2074
- *,
2075
- content_type: str = "application/json",
2076
- **kwargs: Any
2077
- ) -> _models.LeaseContainerResponse:
2078
- """The Lease Container operation establishes and manages a lock on a container for delete
2079
- operations. The lock duration can be 15 to 60 seconds, or can be infinite.
2080
-
2081
- :param resource_group_name: The name of the resource group within the user's subscription. The
2082
- name is case insensitive. Required.
2083
- :type resource_group_name: str
2084
- :param account_name: The name of the storage account within the specified resource group.
2085
- Storage account names must be between 3 and 24 characters in length and use numbers and
2086
- lower-case letters only. Required.
2087
- :type account_name: str
2088
- :param container_name: The name of the blob container within the specified storage account.
2089
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
2090
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
2091
- by a letter or number. Required.
2092
- :type container_name: str
2093
- :param parameters: Lease Container request body. Default value is None.
2094
- :type parameters: ~azure.mgmt.storage.v2019_06_01.models.LeaseContainerRequest
2095
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
2096
- Default value is "application/json".
2097
- :paramtype content_type: str
2098
- :return: LeaseContainerResponse or the result of cls(response)
2099
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.LeaseContainerResponse
2100
- :raises ~azure.core.exceptions.HttpResponseError:
2101
- """
2102
-
2103
- @overload
2104
- def lease(
2105
- self,
2106
- resource_group_name: str,
2107
- account_name: str,
2108
- container_name: str,
2109
- parameters: Optional[IO[bytes]] = None,
2110
- *,
2111
- content_type: str = "application/json",
2112
- **kwargs: Any
2113
- ) -> _models.LeaseContainerResponse:
2114
- """The Lease Container operation establishes and manages a lock on a container for delete
2115
- operations. The lock duration can be 15 to 60 seconds, or can be infinite.
2116
-
2117
- :param resource_group_name: The name of the resource group within the user's subscription. The
2118
- name is case insensitive. Required.
2119
- :type resource_group_name: str
2120
- :param account_name: The name of the storage account within the specified resource group.
2121
- Storage account names must be between 3 and 24 characters in length and use numbers and
2122
- lower-case letters only. Required.
2123
- :type account_name: str
2124
- :param container_name: The name of the blob container within the specified storage account.
2125
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
2126
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
2127
- by a letter or number. Required.
2128
- :type container_name: str
2129
- :param parameters: Lease Container request body. Default value is None.
2130
- :type parameters: IO[bytes]
2131
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
2132
- Default value is "application/json".
2133
- :paramtype content_type: str
2134
- :return: LeaseContainerResponse or the result of cls(response)
2135
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.LeaseContainerResponse
2136
- :raises ~azure.core.exceptions.HttpResponseError:
2137
- """
2138
-
2139
- @distributed_trace
2140
- def lease(
2141
- self,
2142
- resource_group_name: str,
2143
- account_name: str,
2144
- container_name: str,
2145
- parameters: Optional[Union[_models.LeaseContainerRequest, IO[bytes]]] = None,
2146
- **kwargs: Any
2147
- ) -> _models.LeaseContainerResponse:
2148
- """The Lease Container operation establishes and manages a lock on a container for delete
2149
- operations. The lock duration can be 15 to 60 seconds, or can be infinite.
2150
-
2151
- :param resource_group_name: The name of the resource group within the user's subscription. The
2152
- name is case insensitive. Required.
2153
- :type resource_group_name: str
2154
- :param account_name: The name of the storage account within the specified resource group.
2155
- Storage account names must be between 3 and 24 characters in length and use numbers and
2156
- lower-case letters only. Required.
2157
- :type account_name: str
2158
- :param container_name: The name of the blob container within the specified storage account.
2159
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
2160
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
2161
- by a letter or number. Required.
2162
- :type container_name: str
2163
- :param parameters: Lease Container request body. Is either a LeaseContainerRequest type or a
2164
- IO[bytes] type. Default value is None.
2165
- :type parameters: ~azure.mgmt.storage.v2019_06_01.models.LeaseContainerRequest or IO[bytes]
2166
- :return: LeaseContainerResponse or the result of cls(response)
2167
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.LeaseContainerResponse
2168
- :raises ~azure.core.exceptions.HttpResponseError:
2169
- """
2170
- error_map: MutableMapping = {
2171
- 401: ClientAuthenticationError,
2172
- 404: ResourceNotFoundError,
2173
- 409: ResourceExistsError,
2174
- 304: ResourceNotModifiedError,
2175
- }
2176
- error_map.update(kwargs.pop("error_map", {}) or {})
2177
-
2178
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
2179
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
2180
-
2181
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
2182
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
2183
- cls: ClsType[_models.LeaseContainerResponse] = kwargs.pop("cls", None)
2184
-
2185
- content_type = content_type or "application/json"
2186
- _json = None
2187
- _content = None
2188
- if isinstance(parameters, (IOBase, bytes)):
2189
- _content = parameters
2190
- else:
2191
- if parameters is not None:
2192
- _json = self._serialize.body(parameters, "LeaseContainerRequest")
2193
- else:
2194
- _json = None
2195
-
2196
- _request = build_lease_request(
2197
- resource_group_name=resource_group_name,
2198
- account_name=account_name,
2199
- container_name=container_name,
2200
- subscription_id=self._config.subscription_id,
2201
- api_version=api_version,
2202
- content_type=content_type,
2203
- json=_json,
2204
- content=_content,
2205
- headers=_headers,
2206
- params=_params,
2207
- )
2208
- _request.url = self._client.format_url(_request.url)
2209
-
2210
- _stream = False
2211
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
2212
- _request, stream=_stream, **kwargs
2213
- )
2214
-
2215
- response = pipeline_response.http_response
2216
-
2217
- if response.status_code not in [200]:
2218
- map_error(status_code=response.status_code, response=response, error_map=error_map)
2219
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
2220
-
2221
- deserialized = self._deserialize("LeaseContainerResponse", pipeline_response.http_response)
2222
-
2223
- if cls:
2224
- return cls(pipeline_response, deserialized, {}) # type: ignore
2225
-
2226
- return deserialized # type: ignore