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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) hide show
  1. azure/mgmt/storage/__init__.py +19 -7
  2. azure/mgmt/storage/_configuration.py +27 -29
  3. azure/mgmt/storage/{v2016_01_01/models/_patch.py → _patch.py} +5 -4
  4. azure/mgmt/storage/_storage_management_client.py +184 -499
  5. azure/mgmt/storage/{v2016_01_01/_version.py → _utils/__init__.py} +0 -3
  6. azure/mgmt/storage/{_serialization.py → _utils/serialization.py} +46 -131
  7. azure/mgmt/storage/_version.py +1 -1
  8. azure/mgmt/storage/aio/__init__.py +21 -2
  9. azure/mgmt/storage/aio/_configuration.py +27 -29
  10. azure/mgmt/storage/{v2017_10_01/aio/operations → aio}/_patch.py +5 -4
  11. azure/mgmt/storage/aio/_storage_management_client.py +188 -497
  12. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/__init__.py +1 -0
  13. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_blob_containers_operations.py +66 -69
  14. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_blob_inventory_policies_operations.py +26 -34
  15. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_blob_services_operations.py +20 -22
  16. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_deleted_accounts_operations.py +14 -17
  17. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_encryption_scopes_operations.py +27 -30
  18. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_file_services_operations.py +24 -27
  19. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_file_shares_operations.py +36 -39
  20. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_local_users_operations.py +26 -29
  21. azure/mgmt/storage/{v2019_06_01/aio → aio}/operations/_management_policies_operations.py +23 -30
  22. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_network_security_perimeter_configurations_operations.py +16 -19
  23. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_object_replication_policies_operations.py +21 -23
  24. azure/mgmt/storage/{v2017_10_01/aio → aio}/operations/_operations.py +12 -15
  25. azure/mgmt/storage/{v2016_01_01/aio → aio}/operations/_patch.py +5 -4
  26. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_private_endpoint_connections_operations.py +21 -23
  27. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_private_link_resources_operations.py +11 -13
  28. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_queue_operations.py +27 -30
  29. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_queue_services_operations.py +19 -21
  30. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_skus_operations.py +12 -15
  31. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_storage_accounts_operations.py +80 -95
  32. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_storage_task_assignment_instances_report_operations.py +13 -15
  33. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_storage_task_assignments_instances_report_operations.py +13 -15
  34. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_storage_task_assignments_operations.py +30 -39
  35. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_table_operations.py +27 -29
  36. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_table_services_operations.py +19 -21
  37. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_usages_operations.py +12 -14
  38. azure/mgmt/storage/{v2024_01_01/models → models}/_models_py3.py +855 -910
  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 +81 -84
  42. azure/mgmt/storage/{v2024_01_01/operations → operations}/_blob_inventory_policies_operations.py +31 -39
  43. azure/mgmt/storage/{v2024_01_01/operations → operations}/_blob_services_operations.py +24 -27
  44. azure/mgmt/storage/{v2024_01_01/operations → operations}/_deleted_accounts_operations.py +16 -18
  45. azure/mgmt/storage/{v2024_01_01/operations → operations}/_encryption_scopes_operations.py +32 -34
  46. azure/mgmt/storage/{v2024_01_01/operations → operations}/_file_services_operations.py +30 -32
  47. azure/mgmt/storage/{v2024_01_01/operations → operations}/_file_shares_operations.py +44 -47
  48. azure/mgmt/storage/{v2024_01_01/operations → operations}/_local_users_operations.py +33 -35
  49. azure/mgmt/storage/{v2024_01_01/operations → operations}/_management_policies_operations.py +27 -34
  50. azure/mgmt/storage/{v2024_01_01/operations → operations}/_network_security_perimeter_configurations_operations.py +20 -22
  51. azure/mgmt/storage/{v2024_01_01/operations → operations}/_object_replication_policies_operations.py +26 -29
  52. azure/mgmt/storage/{v2024_01_01/operations → operations}/_operations.py +12 -15
  53. azure/mgmt/storage/operations/_patch.py +21 -0
  54. azure/mgmt/storage/{v2024_01_01/operations → operations}/_private_endpoint_connections_operations.py +26 -29
  55. azure/mgmt/storage/{v2024_01_01/operations → operations}/_private_link_resources_operations.py +13 -15
  56. azure/mgmt/storage/{v2024_01_01/operations → operations}/_queue_operations.py +33 -35
  57. azure/mgmt/storage/{v2024_01_01/operations → operations}/_queue_services_operations.py +23 -25
  58. azure/mgmt/storage/{v2024_01_01/operations → operations}/_skus_operations.py +12 -15
  59. azure/mgmt/storage/{v2024_01_01/operations → operations}/_storage_accounts_operations.py +97 -105
  60. azure/mgmt/storage/{v2024_01_01/operations → operations}/_storage_task_assignment_instances_report_operations.py +14 -18
  61. azure/mgmt/storage/{v2024_01_01/operations → operations}/_storage_task_assignments_instances_report_operations.py +14 -18
  62. azure/mgmt/storage/{v2024_01_01/operations → operations}/_storage_task_assignments_operations.py +36 -47
  63. azure/mgmt/storage/{v2024_01_01/operations → operations}/_table_operations.py +33 -35
  64. azure/mgmt/storage/{v2024_01_01/operations → operations}/_table_services_operations.py +23 -25
  65. azure/mgmt/storage/{v2024_01_01/operations → operations}/_usages_operations.py +13 -16
  66. {azure_mgmt_storage-22.2.0.dist-info → azure_mgmt_storage-23.0.0.dist-info}/METADATA +11 -6
  67. azure_mgmt_storage-23.0.0.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.0.dist-info}/LICENSE +0 -0
  183. {azure_mgmt_storage-22.2.0.dist-info → azure_mgmt_storage-23.0.0.dist-info}/WHEEL +0 -0
  184. {azure_mgmt_storage-22.2.0.dist-info → azure_mgmt_storage-23.0.0.dist-info}/top_level.txt +0 -0
@@ -1,428 +0,0 @@
1
- # coding=utf-8
2
- # --------------------------------------------------------------------------
3
- # Copyright (c) Microsoft Corporation. All rights reserved.
4
- # Licensed under the MIT License. See License.txt in the project root for license information.
5
- # Code generated by Microsoft (R) AutoRest Code Generator.
6
- # Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
- # --------------------------------------------------------------------------
8
- from io import IOBase
9
- import sys
10
- from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
11
- import urllib.parse
12
-
13
- from azure.core.async_paging import AsyncItemPaged, AsyncList
14
- from azure.core.exceptions import (
15
- ClientAuthenticationError,
16
- HttpResponseError,
17
- ResourceExistsError,
18
- ResourceNotFoundError,
19
- ResourceNotModifiedError,
20
- map_error,
21
- )
22
- from azure.core.pipeline import PipelineResponse
23
- from azure.core.rest import AsyncHttpResponse, HttpRequest
24
- from azure.core.tracing.decorator import distributed_trace
25
- from azure.core.tracing.decorator_async import distributed_trace_async
26
- from azure.core.utils import case_insensitive_dict
27
- from azure.mgmt.core.exceptions import ARMErrorFormat
28
-
29
- from ... import models as _models
30
- from ...operations._object_replication_policies_operations import (
31
- build_create_or_update_request,
32
- build_delete_request,
33
- build_get_request,
34
- build_list_request,
35
- )
36
-
37
- if sys.version_info >= (3, 9):
38
- from collections.abc import MutableMapping
39
- else:
40
- from typing import MutableMapping # type: ignore
41
- T = TypeVar("T")
42
- ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
43
-
44
-
45
- class ObjectReplicationPoliciesOperations:
46
- """
47
- .. warning::
48
- **DO NOT** instantiate this class directly.
49
-
50
- Instead, you should access the following operations through
51
- :class:`~azure.mgmt.storage.v2019_06_01.aio.StorageManagementClient`'s
52
- :attr:`object_replication_policies` attribute.
53
- """
54
-
55
- models = _models
56
-
57
- def __init__(self, *args, **kwargs) -> None:
58
- input_args = list(args)
59
- self._client = input_args.pop(0) if input_args else kwargs.pop("client")
60
- self._config = input_args.pop(0) if input_args else kwargs.pop("config")
61
- self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
62
- self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
63
- self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
64
-
65
- @distributed_trace
66
- def list(
67
- self, resource_group_name: str, account_name: str, **kwargs: Any
68
- ) -> AsyncIterable["_models.ObjectReplicationPolicy"]:
69
- """List the object replication policies associated with the storage account.
70
-
71
- :param resource_group_name: The name of the resource group within the user's subscription. The
72
- name is case insensitive. Required.
73
- :type resource_group_name: str
74
- :param account_name: The name of the storage account within the specified resource group.
75
- Storage account names must be between 3 and 24 characters in length and use numbers and
76
- lower-case letters only. Required.
77
- :type account_name: str
78
- :return: An iterator like instance of either ObjectReplicationPolicy or the result of
79
- cls(response)
80
- :rtype:
81
- ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2019_06_01.models.ObjectReplicationPolicy]
82
- :raises ~azure.core.exceptions.HttpResponseError:
83
- """
84
- _headers = kwargs.pop("headers", {}) or {}
85
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
86
-
87
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
88
- cls: ClsType[_models.ObjectReplicationPolicies] = kwargs.pop("cls", None)
89
-
90
- error_map: MutableMapping = {
91
- 401: ClientAuthenticationError,
92
- 404: ResourceNotFoundError,
93
- 409: ResourceExistsError,
94
- 304: ResourceNotModifiedError,
95
- }
96
- error_map.update(kwargs.pop("error_map", {}) or {})
97
-
98
- def prepare_request(next_link=None):
99
- if not next_link:
100
-
101
- _request = build_list_request(
102
- resource_group_name=resource_group_name,
103
- account_name=account_name,
104
- subscription_id=self._config.subscription_id,
105
- api_version=api_version,
106
- headers=_headers,
107
- params=_params,
108
- )
109
- _request.url = self._client.format_url(_request.url)
110
-
111
- else:
112
- # make call to next link with the client's api-version
113
- _parsed_next_link = urllib.parse.urlparse(next_link)
114
- _next_request_params = case_insensitive_dict(
115
- {
116
- key: [urllib.parse.quote(v) for v in value]
117
- for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
118
- }
119
- )
120
- _next_request_params["api-version"] = self._api_version
121
- _request = HttpRequest(
122
- "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
123
- )
124
- _request.url = self._client.format_url(_request.url)
125
- _request.method = "GET"
126
- return _request
127
-
128
- async def extract_data(pipeline_response):
129
- deserialized = self._deserialize("ObjectReplicationPolicies", pipeline_response)
130
- list_of_elem = deserialized.value
131
- if cls:
132
- list_of_elem = cls(list_of_elem) # type: ignore
133
- return None, AsyncList(list_of_elem)
134
-
135
- async def get_next(next_link=None):
136
- _request = prepare_request(next_link)
137
-
138
- _stream = False
139
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
140
- _request, stream=_stream, **kwargs
141
- )
142
- response = pipeline_response.http_response
143
-
144
- if response.status_code not in [200]:
145
- map_error(status_code=response.status_code, response=response, error_map=error_map)
146
- error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
147
- raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
148
-
149
- return pipeline_response
150
-
151
- return AsyncItemPaged(get_next, extract_data)
152
-
153
- @distributed_trace_async
154
- async def get(
155
- self, resource_group_name: str, account_name: str, object_replication_policy_id: str, **kwargs: Any
156
- ) -> _models.ObjectReplicationPolicy:
157
- """Get the object replication policy of the storage account by policy ID.
158
-
159
- :param resource_group_name: The name of the resource group within the user's subscription. The
160
- name is case insensitive. Required.
161
- :type resource_group_name: str
162
- :param account_name: The name of the storage account within the specified resource group.
163
- Storage account names must be between 3 and 24 characters in length and use numbers and
164
- lower-case letters only. Required.
165
- :type account_name: str
166
- :param object_replication_policy_id: The ID of object replication policy or 'default' if the
167
- policy ID is unknown. Required.
168
- :type object_replication_policy_id: str
169
- :return: ObjectReplicationPolicy or the result of cls(response)
170
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.ObjectReplicationPolicy
171
- :raises ~azure.core.exceptions.HttpResponseError:
172
- """
173
- error_map: MutableMapping = {
174
- 401: ClientAuthenticationError,
175
- 404: ResourceNotFoundError,
176
- 409: ResourceExistsError,
177
- 304: ResourceNotModifiedError,
178
- }
179
- error_map.update(kwargs.pop("error_map", {}) or {})
180
-
181
- _headers = kwargs.pop("headers", {}) or {}
182
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
183
-
184
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
185
- cls: ClsType[_models.ObjectReplicationPolicy] = kwargs.pop("cls", None)
186
-
187
- _request = build_get_request(
188
- resource_group_name=resource_group_name,
189
- account_name=account_name,
190
- object_replication_policy_id=object_replication_policy_id,
191
- subscription_id=self._config.subscription_id,
192
- api_version=api_version,
193
- headers=_headers,
194
- params=_params,
195
- )
196
- _request.url = self._client.format_url(_request.url)
197
-
198
- _stream = False
199
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
200
- _request, stream=_stream, **kwargs
201
- )
202
-
203
- response = pipeline_response.http_response
204
-
205
- if response.status_code not in [200]:
206
- map_error(status_code=response.status_code, response=response, error_map=error_map)
207
- error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
208
- raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
209
-
210
- deserialized = self._deserialize("ObjectReplicationPolicy", pipeline_response.http_response)
211
-
212
- if cls:
213
- return cls(pipeline_response, deserialized, {}) # type: ignore
214
-
215
- return deserialized # type: ignore
216
-
217
- @overload
218
- async def create_or_update(
219
- self,
220
- resource_group_name: str,
221
- account_name: str,
222
- object_replication_policy_id: str,
223
- properties: _models.ObjectReplicationPolicy,
224
- *,
225
- content_type: str = "application/json",
226
- **kwargs: Any
227
- ) -> _models.ObjectReplicationPolicy:
228
- """Create or update the object replication policy of the storage account.
229
-
230
- :param resource_group_name: The name of the resource group within the user's subscription. The
231
- name is case insensitive. Required.
232
- :type resource_group_name: str
233
- :param account_name: The name of the storage account within the specified resource group.
234
- Storage account names must be between 3 and 24 characters in length and use numbers and
235
- lower-case letters only. Required.
236
- :type account_name: str
237
- :param object_replication_policy_id: The ID of object replication policy or 'default' if the
238
- policy ID is unknown. Required.
239
- :type object_replication_policy_id: str
240
- :param properties: The object replication policy set to a storage account. A unique policy ID
241
- will be created if absent. Required.
242
- :type properties: ~azure.mgmt.storage.v2019_06_01.models.ObjectReplicationPolicy
243
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
244
- Default value is "application/json".
245
- :paramtype content_type: str
246
- :return: ObjectReplicationPolicy or the result of cls(response)
247
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.ObjectReplicationPolicy
248
- :raises ~azure.core.exceptions.HttpResponseError:
249
- """
250
-
251
- @overload
252
- async def create_or_update(
253
- self,
254
- resource_group_name: str,
255
- account_name: str,
256
- object_replication_policy_id: str,
257
- properties: IO[bytes],
258
- *,
259
- content_type: str = "application/json",
260
- **kwargs: Any
261
- ) -> _models.ObjectReplicationPolicy:
262
- """Create or update the object replication policy of the storage account.
263
-
264
- :param resource_group_name: The name of the resource group within the user's subscription. The
265
- name is case insensitive. Required.
266
- :type resource_group_name: str
267
- :param account_name: The name of the storage account within the specified resource group.
268
- Storage account names must be between 3 and 24 characters in length and use numbers and
269
- lower-case letters only. Required.
270
- :type account_name: str
271
- :param object_replication_policy_id: The ID of object replication policy or 'default' if the
272
- policy ID is unknown. Required.
273
- :type object_replication_policy_id: str
274
- :param properties: The object replication policy set to a storage account. A unique policy ID
275
- will be created if absent. Required.
276
- :type properties: IO[bytes]
277
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
278
- Default value is "application/json".
279
- :paramtype content_type: str
280
- :return: ObjectReplicationPolicy or the result of cls(response)
281
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.ObjectReplicationPolicy
282
- :raises ~azure.core.exceptions.HttpResponseError:
283
- """
284
-
285
- @distributed_trace_async
286
- async def create_or_update(
287
- self,
288
- resource_group_name: str,
289
- account_name: str,
290
- object_replication_policy_id: str,
291
- properties: Union[_models.ObjectReplicationPolicy, IO[bytes]],
292
- **kwargs: Any
293
- ) -> _models.ObjectReplicationPolicy:
294
- """Create or update the object replication policy of the storage account.
295
-
296
- :param resource_group_name: The name of the resource group within the user's subscription. The
297
- name is case insensitive. Required.
298
- :type resource_group_name: str
299
- :param account_name: The name of the storage account within the specified resource group.
300
- Storage account names must be between 3 and 24 characters in length and use numbers and
301
- lower-case letters only. Required.
302
- :type account_name: str
303
- :param object_replication_policy_id: The ID of object replication policy or 'default' if the
304
- policy ID is unknown. Required.
305
- :type object_replication_policy_id: str
306
- :param properties: The object replication policy set to a storage account. A unique policy ID
307
- will be created if absent. Is either a ObjectReplicationPolicy type or a IO[bytes] type.
308
- Required.
309
- :type properties: ~azure.mgmt.storage.v2019_06_01.models.ObjectReplicationPolicy or IO[bytes]
310
- :return: ObjectReplicationPolicy or the result of cls(response)
311
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.ObjectReplicationPolicy
312
- :raises ~azure.core.exceptions.HttpResponseError:
313
- """
314
- error_map: MutableMapping = {
315
- 401: ClientAuthenticationError,
316
- 404: ResourceNotFoundError,
317
- 409: ResourceExistsError,
318
- 304: ResourceNotModifiedError,
319
- }
320
- error_map.update(kwargs.pop("error_map", {}) or {})
321
-
322
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
323
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
324
-
325
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
326
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
327
- cls: ClsType[_models.ObjectReplicationPolicy] = kwargs.pop("cls", None)
328
-
329
- content_type = content_type or "application/json"
330
- _json = None
331
- _content = None
332
- if isinstance(properties, (IOBase, bytes)):
333
- _content = properties
334
- else:
335
- _json = self._serialize.body(properties, "ObjectReplicationPolicy")
336
-
337
- _request = build_create_or_update_request(
338
- resource_group_name=resource_group_name,
339
- account_name=account_name,
340
- object_replication_policy_id=object_replication_policy_id,
341
- subscription_id=self._config.subscription_id,
342
- api_version=api_version,
343
- content_type=content_type,
344
- json=_json,
345
- content=_content,
346
- headers=_headers,
347
- params=_params,
348
- )
349
- _request.url = self._client.format_url(_request.url)
350
-
351
- _stream = False
352
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
353
- _request, stream=_stream, **kwargs
354
- )
355
-
356
- response = pipeline_response.http_response
357
-
358
- if response.status_code not in [200]:
359
- map_error(status_code=response.status_code, response=response, error_map=error_map)
360
- error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
361
- raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
362
-
363
- deserialized = self._deserialize("ObjectReplicationPolicy", pipeline_response.http_response)
364
-
365
- if cls:
366
- return cls(pipeline_response, deserialized, {}) # type: ignore
367
-
368
- return deserialized # type: ignore
369
-
370
- @distributed_trace_async
371
- async def delete(
372
- self, resource_group_name: str, account_name: str, object_replication_policy_id: str, **kwargs: Any
373
- ) -> None:
374
- """Deletes the object replication policy associated with the specified storage account.
375
-
376
- :param resource_group_name: The name of the resource group within the user's subscription. The
377
- name is case insensitive. Required.
378
- :type resource_group_name: str
379
- :param account_name: The name of the storage account within the specified resource group.
380
- Storage account names must be between 3 and 24 characters in length and use numbers and
381
- lower-case letters only. Required.
382
- :type account_name: str
383
- :param object_replication_policy_id: The ID of object replication policy or 'default' if the
384
- policy ID is unknown. Required.
385
- :type object_replication_policy_id: str
386
- :return: None or the result of cls(response)
387
- :rtype: None
388
- :raises ~azure.core.exceptions.HttpResponseError:
389
- """
390
- error_map: MutableMapping = {
391
- 401: ClientAuthenticationError,
392
- 404: ResourceNotFoundError,
393
- 409: ResourceExistsError,
394
- 304: ResourceNotModifiedError,
395
- }
396
- error_map.update(kwargs.pop("error_map", {}) or {})
397
-
398
- _headers = kwargs.pop("headers", {}) or {}
399
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
400
-
401
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
402
- cls: ClsType[None] = kwargs.pop("cls", None)
403
-
404
- _request = build_delete_request(
405
- resource_group_name=resource_group_name,
406
- account_name=account_name,
407
- object_replication_policy_id=object_replication_policy_id,
408
- subscription_id=self._config.subscription_id,
409
- api_version=api_version,
410
- headers=_headers,
411
- params=_params,
412
- )
413
- _request.url = self._client.format_url(_request.url)
414
-
415
- _stream = False
416
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
417
- _request, stream=_stream, **kwargs
418
- )
419
-
420
- response = pipeline_response.http_response
421
-
422
- if response.status_code not in [200, 204]:
423
- map_error(status_code=response.status_code, response=response, error_map=error_map)
424
- error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
425
- raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
426
-
427
- if cls:
428
- return cls(pipeline_response, None, {}) # type: ignore
@@ -1,130 +0,0 @@
1
- # coding=utf-8
2
- # --------------------------------------------------------------------------
3
- # Copyright (c) Microsoft Corporation. All rights reserved.
4
- # Licensed under the MIT License. See License.txt in the project root for license information.
5
- # Code generated by Microsoft (R) AutoRest Code Generator.
6
- # Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
- # --------------------------------------------------------------------------
8
- import sys
9
- from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
10
- import urllib.parse
11
-
12
- from azure.core.async_paging import AsyncItemPaged, AsyncList
13
- from azure.core.exceptions import (
14
- ClientAuthenticationError,
15
- HttpResponseError,
16
- ResourceExistsError,
17
- ResourceNotFoundError,
18
- ResourceNotModifiedError,
19
- map_error,
20
- )
21
- from azure.core.pipeline import PipelineResponse
22
- from azure.core.rest import AsyncHttpResponse, HttpRequest
23
- from azure.core.tracing.decorator import distributed_trace
24
- from azure.core.utils import case_insensitive_dict
25
- from azure.mgmt.core.exceptions import ARMErrorFormat
26
-
27
- from ... import models as _models
28
- from ...operations._operations import build_list_request
29
-
30
- if sys.version_info >= (3, 9):
31
- from collections.abc import MutableMapping
32
- else:
33
- from typing import MutableMapping # type: ignore
34
- T = TypeVar("T")
35
- ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
36
-
37
-
38
- class Operations:
39
- """
40
- .. warning::
41
- **DO NOT** instantiate this class directly.
42
-
43
- Instead, you should access the following operations through
44
- :class:`~azure.mgmt.storage.v2019_06_01.aio.StorageManagementClient`'s
45
- :attr:`operations` attribute.
46
- """
47
-
48
- models = _models
49
-
50
- def __init__(self, *args, **kwargs) -> None:
51
- input_args = list(args)
52
- self._client = input_args.pop(0) if input_args else kwargs.pop("client")
53
- self._config = input_args.pop(0) if input_args else kwargs.pop("config")
54
- self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
55
- self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
56
- self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
57
-
58
- @distributed_trace
59
- def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]:
60
- """Lists all of the available Storage Rest API operations.
61
-
62
- :return: An iterator like instance of either Operation or the result of cls(response)
63
- :rtype:
64
- ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2019_06_01.models.Operation]
65
- :raises ~azure.core.exceptions.HttpResponseError:
66
- """
67
- _headers = kwargs.pop("headers", {}) or {}
68
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
69
-
70
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
71
- cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
72
-
73
- error_map: MutableMapping = {
74
- 401: ClientAuthenticationError,
75
- 404: ResourceNotFoundError,
76
- 409: ResourceExistsError,
77
- 304: ResourceNotModifiedError,
78
- }
79
- error_map.update(kwargs.pop("error_map", {}) or {})
80
-
81
- def prepare_request(next_link=None):
82
- if not next_link:
83
-
84
- _request = build_list_request(
85
- api_version=api_version,
86
- headers=_headers,
87
- params=_params,
88
- )
89
- _request.url = self._client.format_url(_request.url)
90
-
91
- else:
92
- # make call to next link with the client's api-version
93
- _parsed_next_link = urllib.parse.urlparse(next_link)
94
- _next_request_params = case_insensitive_dict(
95
- {
96
- key: [urllib.parse.quote(v) for v in value]
97
- for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
98
- }
99
- )
100
- _next_request_params["api-version"] = self._api_version
101
- _request = HttpRequest(
102
- "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
103
- )
104
- _request.url = self._client.format_url(_request.url)
105
- _request.method = "GET"
106
- return _request
107
-
108
- async def extract_data(pipeline_response):
109
- deserialized = self._deserialize("OperationListResult", pipeline_response)
110
- list_of_elem = deserialized.value
111
- if cls:
112
- list_of_elem = cls(list_of_elem) # type: ignore
113
- return None, AsyncList(list_of_elem)
114
-
115
- async def get_next(next_link=None):
116
- _request = prepare_request(next_link)
117
-
118
- _stream = False
119
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
120
- _request, stream=_stream, **kwargs
121
- )
122
- response = pipeline_response.http_response
123
-
124
- if response.status_code not in [200]:
125
- map_error(status_code=response.status_code, response=response, error_map=error_map)
126
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
127
-
128
- return pipeline_response
129
-
130
- return AsyncItemPaged(get_next, extract_data)
@@ -1,20 +0,0 @@
1
- # ------------------------------------
2
- # Copyright (c) Microsoft Corporation.
3
- # Licensed under the MIT License.
4
- # ------------------------------------
5
- """Customize generated code here.
6
-
7
- Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
8
- """
9
- from typing import List
10
-
11
- __all__: List[str] = [] # Add all objects you want publicly available to users at this package level
12
-
13
-
14
- def patch_sdk():
15
- """Do not remove from this file.
16
-
17
- `patch_sdk` is a last resort escape hatch that allows you to do customizations
18
- you can't accomplish using the techniques described in
19
- https://aka.ms/azsdk/python/dpcodegen/python/customize
20
- """