azure-mgmt-storage 22.2.0__py3-none-any.whl → 23.0.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) hide show
  1. azure/mgmt/storage/__init__.py +19 -7
  2. azure/mgmt/storage/_configuration.py +27 -29
  3. azure/mgmt/storage/{v2016_01_01/models/_patch.py → _patch.py} +5 -4
  4. azure/mgmt/storage/_storage_management_client.py +184 -499
  5. azure/mgmt/storage/{v2016_01_01/_version.py → _utils/__init__.py} +0 -3
  6. azure/mgmt/storage/{_serialization.py → _utils/serialization.py} +46 -131
  7. azure/mgmt/storage/_version.py +1 -1
  8. azure/mgmt/storage/aio/__init__.py +21 -2
  9. azure/mgmt/storage/aio/_configuration.py +27 -29
  10. azure/mgmt/storage/{v2017_10_01/aio/operations → aio}/_patch.py +5 -4
  11. azure/mgmt/storage/aio/_storage_management_client.py +188 -497
  12. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/__init__.py +1 -0
  13. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_blob_containers_operations.py +68 -84
  14. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_blob_inventory_policies_operations.py +28 -36
  15. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_blob_services_operations.py +22 -24
  16. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_deleted_accounts_operations.py +16 -19
  17. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_encryption_scopes_operations.py +29 -32
  18. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_file_services_operations.py +26 -29
  19. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_file_shares_operations.py +38 -41
  20. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_local_users_operations.py +28 -31
  21. azure/mgmt/storage/{v2019_06_01/aio → aio}/operations/_management_policies_operations.py +23 -30
  22. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_network_security_perimeter_configurations_operations.py +18 -21
  23. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_object_replication_policies_operations.py +23 -25
  24. azure/mgmt/storage/{v2017_10_01/aio → aio}/operations/_operations.py +14 -17
  25. azure/mgmt/storage/{v2016_01_01/aio → aio}/operations/_patch.py +5 -4
  26. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_private_endpoint_connections_operations.py +23 -25
  27. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_private_link_resources_operations.py +11 -13
  28. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_queue_operations.py +29 -32
  29. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_queue_services_operations.py +19 -21
  30. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_skus_operations.py +14 -17
  31. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_storage_accounts_operations.py +83 -111
  32. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_storage_task_assignment_instances_report_operations.py +15 -17
  33. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_storage_task_assignments_instances_report_operations.py +15 -17
  34. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_storage_task_assignments_operations.py +38 -44
  35. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_table_operations.py +29 -31
  36. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_table_services_operations.py +19 -21
  37. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_usages_operations.py +14 -16
  38. azure/mgmt/storage/{v2024_01_01/models → models}/_models_py3.py +857 -912
  39. azure/mgmt/storage/{v2016_01_01/operations → models}/_patch.py +5 -4
  40. azure/mgmt/storage/{v2024_01_01/operations → operations}/__init__.py +1 -0
  41. azure/mgmt/storage/{v2024_01_01/operations → operations}/_blob_containers_operations.py +84 -87
  42. azure/mgmt/storage/{v2024_01_01/operations → operations}/_blob_inventory_policies_operations.py +34 -42
  43. azure/mgmt/storage/{v2024_01_01/operations → operations}/_blob_services_operations.py +27 -30
  44. azure/mgmt/storage/{v2024_01_01/operations → operations}/_deleted_accounts_operations.py +19 -21
  45. azure/mgmt/storage/{v2024_01_01/operations → operations}/_encryption_scopes_operations.py +35 -37
  46. azure/mgmt/storage/{v2024_01_01/operations → operations}/_file_services_operations.py +33 -35
  47. azure/mgmt/storage/{v2024_01_01/operations → operations}/_file_shares_operations.py +47 -50
  48. azure/mgmt/storage/{v2024_01_01/operations → operations}/_local_users_operations.py +36 -38
  49. azure/mgmt/storage/{v2024_01_01/operations → operations}/_management_policies_operations.py +28 -35
  50. azure/mgmt/storage/{v2024_01_01/operations → operations}/_network_security_perimeter_configurations_operations.py +23 -25
  51. azure/mgmt/storage/{v2024_01_01/operations → operations}/_object_replication_policies_operations.py +29 -32
  52. azure/mgmt/storage/{v2024_01_01/operations → operations}/_operations.py +15 -18
  53. azure/mgmt/storage/operations/_patch.py +21 -0
  54. azure/mgmt/storage/{v2024_01_01/operations → operations}/_private_endpoint_connections_operations.py +29 -32
  55. azure/mgmt/storage/{v2024_01_01/operations → operations}/_private_link_resources_operations.py +14 -16
  56. azure/mgmt/storage/{v2024_01_01/operations → operations}/_queue_operations.py +36 -38
  57. azure/mgmt/storage/{v2024_01_01/operations → operations}/_queue_services_operations.py +24 -26
  58. azure/mgmt/storage/{v2024_01_01/operations → operations}/_skus_operations.py +15 -18
  59. azure/mgmt/storage/{v2024_01_01/operations → operations}/_storage_accounts_operations.py +101 -109
  60. azure/mgmt/storage/{v2024_01_01/operations → operations}/_storage_task_assignment_instances_report_operations.py +17 -21
  61. azure/mgmt/storage/{v2024_01_01/operations → operations}/_storage_task_assignments_instances_report_operations.py +17 -21
  62. azure/mgmt/storage/{v2024_01_01/operations → operations}/_storage_task_assignments_operations.py +42 -53
  63. azure/mgmt/storage/{v2024_01_01/operations → operations}/_table_operations.py +36 -38
  64. azure/mgmt/storage/{v2024_01_01/operations → operations}/_table_services_operations.py +24 -26
  65. azure/mgmt/storage/{v2024_01_01/operations → operations}/_usages_operations.py +16 -19
  66. {azure_mgmt_storage-22.2.0.dist-info → azure_mgmt_storage-23.0.1.dist-info}/METADATA +17 -6
  67. azure_mgmt_storage-23.0.1.dist-info/RECORD +73 -0
  68. azure/mgmt/storage/models.py +0 -8
  69. azure/mgmt/storage/v2016_01_01/__init__.py +0 -32
  70. azure/mgmt/storage/v2016_01_01/_configuration.py +0 -65
  71. azure/mgmt/storage/v2016_01_01/_patch.py +0 -32
  72. azure/mgmt/storage/v2016_01_01/_storage_management_client.py +0 -117
  73. azure/mgmt/storage/v2016_01_01/aio/__init__.py +0 -29
  74. azure/mgmt/storage/v2016_01_01/aio/_configuration.py +0 -65
  75. azure/mgmt/storage/v2016_01_01/aio/_patch.py +0 -32
  76. azure/mgmt/storage/v2016_01_01/aio/_storage_management_client.py +0 -120
  77. azure/mgmt/storage/v2016_01_01/aio/operations/__init__.py +0 -27
  78. azure/mgmt/storage/v2016_01_01/aio/operations/_storage_accounts_operations.py +0 -1023
  79. azure/mgmt/storage/v2016_01_01/aio/operations/_usage_operations.py +0 -130
  80. azure/mgmt/storage/v2016_01_01/models/__init__.py +0 -88
  81. azure/mgmt/storage/v2016_01_01/models/_models_py3.py +0 -829
  82. azure/mgmt/storage/v2016_01_01/models/_storage_management_client_enums.py +0 -99
  83. azure/mgmt/storage/v2016_01_01/operations/__init__.py +0 -27
  84. azure/mgmt/storage/v2016_01_01/operations/_storage_accounts_operations.py +0 -1278
  85. azure/mgmt/storage/v2016_01_01/operations/_usage_operations.py +0 -157
  86. azure/mgmt/storage/v2016_01_01/py.typed +0 -1
  87. azure/mgmt/storage/v2017_10_01/__init__.py +0 -32
  88. azure/mgmt/storage/v2017_10_01/_configuration.py +0 -65
  89. azure/mgmt/storage/v2017_10_01/_patch.py +0 -32
  90. azure/mgmt/storage/v2017_10_01/_storage_management.py +0 -121
  91. azure/mgmt/storage/v2017_10_01/_version.py +0 -9
  92. azure/mgmt/storage/v2017_10_01/aio/__init__.py +0 -29
  93. azure/mgmt/storage/v2017_10_01/aio/_configuration.py +0 -65
  94. azure/mgmt/storage/v2017_10_01/aio/_patch.py +0 -32
  95. azure/mgmt/storage/v2017_10_01/aio/_storage_management.py +0 -124
  96. azure/mgmt/storage/v2017_10_01/aio/operations/__init__.py +0 -31
  97. azure/mgmt/storage/v2017_10_01/aio/operations/_skus_operations.py +0 -130
  98. azure/mgmt/storage/v2017_10_01/aio/operations/_storage_accounts_operations.py +0 -1299
  99. azure/mgmt/storage/v2017_10_01/aio/operations/_usage_operations.py +0 -130
  100. azure/mgmt/storage/v2017_10_01/models/__init__.py +0 -140
  101. azure/mgmt/storage/v2017_10_01/models/_models_py3.py +0 -1851
  102. azure/mgmt/storage/v2017_10_01/models/_patch.py +0 -20
  103. azure/mgmt/storage/v2017_10_01/models/_storage_management_enums.py +0 -192
  104. azure/mgmt/storage/v2017_10_01/operations/__init__.py +0 -31
  105. azure/mgmt/storage/v2017_10_01/operations/_operations.py +0 -151
  106. azure/mgmt/storage/v2017_10_01/operations/_patch.py +0 -20
  107. azure/mgmt/storage/v2017_10_01/operations/_skus_operations.py +0 -157
  108. azure/mgmt/storage/v2017_10_01/operations/_storage_accounts_operations.py +0 -1638
  109. azure/mgmt/storage/v2017_10_01/operations/_usage_operations.py +0 -157
  110. azure/mgmt/storage/v2017_10_01/py.typed +0 -1
  111. azure/mgmt/storage/v2019_06_01/__init__.py +0 -32
  112. azure/mgmt/storage/v2019_06_01/_configuration.py +0 -64
  113. azure/mgmt/storage/v2019_06_01/_patch.py +0 -32
  114. azure/mgmt/storage/v2019_06_01/_storage_management_client.py +0 -213
  115. azure/mgmt/storage/v2019_06_01/_version.py +0 -9
  116. azure/mgmt/storage/v2019_06_01/aio/__init__.py +0 -29
  117. azure/mgmt/storage/v2019_06_01/aio/_configuration.py +0 -64
  118. azure/mgmt/storage/v2019_06_01/aio/_patch.py +0 -32
  119. azure/mgmt/storage/v2019_06_01/aio/_storage_management_client.py +0 -217
  120. azure/mgmt/storage/v2019_06_01/aio/operations/__init__.py +0 -59
  121. azure/mgmt/storage/v2019_06_01/aio/operations/_blob_containers_operations.py +0 -1725
  122. azure/mgmt/storage/v2019_06_01/aio/operations/_blob_inventory_policies_operations.py +0 -437
  123. azure/mgmt/storage/v2019_06_01/aio/operations/_blob_services_operations.py +0 -368
  124. azure/mgmt/storage/v2019_06_01/aio/operations/_encryption_scopes_operations.py +0 -538
  125. azure/mgmt/storage/v2019_06_01/aio/operations/_file_services_operations.py +0 -335
  126. azure/mgmt/storage/v2019_06_01/aio/operations/_file_shares_operations.py +0 -771
  127. azure/mgmt/storage/v2019_06_01/aio/operations/_object_replication_policies_operations.py +0 -428
  128. azure/mgmt/storage/v2019_06_01/aio/operations/_operations.py +0 -130
  129. azure/mgmt/storage/v2019_06_01/aio/operations/_patch.py +0 -20
  130. azure/mgmt/storage/v2019_06_01/aio/operations/_private_endpoint_connections_operations.py +0 -424
  131. azure/mgmt/storage/v2019_06_01/aio/operations/_private_link_resources_operations.py +0 -113
  132. azure/mgmt/storage/v2019_06_01/aio/operations/_queue_operations.py +0 -597
  133. azure/mgmt/storage/v2019_06_01/aio/operations/_queue_services_operations.py +0 -335
  134. azure/mgmt/storage/v2019_06_01/aio/operations/_skus_operations.py +0 -131
  135. azure/mgmt/storage/v2019_06_01/aio/operations/_storage_accounts_operations.py +0 -1696
  136. azure/mgmt/storage/v2019_06_01/aio/operations/_table_operations.py +0 -394
  137. azure/mgmt/storage/v2019_06_01/aio/operations/_table_services_operations.py +0 -335
  138. azure/mgmt/storage/v2019_06_01/aio/operations/_usages_operations.py +0 -134
  139. azure/mgmt/storage/v2019_06_01/models/__init__.py +0 -364
  140. azure/mgmt/storage/v2019_06_01/models/_models_py3.py +0 -6038
  141. azure/mgmt/storage/v2019_06_01/models/_patch.py +0 -20
  142. azure/mgmt/storage/v2019_06_01/models/_storage_management_client_enums.py +0 -456
  143. azure/mgmt/storage/v2019_06_01/operations/__init__.py +0 -59
  144. azure/mgmt/storage/v2019_06_01/operations/_blob_containers_operations.py +0 -2226
  145. azure/mgmt/storage/v2019_06_01/operations/_blob_inventory_policies_operations.py +0 -582
  146. azure/mgmt/storage/v2019_06_01/operations/_blob_services_operations.py +0 -476
  147. azure/mgmt/storage/v2019_06_01/operations/_encryption_scopes_operations.py +0 -677
  148. azure/mgmt/storage/v2019_06_01/operations/_file_services_operations.py +0 -444
  149. azure/mgmt/storage/v2019_06_01/operations/_file_shares_operations.py +0 -1000
  150. azure/mgmt/storage/v2019_06_01/operations/_management_policies_operations.py +0 -453
  151. azure/mgmt/storage/v2019_06_01/operations/_object_replication_policies_operations.py +0 -567
  152. azure/mgmt/storage/v2019_06_01/operations/_operations.py +0 -151
  153. azure/mgmt/storage/v2019_06_01/operations/_patch.py +0 -20
  154. azure/mgmt/storage/v2019_06_01/operations/_private_endpoint_connections_operations.py +0 -575
  155. azure/mgmt/storage/v2019_06_01/operations/_private_link_resources_operations.py +0 -149
  156. azure/mgmt/storage/v2019_06_01/operations/_queue_operations.py +0 -805
  157. azure/mgmt/storage/v2019_06_01/operations/_queue_services_operations.py +0 -444
  158. azure/mgmt/storage/v2019_06_01/operations/_skus_operations.py +0 -157
  159. azure/mgmt/storage/v2019_06_01/operations/_storage_accounts_operations.py +0 -2122
  160. azure/mgmt/storage/v2019_06_01/operations/_table_operations.py +0 -563
  161. azure/mgmt/storage/v2019_06_01/operations/_table_services_operations.py +0 -444
  162. azure/mgmt/storage/v2019_06_01/operations/_usages_operations.py +0 -164
  163. azure/mgmt/storage/v2019_06_01/py.typed +0 -1
  164. azure/mgmt/storage/v2024_01_01/__init__.py +0 -32
  165. azure/mgmt/storage/v2024_01_01/_configuration.py +0 -64
  166. azure/mgmt/storage/v2024_01_01/_patch.py +0 -20
  167. azure/mgmt/storage/v2024_01_01/_storage_management_client.py +0 -256
  168. azure/mgmt/storage/v2024_01_01/_version.py +0 -9
  169. azure/mgmt/storage/v2024_01_01/aio/__init__.py +0 -29
  170. azure/mgmt/storage/v2024_01_01/aio/_configuration.py +0 -64
  171. azure/mgmt/storage/v2024_01_01/aio/_patch.py +0 -20
  172. azure/mgmt/storage/v2024_01_01/aio/_storage_management_client.py +0 -261
  173. azure/mgmt/storage/v2024_01_01/aio/operations/_management_policies_operations.py +0 -343
  174. azure/mgmt/storage/v2024_01_01/aio/operations/_operations.py +0 -130
  175. azure/mgmt/storage/v2024_01_01/aio/operations/_patch.py +0 -20
  176. azure/mgmt/storage/v2024_01_01/models/_patch.py +0 -20
  177. azure/mgmt/storage/v2024_01_01/operations/_patch.py +0 -20
  178. azure/mgmt/storage/v2024_01_01/py.typed +0 -1
  179. azure_mgmt_storage-22.2.0.dist-info/RECORD +0 -183
  180. /azure/mgmt/storage/{v2024_01_01/models → models}/__init__.py +0 -0
  181. /azure/mgmt/storage/{v2024_01_01/models → models}/_storage_management_client_enums.py +0 -0
  182. {azure_mgmt_storage-22.2.0.dist-info → azure_mgmt_storage-23.0.1.dist-info}/LICENSE +0 -0
  183. {azure_mgmt_storage-22.2.0.dist-info → azure_mgmt_storage-23.0.1.dist-info}/WHEEL +0 -0
  184. {azure_mgmt_storage-22.2.0.dist-info → azure_mgmt_storage-23.0.1.dist-info}/top_level.txt +0 -0
@@ -1,1725 +0,0 @@
1
- # pylint: disable=too-many-lines
2
- # coding=utf-8
3
- # --------------------------------------------------------------------------
4
- # Copyright (c) Microsoft Corporation. All rights reserved.
5
- # Licensed under the MIT License. See License.txt in the project root for license information.
6
- # Code generated by Microsoft (R) AutoRest Code Generator.
7
- # Changes may cause incorrect behavior and will be lost if the code is regenerated.
8
- # --------------------------------------------------------------------------
9
- from io import IOBase
10
- import sys
11
- from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
12
- import urllib.parse
13
-
14
- from azure.core.async_paging import AsyncItemPaged, AsyncList
15
- from azure.core.exceptions import (
16
- ClientAuthenticationError,
17
- HttpResponseError,
18
- ResourceExistsError,
19
- ResourceNotFoundError,
20
- ResourceNotModifiedError,
21
- map_error,
22
- )
23
- from azure.core.pipeline import PipelineResponse
24
- from azure.core.rest import AsyncHttpResponse, HttpRequest
25
- from azure.core.tracing.decorator import distributed_trace
26
- from azure.core.tracing.decorator_async import distributed_trace_async
27
- from azure.core.utils import case_insensitive_dict
28
- from azure.mgmt.core.exceptions import ARMErrorFormat
29
-
30
- from ... import models as _models
31
- from ...operations._blob_containers_operations import (
32
- build_clear_legal_hold_request,
33
- build_create_or_update_immutability_policy_request,
34
- build_create_request,
35
- build_delete_immutability_policy_request,
36
- build_delete_request,
37
- build_extend_immutability_policy_request,
38
- build_get_immutability_policy_request,
39
- build_get_request,
40
- build_lease_request,
41
- build_list_request,
42
- build_lock_immutability_policy_request,
43
- build_set_legal_hold_request,
44
- build_update_request,
45
- )
46
-
47
- if sys.version_info >= (3, 9):
48
- from collections.abc import MutableMapping
49
- else:
50
- from typing import MutableMapping # type: ignore
51
- T = TypeVar("T")
52
- ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
53
-
54
-
55
- class BlobContainersOperations:
56
- """
57
- .. warning::
58
- **DO NOT** instantiate this class directly.
59
-
60
- Instead, you should access the following operations through
61
- :class:`~azure.mgmt.storage.v2019_06_01.aio.StorageManagementClient`'s
62
- :attr:`blob_containers` attribute.
63
- """
64
-
65
- models = _models
66
-
67
- def __init__(self, *args, **kwargs) -> None:
68
- input_args = list(args)
69
- self._client = input_args.pop(0) if input_args else kwargs.pop("client")
70
- self._config = input_args.pop(0) if input_args else kwargs.pop("config")
71
- self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
72
- self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
73
- self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
74
-
75
- @distributed_trace
76
- def list(
77
- self,
78
- resource_group_name: str,
79
- account_name: str,
80
- maxpagesize: Optional[str] = None,
81
- filter: Optional[str] = None,
82
- include: Optional[Union[str, _models.ListContainersInclude]] = None,
83
- **kwargs: Any
84
- ) -> AsyncIterable["_models.ListContainerItem"]:
85
- """Lists all containers and does not support a prefix like data plane. Also SRP today does not
86
- return continuation token.
87
-
88
- :param resource_group_name: The name of the resource group within the user's subscription. The
89
- name is case insensitive. Required.
90
- :type resource_group_name: str
91
- :param account_name: The name of the storage account within the specified resource group.
92
- Storage account names must be between 3 and 24 characters in length and use numbers and
93
- lower-case letters only. Required.
94
- :type account_name: str
95
- :param maxpagesize: Optional. Specified maximum number of containers that can be included in
96
- the list. Default value is None.
97
- :type maxpagesize: str
98
- :param filter: Optional. When specified, only container names starting with the filter will be
99
- listed. Default value is None.
100
- :type filter: str
101
- :param include: Optional, used to include the properties for soft deleted blob containers.
102
- "deleted" Default value is None.
103
- :type include: str or ~azure.mgmt.storage.v2019_06_01.models.ListContainersInclude
104
- :return: An iterator like instance of either ListContainerItem or the result of cls(response)
105
- :rtype:
106
- ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2019_06_01.models.ListContainerItem]
107
- :raises ~azure.core.exceptions.HttpResponseError:
108
- """
109
- _headers = kwargs.pop("headers", {}) or {}
110
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
111
-
112
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
113
- cls: ClsType[_models.ListContainerItems] = kwargs.pop("cls", None)
114
-
115
- error_map: MutableMapping = {
116
- 401: ClientAuthenticationError,
117
- 404: ResourceNotFoundError,
118
- 409: ResourceExistsError,
119
- 304: ResourceNotModifiedError,
120
- }
121
- error_map.update(kwargs.pop("error_map", {}) or {})
122
-
123
- def prepare_request(next_link=None):
124
- if not next_link:
125
-
126
- _request = build_list_request(
127
- resource_group_name=resource_group_name,
128
- account_name=account_name,
129
- subscription_id=self._config.subscription_id,
130
- maxpagesize=maxpagesize,
131
- filter=filter,
132
- include=include,
133
- api_version=api_version,
134
- headers=_headers,
135
- params=_params,
136
- )
137
- _request.url = self._client.format_url(_request.url)
138
-
139
- else:
140
- # make call to next link with the client's api-version
141
- _parsed_next_link = urllib.parse.urlparse(next_link)
142
- _next_request_params = case_insensitive_dict(
143
- {
144
- key: [urllib.parse.quote(v) for v in value]
145
- for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
146
- }
147
- )
148
- _next_request_params["api-version"] = self._api_version
149
- _request = HttpRequest(
150
- "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
151
- )
152
- _request.url = self._client.format_url(_request.url)
153
- _request.method = "GET"
154
- return _request
155
-
156
- async def extract_data(pipeline_response):
157
- deserialized = self._deserialize("ListContainerItems", pipeline_response)
158
- list_of_elem = deserialized.value
159
- if cls:
160
- list_of_elem = cls(list_of_elem) # type: ignore
161
- return deserialized.next_link or None, AsyncList(list_of_elem)
162
-
163
- async def get_next(next_link=None):
164
- _request = prepare_request(next_link)
165
-
166
- _stream = False
167
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
168
- _request, stream=_stream, **kwargs
169
- )
170
- response = pipeline_response.http_response
171
-
172
- if response.status_code not in [200]:
173
- map_error(status_code=response.status_code, response=response, error_map=error_map)
174
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
175
-
176
- return pipeline_response
177
-
178
- return AsyncItemPaged(get_next, extract_data)
179
-
180
- @overload
181
- async def create(
182
- self,
183
- resource_group_name: str,
184
- account_name: str,
185
- container_name: str,
186
- blob_container: _models.BlobContainer,
187
- *,
188
- content_type: str = "application/json",
189
- **kwargs: Any
190
- ) -> _models.BlobContainer:
191
- """Creates a new container under the specified account as described by request body. The container
192
- resource includes metadata and properties for that container. It does not include a list of the
193
- blobs contained by the container.
194
-
195
- :param resource_group_name: The name of the resource group within the user's subscription. The
196
- name is case insensitive. Required.
197
- :type resource_group_name: str
198
- :param account_name: The name of the storage account within the specified resource group.
199
- Storage account names must be between 3 and 24 characters in length and use numbers and
200
- lower-case letters only. Required.
201
- :type account_name: str
202
- :param container_name: The name of the blob container within the specified storage account.
203
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
204
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
205
- by a letter or number. Required.
206
- :type container_name: str
207
- :param blob_container: Properties of the blob container to create. Required.
208
- :type blob_container: ~azure.mgmt.storage.v2019_06_01.models.BlobContainer
209
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
210
- Default value is "application/json".
211
- :paramtype content_type: str
212
- :return: BlobContainer or the result of cls(response)
213
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.BlobContainer
214
- :raises ~azure.core.exceptions.HttpResponseError:
215
- """
216
-
217
- @overload
218
- async def create(
219
- self,
220
- resource_group_name: str,
221
- account_name: str,
222
- container_name: str,
223
- blob_container: IO[bytes],
224
- *,
225
- content_type: str = "application/json",
226
- **kwargs: Any
227
- ) -> _models.BlobContainer:
228
- """Creates a new container under the specified account as described by request body. The container
229
- resource includes metadata and properties for that container. It does not include a list of the
230
- blobs contained by the container.
231
-
232
- :param resource_group_name: The name of the resource group within the user's subscription. The
233
- name is case insensitive. Required.
234
- :type resource_group_name: str
235
- :param account_name: The name of the storage account within the specified resource group.
236
- Storage account names must be between 3 and 24 characters in length and use numbers and
237
- lower-case letters only. Required.
238
- :type account_name: str
239
- :param container_name: The name of the blob container within the specified storage account.
240
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
241
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
242
- by a letter or number. Required.
243
- :type container_name: str
244
- :param blob_container: Properties of the blob container to create. Required.
245
- :type blob_container: IO[bytes]
246
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
247
- Default value is "application/json".
248
- :paramtype content_type: str
249
- :return: BlobContainer or the result of cls(response)
250
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.BlobContainer
251
- :raises ~azure.core.exceptions.HttpResponseError:
252
- """
253
-
254
- @distributed_trace_async
255
- async def create(
256
- self,
257
- resource_group_name: str,
258
- account_name: str,
259
- container_name: str,
260
- blob_container: Union[_models.BlobContainer, IO[bytes]],
261
- **kwargs: Any
262
- ) -> _models.BlobContainer:
263
- """Creates a new container under the specified account as described by request body. The container
264
- resource includes metadata and properties for that container. It does not include a list of the
265
- blobs contained by the container.
266
-
267
- :param resource_group_name: The name of the resource group within the user's subscription. The
268
- name is case insensitive. Required.
269
- :type resource_group_name: str
270
- :param account_name: The name of the storage account within the specified resource group.
271
- Storage account names must be between 3 and 24 characters in length and use numbers and
272
- lower-case letters only. Required.
273
- :type account_name: str
274
- :param container_name: The name of the blob container within the specified storage account.
275
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
276
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
277
- by a letter or number. Required.
278
- :type container_name: str
279
- :param blob_container: Properties of the blob container to create. Is either a BlobContainer
280
- type or a IO[bytes] type. Required.
281
- :type blob_container: ~azure.mgmt.storage.v2019_06_01.models.BlobContainer or IO[bytes]
282
- :return: BlobContainer or the result of cls(response)
283
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.BlobContainer
284
- :raises ~azure.core.exceptions.HttpResponseError:
285
- """
286
- error_map: MutableMapping = {
287
- 401: ClientAuthenticationError,
288
- 404: ResourceNotFoundError,
289
- 409: ResourceExistsError,
290
- 304: ResourceNotModifiedError,
291
- }
292
- error_map.update(kwargs.pop("error_map", {}) or {})
293
-
294
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
295
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
296
-
297
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
298
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
299
- cls: ClsType[_models.BlobContainer] = kwargs.pop("cls", None)
300
-
301
- content_type = content_type or "application/json"
302
- _json = None
303
- _content = None
304
- if isinstance(blob_container, (IOBase, bytes)):
305
- _content = blob_container
306
- else:
307
- _json = self._serialize.body(blob_container, "BlobContainer")
308
-
309
- _request = build_create_request(
310
- resource_group_name=resource_group_name,
311
- account_name=account_name,
312
- container_name=container_name,
313
- subscription_id=self._config.subscription_id,
314
- api_version=api_version,
315
- content_type=content_type,
316
- json=_json,
317
- content=_content,
318
- headers=_headers,
319
- params=_params,
320
- )
321
- _request.url = self._client.format_url(_request.url)
322
-
323
- _stream = False
324
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
325
- _request, stream=_stream, **kwargs
326
- )
327
-
328
- response = pipeline_response.http_response
329
-
330
- if response.status_code not in [200, 201]:
331
- map_error(status_code=response.status_code, response=response, error_map=error_map)
332
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
333
-
334
- deserialized = self._deserialize("BlobContainer", pipeline_response.http_response)
335
-
336
- if cls:
337
- return cls(pipeline_response, deserialized, {}) # type: ignore
338
-
339
- return deserialized # type: ignore
340
-
341
- @overload
342
- async def update(
343
- self,
344
- resource_group_name: str,
345
- account_name: str,
346
- container_name: str,
347
- blob_container: _models.BlobContainer,
348
- *,
349
- content_type: str = "application/json",
350
- **kwargs: Any
351
- ) -> _models.BlobContainer:
352
- """Updates container properties as specified in request body. Properties not mentioned in the
353
- request will be unchanged. Update fails if the specified container doesn't already exist.
354
-
355
- :param resource_group_name: The name of the resource group within the user's subscription. The
356
- name is case insensitive. Required.
357
- :type resource_group_name: str
358
- :param account_name: The name of the storage account within the specified resource group.
359
- Storage account names must be between 3 and 24 characters in length and use numbers and
360
- lower-case letters only. Required.
361
- :type account_name: str
362
- :param container_name: The name of the blob container within the specified storage account.
363
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
364
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
365
- by a letter or number. Required.
366
- :type container_name: str
367
- :param blob_container: Properties to update for the blob container. Required.
368
- :type blob_container: ~azure.mgmt.storage.v2019_06_01.models.BlobContainer
369
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
370
- Default value is "application/json".
371
- :paramtype content_type: str
372
- :return: BlobContainer or the result of cls(response)
373
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.BlobContainer
374
- :raises ~azure.core.exceptions.HttpResponseError:
375
- """
376
-
377
- @overload
378
- async def update(
379
- self,
380
- resource_group_name: str,
381
- account_name: str,
382
- container_name: str,
383
- blob_container: IO[bytes],
384
- *,
385
- content_type: str = "application/json",
386
- **kwargs: Any
387
- ) -> _models.BlobContainer:
388
- """Updates container properties as specified in request body. Properties not mentioned in the
389
- request will be unchanged. Update fails if the specified container doesn't already exist.
390
-
391
- :param resource_group_name: The name of the resource group within the user's subscription. The
392
- name is case insensitive. Required.
393
- :type resource_group_name: str
394
- :param account_name: The name of the storage account within the specified resource group.
395
- Storage account names must be between 3 and 24 characters in length and use numbers and
396
- lower-case letters only. Required.
397
- :type account_name: str
398
- :param container_name: The name of the blob container within the specified storage account.
399
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
400
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
401
- by a letter or number. Required.
402
- :type container_name: str
403
- :param blob_container: Properties to update for the blob container. Required.
404
- :type blob_container: IO[bytes]
405
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
406
- Default value is "application/json".
407
- :paramtype content_type: str
408
- :return: BlobContainer or the result of cls(response)
409
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.BlobContainer
410
- :raises ~azure.core.exceptions.HttpResponseError:
411
- """
412
-
413
- @distributed_trace_async
414
- async def update(
415
- self,
416
- resource_group_name: str,
417
- account_name: str,
418
- container_name: str,
419
- blob_container: Union[_models.BlobContainer, IO[bytes]],
420
- **kwargs: Any
421
- ) -> _models.BlobContainer:
422
- """Updates container properties as specified in request body. Properties not mentioned in the
423
- request will be unchanged. Update fails if the specified container doesn't already exist.
424
-
425
- :param resource_group_name: The name of the resource group within the user's subscription. The
426
- name is case insensitive. Required.
427
- :type resource_group_name: str
428
- :param account_name: The name of the storage account within the specified resource group.
429
- Storage account names must be between 3 and 24 characters in length and use numbers and
430
- lower-case letters only. Required.
431
- :type account_name: str
432
- :param container_name: The name of the blob container within the specified storage account.
433
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
434
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
435
- by a letter or number. Required.
436
- :type container_name: str
437
- :param blob_container: Properties to update for the blob container. Is either a BlobContainer
438
- type or a IO[bytes] type. Required.
439
- :type blob_container: ~azure.mgmt.storage.v2019_06_01.models.BlobContainer or IO[bytes]
440
- :return: BlobContainer or the result of cls(response)
441
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.BlobContainer
442
- :raises ~azure.core.exceptions.HttpResponseError:
443
- """
444
- error_map: MutableMapping = {
445
- 401: ClientAuthenticationError,
446
- 404: ResourceNotFoundError,
447
- 409: ResourceExistsError,
448
- 304: ResourceNotModifiedError,
449
- }
450
- error_map.update(kwargs.pop("error_map", {}) or {})
451
-
452
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
453
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
454
-
455
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
456
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
457
- cls: ClsType[_models.BlobContainer] = kwargs.pop("cls", None)
458
-
459
- content_type = content_type or "application/json"
460
- _json = None
461
- _content = None
462
- if isinstance(blob_container, (IOBase, bytes)):
463
- _content = blob_container
464
- else:
465
- _json = self._serialize.body(blob_container, "BlobContainer")
466
-
467
- _request = build_update_request(
468
- resource_group_name=resource_group_name,
469
- account_name=account_name,
470
- container_name=container_name,
471
- subscription_id=self._config.subscription_id,
472
- api_version=api_version,
473
- content_type=content_type,
474
- json=_json,
475
- content=_content,
476
- headers=_headers,
477
- params=_params,
478
- )
479
- _request.url = self._client.format_url(_request.url)
480
-
481
- _stream = False
482
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
483
- _request, stream=_stream, **kwargs
484
- )
485
-
486
- response = pipeline_response.http_response
487
-
488
- if response.status_code not in [200]:
489
- map_error(status_code=response.status_code, response=response, error_map=error_map)
490
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
491
-
492
- deserialized = self._deserialize("BlobContainer", pipeline_response.http_response)
493
-
494
- if cls:
495
- return cls(pipeline_response, deserialized, {}) # type: ignore
496
-
497
- return deserialized # type: ignore
498
-
499
- @distributed_trace_async
500
- async def get(
501
- self, resource_group_name: str, account_name: str, container_name: str, **kwargs: Any
502
- ) -> _models.BlobContainer:
503
- """Gets properties of a specified container.
504
-
505
- :param resource_group_name: The name of the resource group within the user's subscription. The
506
- name is case insensitive. Required.
507
- :type resource_group_name: str
508
- :param account_name: The name of the storage account within the specified resource group.
509
- Storage account names must be between 3 and 24 characters in length and use numbers and
510
- lower-case letters only. Required.
511
- :type account_name: str
512
- :param container_name: The name of the blob container within the specified storage account.
513
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
514
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
515
- by a letter or number. Required.
516
- :type container_name: str
517
- :return: BlobContainer or the result of cls(response)
518
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.BlobContainer
519
- :raises ~azure.core.exceptions.HttpResponseError:
520
- """
521
- error_map: MutableMapping = {
522
- 401: ClientAuthenticationError,
523
- 404: ResourceNotFoundError,
524
- 409: ResourceExistsError,
525
- 304: ResourceNotModifiedError,
526
- }
527
- error_map.update(kwargs.pop("error_map", {}) or {})
528
-
529
- _headers = kwargs.pop("headers", {}) or {}
530
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
531
-
532
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
533
- cls: ClsType[_models.BlobContainer] = kwargs.pop("cls", None)
534
-
535
- _request = build_get_request(
536
- resource_group_name=resource_group_name,
537
- account_name=account_name,
538
- container_name=container_name,
539
- subscription_id=self._config.subscription_id,
540
- api_version=api_version,
541
- headers=_headers,
542
- params=_params,
543
- )
544
- _request.url = self._client.format_url(_request.url)
545
-
546
- _stream = False
547
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
548
- _request, stream=_stream, **kwargs
549
- )
550
-
551
- response = pipeline_response.http_response
552
-
553
- if response.status_code not in [200]:
554
- map_error(status_code=response.status_code, response=response, error_map=error_map)
555
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
556
-
557
- deserialized = self._deserialize("BlobContainer", pipeline_response.http_response)
558
-
559
- if cls:
560
- return cls(pipeline_response, deserialized, {}) # type: ignore
561
-
562
- return deserialized # type: ignore
563
-
564
- @distributed_trace_async
565
- async def delete(self, resource_group_name: str, account_name: str, container_name: str, **kwargs: Any) -> None:
566
- """Deletes specified container under its account.
567
-
568
- :param resource_group_name: The name of the resource group within the user's subscription. The
569
- name is case insensitive. Required.
570
- :type resource_group_name: str
571
- :param account_name: The name of the storage account within the specified resource group.
572
- Storage account names must be between 3 and 24 characters in length and use numbers and
573
- lower-case letters only. Required.
574
- :type account_name: str
575
- :param container_name: The name of the blob container within the specified storage account.
576
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
577
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
578
- by a letter or number. Required.
579
- :type container_name: str
580
- :return: None or the result of cls(response)
581
- :rtype: None
582
- :raises ~azure.core.exceptions.HttpResponseError:
583
- """
584
- error_map: MutableMapping = {
585
- 401: ClientAuthenticationError,
586
- 404: ResourceNotFoundError,
587
- 409: ResourceExistsError,
588
- 304: ResourceNotModifiedError,
589
- }
590
- error_map.update(kwargs.pop("error_map", {}) or {})
591
-
592
- _headers = kwargs.pop("headers", {}) or {}
593
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
594
-
595
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
596
- cls: ClsType[None] = kwargs.pop("cls", None)
597
-
598
- _request = build_delete_request(
599
- resource_group_name=resource_group_name,
600
- account_name=account_name,
601
- container_name=container_name,
602
- subscription_id=self._config.subscription_id,
603
- api_version=api_version,
604
- headers=_headers,
605
- params=_params,
606
- )
607
- _request.url = self._client.format_url(_request.url)
608
-
609
- _stream = False
610
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
611
- _request, stream=_stream, **kwargs
612
- )
613
-
614
- response = pipeline_response.http_response
615
-
616
- if response.status_code not in [200, 204]:
617
- map_error(status_code=response.status_code, response=response, error_map=error_map)
618
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
619
-
620
- if cls:
621
- return cls(pipeline_response, None, {}) # type: ignore
622
-
623
- @overload
624
- async def set_legal_hold(
625
- self,
626
- resource_group_name: str,
627
- account_name: str,
628
- container_name: str,
629
- legal_hold: _models.LegalHold,
630
- *,
631
- content_type: str = "application/json",
632
- **kwargs: Any
633
- ) -> _models.LegalHold:
634
- """Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold
635
- follows an append pattern and does not clear out the existing tags that are not specified in
636
- the request.
637
-
638
- :param resource_group_name: The name of the resource group within the user's subscription. The
639
- name is case insensitive. Required.
640
- :type resource_group_name: str
641
- :param account_name: The name of the storage account within the specified resource group.
642
- Storage account names must be between 3 and 24 characters in length and use numbers and
643
- lower-case letters only. Required.
644
- :type account_name: str
645
- :param container_name: The name of the blob container within the specified storage account.
646
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
647
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
648
- by a letter or number. Required.
649
- :type container_name: str
650
- :param legal_hold: The LegalHold property that will be set to a blob container. Required.
651
- :type legal_hold: ~azure.mgmt.storage.v2019_06_01.models.LegalHold
652
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
653
- Default value is "application/json".
654
- :paramtype content_type: str
655
- :return: LegalHold or the result of cls(response)
656
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.LegalHold
657
- :raises ~azure.core.exceptions.HttpResponseError:
658
- """
659
-
660
- @overload
661
- async def set_legal_hold(
662
- self,
663
- resource_group_name: str,
664
- account_name: str,
665
- container_name: str,
666
- legal_hold: IO[bytes],
667
- *,
668
- content_type: str = "application/json",
669
- **kwargs: Any
670
- ) -> _models.LegalHold:
671
- """Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold
672
- follows an append pattern and does not clear out the existing tags that are not specified in
673
- the request.
674
-
675
- :param resource_group_name: The name of the resource group within the user's subscription. The
676
- name is case insensitive. Required.
677
- :type resource_group_name: str
678
- :param account_name: The name of the storage account within the specified resource group.
679
- Storage account names must be between 3 and 24 characters in length and use numbers and
680
- lower-case letters only. Required.
681
- :type account_name: str
682
- :param container_name: The name of the blob container within the specified storage account.
683
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
684
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
685
- by a letter or number. Required.
686
- :type container_name: str
687
- :param legal_hold: The LegalHold property that will be set to a blob container. Required.
688
- :type legal_hold: IO[bytes]
689
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
690
- Default value is "application/json".
691
- :paramtype content_type: str
692
- :return: LegalHold or the result of cls(response)
693
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.LegalHold
694
- :raises ~azure.core.exceptions.HttpResponseError:
695
- """
696
-
697
- @distributed_trace_async
698
- async def set_legal_hold(
699
- self,
700
- resource_group_name: str,
701
- account_name: str,
702
- container_name: str,
703
- legal_hold: Union[_models.LegalHold, IO[bytes]],
704
- **kwargs: Any
705
- ) -> _models.LegalHold:
706
- """Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold
707
- follows an append pattern and does not clear out the existing tags that are not specified in
708
- the request.
709
-
710
- :param resource_group_name: The name of the resource group within the user's subscription. The
711
- name is case insensitive. Required.
712
- :type resource_group_name: str
713
- :param account_name: The name of the storage account within the specified resource group.
714
- Storage account names must be between 3 and 24 characters in length and use numbers and
715
- lower-case letters only. Required.
716
- :type account_name: str
717
- :param container_name: The name of the blob container within the specified storage account.
718
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
719
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
720
- by a letter or number. Required.
721
- :type container_name: str
722
- :param legal_hold: The LegalHold property that will be set to a blob container. Is either a
723
- LegalHold type or a IO[bytes] type. Required.
724
- :type legal_hold: ~azure.mgmt.storage.v2019_06_01.models.LegalHold or IO[bytes]
725
- :return: LegalHold or the result of cls(response)
726
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.LegalHold
727
- :raises ~azure.core.exceptions.HttpResponseError:
728
- """
729
- error_map: MutableMapping = {
730
- 401: ClientAuthenticationError,
731
- 404: ResourceNotFoundError,
732
- 409: ResourceExistsError,
733
- 304: ResourceNotModifiedError,
734
- }
735
- error_map.update(kwargs.pop("error_map", {}) or {})
736
-
737
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
738
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
739
-
740
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
741
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
742
- cls: ClsType[_models.LegalHold] = kwargs.pop("cls", None)
743
-
744
- content_type = content_type or "application/json"
745
- _json = None
746
- _content = None
747
- if isinstance(legal_hold, (IOBase, bytes)):
748
- _content = legal_hold
749
- else:
750
- _json = self._serialize.body(legal_hold, "LegalHold")
751
-
752
- _request = build_set_legal_hold_request(
753
- resource_group_name=resource_group_name,
754
- account_name=account_name,
755
- container_name=container_name,
756
- subscription_id=self._config.subscription_id,
757
- api_version=api_version,
758
- content_type=content_type,
759
- json=_json,
760
- content=_content,
761
- headers=_headers,
762
- params=_params,
763
- )
764
- _request.url = self._client.format_url(_request.url)
765
-
766
- _stream = False
767
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
768
- _request, stream=_stream, **kwargs
769
- )
770
-
771
- response = pipeline_response.http_response
772
-
773
- if response.status_code not in [200]:
774
- map_error(status_code=response.status_code, response=response, error_map=error_map)
775
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
776
-
777
- deserialized = self._deserialize("LegalHold", pipeline_response.http_response)
778
-
779
- if cls:
780
- return cls(pipeline_response, deserialized, {}) # type: ignore
781
-
782
- return deserialized # type: ignore
783
-
784
- @overload
785
- async def clear_legal_hold(
786
- self,
787
- resource_group_name: str,
788
- account_name: str,
789
- container_name: str,
790
- legal_hold: _models.LegalHold,
791
- *,
792
- content_type: str = "application/json",
793
- **kwargs: Any
794
- ) -> _models.LegalHold:
795
- """Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent
796
- operation. ClearLegalHold clears out only the specified tags in the request.
797
-
798
- :param resource_group_name: The name of the resource group within the user's subscription. The
799
- name is case insensitive. Required.
800
- :type resource_group_name: str
801
- :param account_name: The name of the storage account within the specified resource group.
802
- Storage account names must be between 3 and 24 characters in length and use numbers and
803
- lower-case letters only. Required.
804
- :type account_name: str
805
- :param container_name: The name of the blob container within the specified storage account.
806
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
807
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
808
- by a letter or number. Required.
809
- :type container_name: str
810
- :param legal_hold: The LegalHold property that will be clear from a blob container. Required.
811
- :type legal_hold: ~azure.mgmt.storage.v2019_06_01.models.LegalHold
812
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
813
- Default value is "application/json".
814
- :paramtype content_type: str
815
- :return: LegalHold or the result of cls(response)
816
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.LegalHold
817
- :raises ~azure.core.exceptions.HttpResponseError:
818
- """
819
-
820
- @overload
821
- async def clear_legal_hold(
822
- self,
823
- resource_group_name: str,
824
- account_name: str,
825
- container_name: str,
826
- legal_hold: IO[bytes],
827
- *,
828
- content_type: str = "application/json",
829
- **kwargs: Any
830
- ) -> _models.LegalHold:
831
- """Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent
832
- operation. ClearLegalHold clears out only the specified tags in the request.
833
-
834
- :param resource_group_name: The name of the resource group within the user's subscription. The
835
- name is case insensitive. Required.
836
- :type resource_group_name: str
837
- :param account_name: The name of the storage account within the specified resource group.
838
- Storage account names must be between 3 and 24 characters in length and use numbers and
839
- lower-case letters only. Required.
840
- :type account_name: str
841
- :param container_name: The name of the blob container within the specified storage account.
842
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
843
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
844
- by a letter or number. Required.
845
- :type container_name: str
846
- :param legal_hold: The LegalHold property that will be clear from a blob container. Required.
847
- :type legal_hold: IO[bytes]
848
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
849
- Default value is "application/json".
850
- :paramtype content_type: str
851
- :return: LegalHold or the result of cls(response)
852
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.LegalHold
853
- :raises ~azure.core.exceptions.HttpResponseError:
854
- """
855
-
856
- @distributed_trace_async
857
- async def clear_legal_hold(
858
- self,
859
- resource_group_name: str,
860
- account_name: str,
861
- container_name: str,
862
- legal_hold: Union[_models.LegalHold, IO[bytes]],
863
- **kwargs: Any
864
- ) -> _models.LegalHold:
865
- """Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent
866
- operation. ClearLegalHold clears out only the specified tags in the request.
867
-
868
- :param resource_group_name: The name of the resource group within the user's subscription. The
869
- name is case insensitive. Required.
870
- :type resource_group_name: str
871
- :param account_name: The name of the storage account within the specified resource group.
872
- Storage account names must be between 3 and 24 characters in length and use numbers and
873
- lower-case letters only. Required.
874
- :type account_name: str
875
- :param container_name: The name of the blob container within the specified storage account.
876
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
877
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
878
- by a letter or number. Required.
879
- :type container_name: str
880
- :param legal_hold: The LegalHold property that will be clear from a blob container. Is either a
881
- LegalHold type or a IO[bytes] type. Required.
882
- :type legal_hold: ~azure.mgmt.storage.v2019_06_01.models.LegalHold or IO[bytes]
883
- :return: LegalHold or the result of cls(response)
884
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.LegalHold
885
- :raises ~azure.core.exceptions.HttpResponseError:
886
- """
887
- error_map: MutableMapping = {
888
- 401: ClientAuthenticationError,
889
- 404: ResourceNotFoundError,
890
- 409: ResourceExistsError,
891
- 304: ResourceNotModifiedError,
892
- }
893
- error_map.update(kwargs.pop("error_map", {}) or {})
894
-
895
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
896
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
897
-
898
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
899
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
900
- cls: ClsType[_models.LegalHold] = kwargs.pop("cls", None)
901
-
902
- content_type = content_type or "application/json"
903
- _json = None
904
- _content = None
905
- if isinstance(legal_hold, (IOBase, bytes)):
906
- _content = legal_hold
907
- else:
908
- _json = self._serialize.body(legal_hold, "LegalHold")
909
-
910
- _request = build_clear_legal_hold_request(
911
- resource_group_name=resource_group_name,
912
- account_name=account_name,
913
- container_name=container_name,
914
- subscription_id=self._config.subscription_id,
915
- api_version=api_version,
916
- content_type=content_type,
917
- json=_json,
918
- content=_content,
919
- headers=_headers,
920
- params=_params,
921
- )
922
- _request.url = self._client.format_url(_request.url)
923
-
924
- _stream = False
925
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
926
- _request, stream=_stream, **kwargs
927
- )
928
-
929
- response = pipeline_response.http_response
930
-
931
- if response.status_code not in [200]:
932
- map_error(status_code=response.status_code, response=response, error_map=error_map)
933
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
934
-
935
- deserialized = self._deserialize("LegalHold", pipeline_response.http_response)
936
-
937
- if cls:
938
- return cls(pipeline_response, deserialized, {}) # type: ignore
939
-
940
- return deserialized # type: ignore
941
-
942
- @overload
943
- async def create_or_update_immutability_policy(
944
- self,
945
- resource_group_name: str,
946
- account_name: str,
947
- container_name: str,
948
- immutability_policy_name: Union[str, _models.Enum27],
949
- if_match: Optional[str] = None,
950
- parameters: Optional[_models.ImmutabilityPolicy] = None,
951
- *,
952
- content_type: str = "application/json",
953
- **kwargs: Any
954
- ) -> _models.ImmutabilityPolicy:
955
- """Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but
956
- not required for this operation.
957
-
958
- :param resource_group_name: The name of the resource group within the user's subscription. The
959
- name is case insensitive. Required.
960
- :type resource_group_name: str
961
- :param account_name: The name of the storage account within the specified resource group.
962
- Storage account names must be between 3 and 24 characters in length and use numbers and
963
- lower-case letters only. Required.
964
- :type account_name: str
965
- :param container_name: The name of the blob container within the specified storage account.
966
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
967
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
968
- by a letter or number. Required.
969
- :type container_name: str
970
- :param immutability_policy_name: The name of the blob container immutabilityPolicy within the
971
- specified storage account. ImmutabilityPolicy Name must be 'default'. "default" Required.
972
- :type immutability_policy_name: str or ~azure.mgmt.storage.v2019_06_01.models.Enum27
973
- :param if_match: The entity state (ETag) version of the immutability policy to update. A value
974
- of "*" can be used to apply the operation only if the immutability policy already exists. If
975
- omitted, this operation will always be applied. Default value is None.
976
- :type if_match: str
977
- :param parameters: The ImmutabilityPolicy Properties that will be created or updated to a blob
978
- container. Default value is None.
979
- :type parameters: ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicy
980
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
981
- Default value is "application/json".
982
- :paramtype content_type: str
983
- :return: ImmutabilityPolicy or the result of cls(response)
984
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicy
985
- :raises ~azure.core.exceptions.HttpResponseError:
986
- """
987
-
988
- @overload
989
- async def create_or_update_immutability_policy(
990
- self,
991
- resource_group_name: str,
992
- account_name: str,
993
- container_name: str,
994
- immutability_policy_name: Union[str, _models.Enum27],
995
- if_match: Optional[str] = None,
996
- parameters: Optional[IO[bytes]] = None,
997
- *,
998
- content_type: str = "application/json",
999
- **kwargs: Any
1000
- ) -> _models.ImmutabilityPolicy:
1001
- """Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but
1002
- not required for this operation.
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
- :param immutability_policy_name: The name of the blob container immutabilityPolicy within the
1017
- specified storage account. ImmutabilityPolicy Name must be 'default'. "default" Required.
1018
- :type immutability_policy_name: str or ~azure.mgmt.storage.v2019_06_01.models.Enum27
1019
- :param if_match: The entity state (ETag) version of the immutability policy to update. A value
1020
- of "*" can be used to apply the operation only if the immutability policy already exists. If
1021
- omitted, this operation will always be applied. Default value is None.
1022
- :type if_match: str
1023
- :param parameters: The ImmutabilityPolicy Properties that will be created or updated to a blob
1024
- container. Default value is None.
1025
- :type parameters: IO[bytes]
1026
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
1027
- Default value is "application/json".
1028
- :paramtype content_type: str
1029
- :return: ImmutabilityPolicy or the result of cls(response)
1030
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicy
1031
- :raises ~azure.core.exceptions.HttpResponseError:
1032
- """
1033
-
1034
- @distributed_trace_async
1035
- async def create_or_update_immutability_policy(
1036
- self,
1037
- resource_group_name: str,
1038
- account_name: str,
1039
- container_name: str,
1040
- immutability_policy_name: Union[str, _models.Enum27],
1041
- if_match: Optional[str] = None,
1042
- parameters: Optional[Union[_models.ImmutabilityPolicy, IO[bytes]]] = None,
1043
- **kwargs: Any
1044
- ) -> _models.ImmutabilityPolicy:
1045
- """Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but
1046
- not required for this operation.
1047
-
1048
- :param resource_group_name: The name of the resource group within the user's subscription. The
1049
- name is case insensitive. Required.
1050
- :type resource_group_name: str
1051
- :param account_name: The name of the storage account within the specified resource group.
1052
- Storage account names must be between 3 and 24 characters in length and use numbers and
1053
- lower-case letters only. Required.
1054
- :type account_name: str
1055
- :param container_name: The name of the blob container within the specified storage account.
1056
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
1057
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
1058
- by a letter or number. Required.
1059
- :type container_name: str
1060
- :param immutability_policy_name: The name of the blob container immutabilityPolicy within the
1061
- specified storage account. ImmutabilityPolicy Name must be 'default'. "default" Required.
1062
- :type immutability_policy_name: str or ~azure.mgmt.storage.v2019_06_01.models.Enum27
1063
- :param if_match: The entity state (ETag) version of the immutability policy to update. A value
1064
- of "*" can be used to apply the operation only if the immutability policy already exists. If
1065
- omitted, this operation will always be applied. Default value is None.
1066
- :type if_match: str
1067
- :param parameters: The ImmutabilityPolicy Properties that will be created or updated to a blob
1068
- container. Is either a ImmutabilityPolicy type or a IO[bytes] type. Default value is None.
1069
- :type parameters: ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicy or IO[bytes]
1070
- :return: ImmutabilityPolicy or the result of cls(response)
1071
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicy
1072
- :raises ~azure.core.exceptions.HttpResponseError:
1073
- """
1074
- error_map: MutableMapping = {
1075
- 401: ClientAuthenticationError,
1076
- 404: ResourceNotFoundError,
1077
- 409: ResourceExistsError,
1078
- 304: ResourceNotModifiedError,
1079
- }
1080
- error_map.update(kwargs.pop("error_map", {}) or {})
1081
-
1082
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
1083
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
1084
-
1085
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
1086
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
1087
- cls: ClsType[_models.ImmutabilityPolicy] = kwargs.pop("cls", None)
1088
-
1089
- content_type = content_type or "application/json"
1090
- _json = None
1091
- _content = None
1092
- if isinstance(parameters, (IOBase, bytes)):
1093
- _content = parameters
1094
- else:
1095
- if parameters is not None:
1096
- _json = self._serialize.body(parameters, "ImmutabilityPolicy")
1097
- else:
1098
- _json = None
1099
-
1100
- _request = build_create_or_update_immutability_policy_request(
1101
- resource_group_name=resource_group_name,
1102
- account_name=account_name,
1103
- container_name=container_name,
1104
- immutability_policy_name=immutability_policy_name,
1105
- subscription_id=self._config.subscription_id,
1106
- if_match=if_match,
1107
- api_version=api_version,
1108
- content_type=content_type,
1109
- json=_json,
1110
- content=_content,
1111
- headers=_headers,
1112
- params=_params,
1113
- )
1114
- _request.url = self._client.format_url(_request.url)
1115
-
1116
- _stream = False
1117
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
1118
- _request, stream=_stream, **kwargs
1119
- )
1120
-
1121
- response = pipeline_response.http_response
1122
-
1123
- if response.status_code not in [200]:
1124
- map_error(status_code=response.status_code, response=response, error_map=error_map)
1125
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
1126
-
1127
- response_headers = {}
1128
- response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag"))
1129
-
1130
- deserialized = self._deserialize("ImmutabilityPolicy", pipeline_response.http_response)
1131
-
1132
- if cls:
1133
- return cls(pipeline_response, deserialized, response_headers) # type: ignore
1134
-
1135
- return deserialized # type: ignore
1136
-
1137
- @distributed_trace_async
1138
- async def get_immutability_policy(
1139
- self,
1140
- resource_group_name: str,
1141
- account_name: str,
1142
- container_name: str,
1143
- immutability_policy_name: Union[str, _models.Enum27],
1144
- if_match: Optional[str] = None,
1145
- **kwargs: Any
1146
- ) -> _models.ImmutabilityPolicy:
1147
- """Gets the existing immutability policy along with the corresponding ETag in response headers and
1148
- body.
1149
-
1150
- :param resource_group_name: The name of the resource group within the user's subscription. The
1151
- name is case insensitive. Required.
1152
- :type resource_group_name: str
1153
- :param account_name: The name of the storage account within the specified resource group.
1154
- Storage account names must be between 3 and 24 characters in length and use numbers and
1155
- lower-case letters only. Required.
1156
- :type account_name: str
1157
- :param container_name: The name of the blob container within the specified storage account.
1158
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
1159
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
1160
- by a letter or number. Required.
1161
- :type container_name: str
1162
- :param immutability_policy_name: The name of the blob container immutabilityPolicy within the
1163
- specified storage account. ImmutabilityPolicy Name must be 'default'. "default" Required.
1164
- :type immutability_policy_name: str or ~azure.mgmt.storage.v2019_06_01.models.Enum27
1165
- :param if_match: The entity state (ETag) version of the immutability policy to update. A value
1166
- of "*" can be used to apply the operation only if the immutability policy already exists. If
1167
- omitted, this operation will always be applied. Default value is None.
1168
- :type if_match: str
1169
- :return: ImmutabilityPolicy or the result of cls(response)
1170
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicy
1171
- :raises ~azure.core.exceptions.HttpResponseError:
1172
- """
1173
- error_map: MutableMapping = {
1174
- 401: ClientAuthenticationError,
1175
- 404: ResourceNotFoundError,
1176
- 409: ResourceExistsError,
1177
- 304: ResourceNotModifiedError,
1178
- }
1179
- error_map.update(kwargs.pop("error_map", {}) or {})
1180
-
1181
- _headers = kwargs.pop("headers", {}) or {}
1182
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
1183
-
1184
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
1185
- cls: ClsType[_models.ImmutabilityPolicy] = kwargs.pop("cls", None)
1186
-
1187
- _request = build_get_immutability_policy_request(
1188
- resource_group_name=resource_group_name,
1189
- account_name=account_name,
1190
- container_name=container_name,
1191
- immutability_policy_name=immutability_policy_name,
1192
- subscription_id=self._config.subscription_id,
1193
- if_match=if_match,
1194
- api_version=api_version,
1195
- headers=_headers,
1196
- params=_params,
1197
- )
1198
- _request.url = self._client.format_url(_request.url)
1199
-
1200
- _stream = False
1201
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
1202
- _request, stream=_stream, **kwargs
1203
- )
1204
-
1205
- response = pipeline_response.http_response
1206
-
1207
- if response.status_code not in [200]:
1208
- map_error(status_code=response.status_code, response=response, error_map=error_map)
1209
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
1210
-
1211
- response_headers = {}
1212
- response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag"))
1213
-
1214
- deserialized = self._deserialize("ImmutabilityPolicy", pipeline_response.http_response)
1215
-
1216
- if cls:
1217
- return cls(pipeline_response, deserialized, response_headers) # type: ignore
1218
-
1219
- return deserialized # type: ignore
1220
-
1221
- @distributed_trace_async
1222
- async def delete_immutability_policy(
1223
- self,
1224
- resource_group_name: str,
1225
- account_name: str,
1226
- container_name: str,
1227
- immutability_policy_name: Union[str, _models.Enum27],
1228
- if_match: str,
1229
- **kwargs: Any
1230
- ) -> _models.ImmutabilityPolicy:
1231
- """Aborts an unlocked immutability policy. The response of delete has
1232
- immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this
1233
- operation. Deleting a locked immutability policy is not allowed, the only way is to delete the
1234
- container after deleting all expired blobs inside the policy locked container.
1235
-
1236
- :param resource_group_name: The name of the resource group within the user's subscription. The
1237
- name is case insensitive. Required.
1238
- :type resource_group_name: str
1239
- :param account_name: The name of the storage account within the specified resource group.
1240
- Storage account names must be between 3 and 24 characters in length and use numbers and
1241
- lower-case letters only. Required.
1242
- :type account_name: str
1243
- :param container_name: The name of the blob container within the specified storage account.
1244
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
1245
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
1246
- by a letter or number. Required.
1247
- :type container_name: str
1248
- :param immutability_policy_name: The name of the blob container immutabilityPolicy within the
1249
- specified storage account. ImmutabilityPolicy Name must be 'default'. "default" Required.
1250
- :type immutability_policy_name: str or ~azure.mgmt.storage.v2019_06_01.models.Enum27
1251
- :param if_match: The entity state (ETag) version of the immutability policy to update. A value
1252
- of "*" can be used to apply the operation only if the immutability policy already exists. If
1253
- omitted, this operation will always be applied. Required.
1254
- :type if_match: str
1255
- :return: ImmutabilityPolicy or the result of cls(response)
1256
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicy
1257
- :raises ~azure.core.exceptions.HttpResponseError:
1258
- """
1259
- error_map: MutableMapping = {
1260
- 401: ClientAuthenticationError,
1261
- 404: ResourceNotFoundError,
1262
- 409: ResourceExistsError,
1263
- 304: ResourceNotModifiedError,
1264
- }
1265
- error_map.update(kwargs.pop("error_map", {}) or {})
1266
-
1267
- _headers = kwargs.pop("headers", {}) or {}
1268
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
1269
-
1270
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
1271
- cls: ClsType[_models.ImmutabilityPolicy] = kwargs.pop("cls", None)
1272
-
1273
- _request = build_delete_immutability_policy_request(
1274
- resource_group_name=resource_group_name,
1275
- account_name=account_name,
1276
- container_name=container_name,
1277
- immutability_policy_name=immutability_policy_name,
1278
- subscription_id=self._config.subscription_id,
1279
- if_match=if_match,
1280
- api_version=api_version,
1281
- headers=_headers,
1282
- params=_params,
1283
- )
1284
- _request.url = self._client.format_url(_request.url)
1285
-
1286
- _stream = False
1287
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
1288
- _request, stream=_stream, **kwargs
1289
- )
1290
-
1291
- response = pipeline_response.http_response
1292
-
1293
- if response.status_code not in [200]:
1294
- map_error(status_code=response.status_code, response=response, error_map=error_map)
1295
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
1296
-
1297
- response_headers = {}
1298
- response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag"))
1299
-
1300
- deserialized = self._deserialize("ImmutabilityPolicy", pipeline_response.http_response)
1301
-
1302
- if cls:
1303
- return cls(pipeline_response, deserialized, response_headers) # type: ignore
1304
-
1305
- return deserialized # type: ignore
1306
-
1307
- @distributed_trace_async
1308
- async def lock_immutability_policy(
1309
- self, resource_group_name: str, account_name: str, container_name: str, if_match: str, **kwargs: Any
1310
- ) -> _models.ImmutabilityPolicy:
1311
- """Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is
1312
- ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation.
1313
-
1314
- :param resource_group_name: The name of the resource group within the user's subscription. The
1315
- name is case insensitive. Required.
1316
- :type resource_group_name: str
1317
- :param account_name: The name of the storage account within the specified resource group.
1318
- Storage account names must be between 3 and 24 characters in length and use numbers and
1319
- lower-case letters only. Required.
1320
- :type account_name: str
1321
- :param container_name: The name of the blob container within the specified storage account.
1322
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
1323
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
1324
- by a letter or number. Required.
1325
- :type container_name: str
1326
- :param if_match: The entity state (ETag) version of the immutability policy to update. A value
1327
- of "*" can be used to apply the operation only if the immutability policy already exists. If
1328
- omitted, this operation will always be applied. Required.
1329
- :type if_match: str
1330
- :return: ImmutabilityPolicy or the result of cls(response)
1331
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicy
1332
- :raises ~azure.core.exceptions.HttpResponseError:
1333
- """
1334
- error_map: MutableMapping = {
1335
- 401: ClientAuthenticationError,
1336
- 404: ResourceNotFoundError,
1337
- 409: ResourceExistsError,
1338
- 304: ResourceNotModifiedError,
1339
- }
1340
- error_map.update(kwargs.pop("error_map", {}) or {})
1341
-
1342
- _headers = kwargs.pop("headers", {}) or {}
1343
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
1344
-
1345
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
1346
- cls: ClsType[_models.ImmutabilityPolicy] = kwargs.pop("cls", None)
1347
-
1348
- _request = build_lock_immutability_policy_request(
1349
- resource_group_name=resource_group_name,
1350
- account_name=account_name,
1351
- container_name=container_name,
1352
- subscription_id=self._config.subscription_id,
1353
- if_match=if_match,
1354
- api_version=api_version,
1355
- headers=_headers,
1356
- params=_params,
1357
- )
1358
- _request.url = self._client.format_url(_request.url)
1359
-
1360
- _stream = False
1361
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
1362
- _request, stream=_stream, **kwargs
1363
- )
1364
-
1365
- response = pipeline_response.http_response
1366
-
1367
- if response.status_code not in [200]:
1368
- map_error(status_code=response.status_code, response=response, error_map=error_map)
1369
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
1370
-
1371
- response_headers = {}
1372
- response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag"))
1373
-
1374
- deserialized = self._deserialize("ImmutabilityPolicy", pipeline_response.http_response)
1375
-
1376
- if cls:
1377
- return cls(pipeline_response, deserialized, response_headers) # type: ignore
1378
-
1379
- return deserialized # type: ignore
1380
-
1381
- @overload
1382
- async def extend_immutability_policy(
1383
- self,
1384
- resource_group_name: str,
1385
- account_name: str,
1386
- container_name: str,
1387
- if_match: str,
1388
- parameters: Optional[_models.ImmutabilityPolicy] = None,
1389
- *,
1390
- content_type: str = "application/json",
1391
- **kwargs: Any
1392
- ) -> _models.ImmutabilityPolicy:
1393
- """Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only
1394
- action allowed on a Locked policy will be this action. ETag in If-Match is required for this
1395
- operation.
1396
-
1397
- :param resource_group_name: The name of the resource group within the user's subscription. The
1398
- name is case insensitive. Required.
1399
- :type resource_group_name: str
1400
- :param account_name: The name of the storage account within the specified resource group.
1401
- Storage account names must be between 3 and 24 characters in length and use numbers and
1402
- lower-case letters only. Required.
1403
- :type account_name: str
1404
- :param container_name: The name of the blob container within the specified storage account.
1405
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
1406
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
1407
- by a letter or number. Required.
1408
- :type container_name: str
1409
- :param if_match: The entity state (ETag) version of the immutability policy to update. A value
1410
- of "*" can be used to apply the operation only if the immutability policy already exists. If
1411
- omitted, this operation will always be applied. Required.
1412
- :type if_match: str
1413
- :param parameters: The ImmutabilityPolicy Properties that will be extended for a blob
1414
- container. Default value is None.
1415
- :type parameters: ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicy
1416
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
1417
- Default value is "application/json".
1418
- :paramtype content_type: str
1419
- :return: ImmutabilityPolicy or the result of cls(response)
1420
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicy
1421
- :raises ~azure.core.exceptions.HttpResponseError:
1422
- """
1423
-
1424
- @overload
1425
- async def extend_immutability_policy(
1426
- self,
1427
- resource_group_name: str,
1428
- account_name: str,
1429
- container_name: str,
1430
- if_match: str,
1431
- parameters: Optional[IO[bytes]] = None,
1432
- *,
1433
- content_type: str = "application/json",
1434
- **kwargs: Any
1435
- ) -> _models.ImmutabilityPolicy:
1436
- """Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only
1437
- action allowed on a Locked policy will be this action. ETag in If-Match is required for this
1438
- operation.
1439
-
1440
- :param resource_group_name: The name of the resource group within the user's subscription. The
1441
- name is case insensitive. Required.
1442
- :type resource_group_name: str
1443
- :param account_name: The name of the storage account within the specified resource group.
1444
- Storage account names must be between 3 and 24 characters in length and use numbers and
1445
- lower-case letters only. Required.
1446
- :type account_name: str
1447
- :param container_name: The name of the blob container within the specified storage account.
1448
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
1449
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
1450
- by a letter or number. Required.
1451
- :type container_name: str
1452
- :param if_match: The entity state (ETag) version of the immutability policy to update. A value
1453
- of "*" can be used to apply the operation only if the immutability policy already exists. If
1454
- omitted, this operation will always be applied. Required.
1455
- :type if_match: str
1456
- :param parameters: The ImmutabilityPolicy Properties that will be extended for a blob
1457
- container. Default value is None.
1458
- :type parameters: IO[bytes]
1459
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
1460
- Default value is "application/json".
1461
- :paramtype content_type: str
1462
- :return: ImmutabilityPolicy or the result of cls(response)
1463
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicy
1464
- :raises ~azure.core.exceptions.HttpResponseError:
1465
- """
1466
-
1467
- @distributed_trace_async
1468
- async def extend_immutability_policy(
1469
- self,
1470
- resource_group_name: str,
1471
- account_name: str,
1472
- container_name: str,
1473
- if_match: str,
1474
- parameters: Optional[Union[_models.ImmutabilityPolicy, IO[bytes]]] = None,
1475
- **kwargs: Any
1476
- ) -> _models.ImmutabilityPolicy:
1477
- """Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only
1478
- action allowed on a Locked policy will be this action. ETag in If-Match is required for this
1479
- operation.
1480
-
1481
- :param resource_group_name: The name of the resource group within the user's subscription. The
1482
- name is case insensitive. Required.
1483
- :type resource_group_name: str
1484
- :param account_name: The name of the storage account within the specified resource group.
1485
- Storage account names must be between 3 and 24 characters in length and use numbers and
1486
- lower-case letters only. Required.
1487
- :type account_name: str
1488
- :param container_name: The name of the blob container within the specified storage account.
1489
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
1490
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
1491
- by a letter or number. Required.
1492
- :type container_name: str
1493
- :param if_match: The entity state (ETag) version of the immutability policy to update. A value
1494
- of "*" can be used to apply the operation only if the immutability policy already exists. If
1495
- omitted, this operation will always be applied. Required.
1496
- :type if_match: str
1497
- :param parameters: The ImmutabilityPolicy Properties that will be extended for a blob
1498
- container. Is either a ImmutabilityPolicy type or a IO[bytes] type. Default value is None.
1499
- :type parameters: ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicy or IO[bytes]
1500
- :return: ImmutabilityPolicy or the result of cls(response)
1501
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicy
1502
- :raises ~azure.core.exceptions.HttpResponseError:
1503
- """
1504
- error_map: MutableMapping = {
1505
- 401: ClientAuthenticationError,
1506
- 404: ResourceNotFoundError,
1507
- 409: ResourceExistsError,
1508
- 304: ResourceNotModifiedError,
1509
- }
1510
- error_map.update(kwargs.pop("error_map", {}) or {})
1511
-
1512
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
1513
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
1514
-
1515
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
1516
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
1517
- cls: ClsType[_models.ImmutabilityPolicy] = kwargs.pop("cls", None)
1518
-
1519
- content_type = content_type or "application/json"
1520
- _json = None
1521
- _content = None
1522
- if isinstance(parameters, (IOBase, bytes)):
1523
- _content = parameters
1524
- else:
1525
- if parameters is not None:
1526
- _json = self._serialize.body(parameters, "ImmutabilityPolicy")
1527
- else:
1528
- _json = None
1529
-
1530
- _request = build_extend_immutability_policy_request(
1531
- resource_group_name=resource_group_name,
1532
- account_name=account_name,
1533
- container_name=container_name,
1534
- subscription_id=self._config.subscription_id,
1535
- if_match=if_match,
1536
- api_version=api_version,
1537
- content_type=content_type,
1538
- json=_json,
1539
- content=_content,
1540
- headers=_headers,
1541
- params=_params,
1542
- )
1543
- _request.url = self._client.format_url(_request.url)
1544
-
1545
- _stream = False
1546
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
1547
- _request, stream=_stream, **kwargs
1548
- )
1549
-
1550
- response = pipeline_response.http_response
1551
-
1552
- if response.status_code not in [200]:
1553
- map_error(status_code=response.status_code, response=response, error_map=error_map)
1554
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
1555
-
1556
- response_headers = {}
1557
- response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag"))
1558
-
1559
- deserialized = self._deserialize("ImmutabilityPolicy", pipeline_response.http_response)
1560
-
1561
- if cls:
1562
- return cls(pipeline_response, deserialized, response_headers) # type: ignore
1563
-
1564
- return deserialized # type: ignore
1565
-
1566
- @overload
1567
- async def lease(
1568
- self,
1569
- resource_group_name: str,
1570
- account_name: str,
1571
- container_name: str,
1572
- parameters: Optional[_models.LeaseContainerRequest] = None,
1573
- *,
1574
- content_type: str = "application/json",
1575
- **kwargs: Any
1576
- ) -> _models.LeaseContainerResponse:
1577
- """The Lease Container operation establishes and manages a lock on a container for delete
1578
- operations. The lock duration can be 15 to 60 seconds, or can be infinite.
1579
-
1580
- :param resource_group_name: The name of the resource group within the user's subscription. The
1581
- name is case insensitive. Required.
1582
- :type resource_group_name: str
1583
- :param account_name: The name of the storage account within the specified resource group.
1584
- Storage account names must be between 3 and 24 characters in length and use numbers and
1585
- lower-case letters only. Required.
1586
- :type account_name: str
1587
- :param container_name: The name of the blob container within the specified storage account.
1588
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
1589
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
1590
- by a letter or number. Required.
1591
- :type container_name: str
1592
- :param parameters: Lease Container request body. Default value is None.
1593
- :type parameters: ~azure.mgmt.storage.v2019_06_01.models.LeaseContainerRequest
1594
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
1595
- Default value is "application/json".
1596
- :paramtype content_type: str
1597
- :return: LeaseContainerResponse or the result of cls(response)
1598
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.LeaseContainerResponse
1599
- :raises ~azure.core.exceptions.HttpResponseError:
1600
- """
1601
-
1602
- @overload
1603
- async def lease(
1604
- self,
1605
- resource_group_name: str,
1606
- account_name: str,
1607
- container_name: str,
1608
- parameters: Optional[IO[bytes]] = None,
1609
- *,
1610
- content_type: str = "application/json",
1611
- **kwargs: Any
1612
- ) -> _models.LeaseContainerResponse:
1613
- """The Lease Container operation establishes and manages a lock on a container for delete
1614
- operations. The lock duration can be 15 to 60 seconds, or can be infinite.
1615
-
1616
- :param resource_group_name: The name of the resource group within the user's subscription. The
1617
- name is case insensitive. Required.
1618
- :type resource_group_name: str
1619
- :param account_name: The name of the storage account within the specified resource group.
1620
- Storage account names must be between 3 and 24 characters in length and use numbers and
1621
- lower-case letters only. Required.
1622
- :type account_name: str
1623
- :param container_name: The name of the blob container within the specified storage account.
1624
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
1625
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
1626
- by a letter or number. Required.
1627
- :type container_name: str
1628
- :param parameters: Lease Container request body. Default value is None.
1629
- :type parameters: IO[bytes]
1630
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
1631
- Default value is "application/json".
1632
- :paramtype content_type: str
1633
- :return: LeaseContainerResponse or the result of cls(response)
1634
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.LeaseContainerResponse
1635
- :raises ~azure.core.exceptions.HttpResponseError:
1636
- """
1637
-
1638
- @distributed_trace_async
1639
- async def lease(
1640
- self,
1641
- resource_group_name: str,
1642
- account_name: str,
1643
- container_name: str,
1644
- parameters: Optional[Union[_models.LeaseContainerRequest, IO[bytes]]] = None,
1645
- **kwargs: Any
1646
- ) -> _models.LeaseContainerResponse:
1647
- """The Lease Container operation establishes and manages a lock on a container for delete
1648
- operations. The lock duration can be 15 to 60 seconds, or can be infinite.
1649
-
1650
- :param resource_group_name: The name of the resource group within the user's subscription. The
1651
- name is case insensitive. Required.
1652
- :type resource_group_name: str
1653
- :param account_name: The name of the storage account within the specified resource group.
1654
- Storage account names must be between 3 and 24 characters in length and use numbers and
1655
- lower-case letters only. Required.
1656
- :type account_name: str
1657
- :param container_name: The name of the blob container within the specified storage account.
1658
- Blob container names must be between 3 and 63 characters in length and use numbers, lower-case
1659
- letters and dash (-) only. Every dash (-) character must be immediately preceded and followed
1660
- by a letter or number. Required.
1661
- :type container_name: str
1662
- :param parameters: Lease Container request body. Is either a LeaseContainerRequest type or a
1663
- IO[bytes] type. Default value is None.
1664
- :type parameters: ~azure.mgmt.storage.v2019_06_01.models.LeaseContainerRequest or IO[bytes]
1665
- :return: LeaseContainerResponse or the result of cls(response)
1666
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.LeaseContainerResponse
1667
- :raises ~azure.core.exceptions.HttpResponseError:
1668
- """
1669
- error_map: MutableMapping = {
1670
- 401: ClientAuthenticationError,
1671
- 404: ResourceNotFoundError,
1672
- 409: ResourceExistsError,
1673
- 304: ResourceNotModifiedError,
1674
- }
1675
- error_map.update(kwargs.pop("error_map", {}) or {})
1676
-
1677
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
1678
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
1679
-
1680
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
1681
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
1682
- cls: ClsType[_models.LeaseContainerResponse] = kwargs.pop("cls", None)
1683
-
1684
- content_type = content_type or "application/json"
1685
- _json = None
1686
- _content = None
1687
- if isinstance(parameters, (IOBase, bytes)):
1688
- _content = parameters
1689
- else:
1690
- if parameters is not None:
1691
- _json = self._serialize.body(parameters, "LeaseContainerRequest")
1692
- else:
1693
- _json = None
1694
-
1695
- _request = build_lease_request(
1696
- resource_group_name=resource_group_name,
1697
- account_name=account_name,
1698
- container_name=container_name,
1699
- subscription_id=self._config.subscription_id,
1700
- api_version=api_version,
1701
- content_type=content_type,
1702
- json=_json,
1703
- content=_content,
1704
- headers=_headers,
1705
- params=_params,
1706
- )
1707
- _request.url = self._client.format_url(_request.url)
1708
-
1709
- _stream = False
1710
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
1711
- _request, stream=_stream, **kwargs
1712
- )
1713
-
1714
- response = pipeline_response.http_response
1715
-
1716
- if response.status_code not in [200]:
1717
- map_error(status_code=response.status_code, response=response, error_map=error_map)
1718
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
1719
-
1720
- deserialized = self._deserialize("LeaseContainerResponse", pipeline_response.http_response)
1721
-
1722
- if cls:
1723
- return cls(pipeline_response, deserialized, {}) # type: ignore
1724
-
1725
- return deserialized # type: ignore