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,567 +0,0 @@
1
- # coding=utf-8
2
- # --------------------------------------------------------------------------
3
- # Copyright (c) Microsoft Corporation. All rights reserved.
4
- # Licensed under the MIT License. See License.txt in the project root for license information.
5
- # Code generated by Microsoft (R) AutoRest Code Generator.
6
- # Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
- # --------------------------------------------------------------------------
8
- from io import IOBase
9
- import sys
10
- from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
11
- import urllib.parse
12
-
13
- from azure.core.exceptions import (
14
- ClientAuthenticationError,
15
- HttpResponseError,
16
- ResourceExistsError,
17
- ResourceNotFoundError,
18
- ResourceNotModifiedError,
19
- map_error,
20
- )
21
- from azure.core.paging import ItemPaged
22
- from azure.core.pipeline import PipelineResponse
23
- from azure.core.rest import HttpRequest, HttpResponse
24
- from azure.core.tracing.decorator import distributed_trace
25
- from azure.core.utils import case_insensitive_dict
26
- from azure.mgmt.core.exceptions import ARMErrorFormat
27
-
28
- from .. import models as _models
29
- from ..._serialization import Serializer
30
-
31
- if sys.version_info >= (3, 9):
32
- from collections.abc import MutableMapping
33
- else:
34
- from typing import MutableMapping # type: ignore
35
- T = TypeVar("T")
36
- ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
37
-
38
- _SERIALIZER = Serializer()
39
- _SERIALIZER.client_side_validation = False
40
-
41
-
42
- def build_list_request(resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest:
43
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
44
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
45
-
46
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01"))
47
- accept = _headers.pop("Accept", "application/json")
48
-
49
- # Construct URL
50
- _url = kwargs.pop(
51
- "template_url",
52
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies",
53
- ) # pylint: disable=line-too-long
54
- path_format_arguments = {
55
- "resourceGroupName": _SERIALIZER.url(
56
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
57
- ),
58
- "accountName": _SERIALIZER.url("account_name", account_name, "str", max_length=24, min_length=3),
59
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
60
- }
61
-
62
- _url: str = _url.format(**path_format_arguments) # type: ignore
63
-
64
- # Construct parameters
65
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
66
-
67
- # Construct headers
68
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
69
-
70
- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
71
-
72
-
73
- def build_get_request(
74
- resource_group_name: str, account_name: str, object_replication_policy_id: str, subscription_id: str, **kwargs: Any
75
- ) -> HttpRequest:
76
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
77
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
78
-
79
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01"))
80
- accept = _headers.pop("Accept", "application/json")
81
-
82
- # Construct URL
83
- _url = kwargs.pop(
84
- "template_url",
85
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}",
86
- ) # pylint: disable=line-too-long
87
- path_format_arguments = {
88
- "resourceGroupName": _SERIALIZER.url(
89
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
90
- ),
91
- "accountName": _SERIALIZER.url("account_name", account_name, "str", max_length=24, min_length=3),
92
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
93
- "objectReplicationPolicyId": _SERIALIZER.url(
94
- "object_replication_policy_id", object_replication_policy_id, "str", min_length=1
95
- ),
96
- }
97
-
98
- _url: str = _url.format(**path_format_arguments) # type: ignore
99
-
100
- # Construct parameters
101
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
102
-
103
- # Construct headers
104
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
105
-
106
- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
107
-
108
-
109
- def build_create_or_update_request(
110
- resource_group_name: str, account_name: str, object_replication_policy_id: str, subscription_id: str, **kwargs: Any
111
- ) -> HttpRequest:
112
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
113
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
114
-
115
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01"))
116
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
117
- accept = _headers.pop("Accept", "application/json")
118
-
119
- # Construct URL
120
- _url = kwargs.pop(
121
- "template_url",
122
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}",
123
- ) # pylint: disable=line-too-long
124
- path_format_arguments = {
125
- "resourceGroupName": _SERIALIZER.url(
126
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
127
- ),
128
- "accountName": _SERIALIZER.url("account_name", account_name, "str", max_length=24, min_length=3),
129
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
130
- "objectReplicationPolicyId": _SERIALIZER.url(
131
- "object_replication_policy_id", object_replication_policy_id, "str", min_length=1
132
- ),
133
- }
134
-
135
- _url: str = _url.format(**path_format_arguments) # type: ignore
136
-
137
- # Construct parameters
138
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
139
-
140
- # Construct headers
141
- if content_type is not None:
142
- _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
143
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
144
-
145
- return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs)
146
-
147
-
148
- def build_delete_request(
149
- resource_group_name: str, account_name: str, object_replication_policy_id: str, subscription_id: str, **kwargs: Any
150
- ) -> HttpRequest:
151
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
152
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
153
-
154
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01"))
155
- accept = _headers.pop("Accept", "application/json")
156
-
157
- # Construct URL
158
- _url = kwargs.pop(
159
- "template_url",
160
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}",
161
- ) # pylint: disable=line-too-long
162
- path_format_arguments = {
163
- "resourceGroupName": _SERIALIZER.url(
164
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
165
- ),
166
- "accountName": _SERIALIZER.url("account_name", account_name, "str", max_length=24, min_length=3),
167
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
168
- "objectReplicationPolicyId": _SERIALIZER.url(
169
- "object_replication_policy_id", object_replication_policy_id, "str", min_length=1
170
- ),
171
- }
172
-
173
- _url: str = _url.format(**path_format_arguments) # type: ignore
174
-
175
- # Construct parameters
176
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
177
-
178
- # Construct headers
179
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
180
-
181
- return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs)
182
-
183
-
184
- class ObjectReplicationPoliciesOperations:
185
- """
186
- .. warning::
187
- **DO NOT** instantiate this class directly.
188
-
189
- Instead, you should access the following operations through
190
- :class:`~azure.mgmt.storage.v2019_06_01.StorageManagementClient`'s
191
- :attr:`object_replication_policies` attribute.
192
- """
193
-
194
- models = _models
195
-
196
- def __init__(self, *args, **kwargs):
197
- input_args = list(args)
198
- self._client = input_args.pop(0) if input_args else kwargs.pop("client")
199
- self._config = input_args.pop(0) if input_args else kwargs.pop("config")
200
- self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
201
- self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
202
- self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
203
-
204
- @distributed_trace
205
- def list(
206
- self, resource_group_name: str, account_name: str, **kwargs: Any
207
- ) -> Iterable["_models.ObjectReplicationPolicy"]:
208
- """List the object replication policies associated with the storage account.
209
-
210
- :param resource_group_name: The name of the resource group within the user's subscription. The
211
- name is case insensitive. Required.
212
- :type resource_group_name: str
213
- :param account_name: The name of the storage account within the specified resource group.
214
- Storage account names must be between 3 and 24 characters in length and use numbers and
215
- lower-case letters only. Required.
216
- :type account_name: str
217
- :return: An iterator like instance of either ObjectReplicationPolicy or the result of
218
- cls(response)
219
- :rtype:
220
- ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2019_06_01.models.ObjectReplicationPolicy]
221
- :raises ~azure.core.exceptions.HttpResponseError:
222
- """
223
- _headers = kwargs.pop("headers", {}) or {}
224
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
225
-
226
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
227
- cls: ClsType[_models.ObjectReplicationPolicies] = kwargs.pop("cls", None)
228
-
229
- error_map: MutableMapping = {
230
- 401: ClientAuthenticationError,
231
- 404: ResourceNotFoundError,
232
- 409: ResourceExistsError,
233
- 304: ResourceNotModifiedError,
234
- }
235
- error_map.update(kwargs.pop("error_map", {}) or {})
236
-
237
- def prepare_request(next_link=None):
238
- if not next_link:
239
-
240
- _request = build_list_request(
241
- resource_group_name=resource_group_name,
242
- account_name=account_name,
243
- subscription_id=self._config.subscription_id,
244
- api_version=api_version,
245
- headers=_headers,
246
- params=_params,
247
- )
248
- _request.url = self._client.format_url(_request.url)
249
-
250
- else:
251
- # make call to next link with the client's api-version
252
- _parsed_next_link = urllib.parse.urlparse(next_link)
253
- _next_request_params = case_insensitive_dict(
254
- {
255
- key: [urllib.parse.quote(v) for v in value]
256
- for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
257
- }
258
- )
259
- _next_request_params["api-version"] = self._api_version
260
- _request = HttpRequest(
261
- "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
262
- )
263
- _request.url = self._client.format_url(_request.url)
264
- _request.method = "GET"
265
- return _request
266
-
267
- def extract_data(pipeline_response):
268
- deserialized = self._deserialize("ObjectReplicationPolicies", pipeline_response)
269
- list_of_elem = deserialized.value
270
- if cls:
271
- list_of_elem = cls(list_of_elem) # type: ignore
272
- return None, iter(list_of_elem)
273
-
274
- def get_next(next_link=None):
275
- _request = prepare_request(next_link)
276
-
277
- _stream = False
278
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
279
- _request, stream=_stream, **kwargs
280
- )
281
- response = pipeline_response.http_response
282
-
283
- if response.status_code not in [200]:
284
- map_error(status_code=response.status_code, response=response, error_map=error_map)
285
- error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
286
- raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
287
-
288
- return pipeline_response
289
-
290
- return ItemPaged(get_next, extract_data)
291
-
292
- @distributed_trace
293
- def get(
294
- self, resource_group_name: str, account_name: str, object_replication_policy_id: str, **kwargs: Any
295
- ) -> _models.ObjectReplicationPolicy:
296
- """Get the object replication policy of the storage account by policy ID.
297
-
298
- :param resource_group_name: The name of the resource group within the user's subscription. The
299
- name is case insensitive. Required.
300
- :type resource_group_name: str
301
- :param account_name: The name of the storage account within the specified resource group.
302
- Storage account names must be between 3 and 24 characters in length and use numbers and
303
- lower-case letters only. Required.
304
- :type account_name: str
305
- :param object_replication_policy_id: The ID of object replication policy or 'default' if the
306
- policy ID is unknown. Required.
307
- :type object_replication_policy_id: str
308
- :return: ObjectReplicationPolicy or the result of cls(response)
309
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.ObjectReplicationPolicy
310
- :raises ~azure.core.exceptions.HttpResponseError:
311
- """
312
- error_map: MutableMapping = {
313
- 401: ClientAuthenticationError,
314
- 404: ResourceNotFoundError,
315
- 409: ResourceExistsError,
316
- 304: ResourceNotModifiedError,
317
- }
318
- error_map.update(kwargs.pop("error_map", {}) or {})
319
-
320
- _headers = kwargs.pop("headers", {}) or {}
321
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
322
-
323
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
324
- cls: ClsType[_models.ObjectReplicationPolicy] = kwargs.pop("cls", None)
325
-
326
- _request = build_get_request(
327
- resource_group_name=resource_group_name,
328
- account_name=account_name,
329
- object_replication_policy_id=object_replication_policy_id,
330
- subscription_id=self._config.subscription_id,
331
- api_version=api_version,
332
- headers=_headers,
333
- params=_params,
334
- )
335
- _request.url = self._client.format_url(_request.url)
336
-
337
- _stream = False
338
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
339
- _request, stream=_stream, **kwargs
340
- )
341
-
342
- response = pipeline_response.http_response
343
-
344
- if response.status_code not in [200]:
345
- map_error(status_code=response.status_code, response=response, error_map=error_map)
346
- error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
347
- raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
348
-
349
- deserialized = self._deserialize("ObjectReplicationPolicy", pipeline_response.http_response)
350
-
351
- if cls:
352
- return cls(pipeline_response, deserialized, {}) # type: ignore
353
-
354
- return deserialized # type: ignore
355
-
356
- @overload
357
- def create_or_update(
358
- self,
359
- resource_group_name: str,
360
- account_name: str,
361
- object_replication_policy_id: str,
362
- properties: _models.ObjectReplicationPolicy,
363
- *,
364
- content_type: str = "application/json",
365
- **kwargs: Any
366
- ) -> _models.ObjectReplicationPolicy:
367
- """Create or update the object replication policy of the storage account.
368
-
369
- :param resource_group_name: The name of the resource group within the user's subscription. The
370
- name is case insensitive. Required.
371
- :type resource_group_name: str
372
- :param account_name: The name of the storage account within the specified resource group.
373
- Storage account names must be between 3 and 24 characters in length and use numbers and
374
- lower-case letters only. Required.
375
- :type account_name: str
376
- :param object_replication_policy_id: The ID of object replication policy or 'default' if the
377
- policy ID is unknown. Required.
378
- :type object_replication_policy_id: str
379
- :param properties: The object replication policy set to a storage account. A unique policy ID
380
- will be created if absent. Required.
381
- :type properties: ~azure.mgmt.storage.v2019_06_01.models.ObjectReplicationPolicy
382
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
383
- Default value is "application/json".
384
- :paramtype content_type: str
385
- :return: ObjectReplicationPolicy or the result of cls(response)
386
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.ObjectReplicationPolicy
387
- :raises ~azure.core.exceptions.HttpResponseError:
388
- """
389
-
390
- @overload
391
- def create_or_update(
392
- self,
393
- resource_group_name: str,
394
- account_name: str,
395
- object_replication_policy_id: str,
396
- properties: IO[bytes],
397
- *,
398
- content_type: str = "application/json",
399
- **kwargs: Any
400
- ) -> _models.ObjectReplicationPolicy:
401
- """Create or update the object replication policy of the storage account.
402
-
403
- :param resource_group_name: The name of the resource group within the user's subscription. The
404
- name is case insensitive. Required.
405
- :type resource_group_name: str
406
- :param account_name: The name of the storage account within the specified resource group.
407
- Storage account names must be between 3 and 24 characters in length and use numbers and
408
- lower-case letters only. Required.
409
- :type account_name: str
410
- :param object_replication_policy_id: The ID of object replication policy or 'default' if the
411
- policy ID is unknown. Required.
412
- :type object_replication_policy_id: str
413
- :param properties: The object replication policy set to a storage account. A unique policy ID
414
- will be created if absent. Required.
415
- :type properties: IO[bytes]
416
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
417
- Default value is "application/json".
418
- :paramtype content_type: str
419
- :return: ObjectReplicationPolicy or the result of cls(response)
420
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.ObjectReplicationPolicy
421
- :raises ~azure.core.exceptions.HttpResponseError:
422
- """
423
-
424
- @distributed_trace
425
- def create_or_update(
426
- self,
427
- resource_group_name: str,
428
- account_name: str,
429
- object_replication_policy_id: str,
430
- properties: Union[_models.ObjectReplicationPolicy, IO[bytes]],
431
- **kwargs: Any
432
- ) -> _models.ObjectReplicationPolicy:
433
- """Create or update the object replication policy of the storage account.
434
-
435
- :param resource_group_name: The name of the resource group within the user's subscription. The
436
- name is case insensitive. Required.
437
- :type resource_group_name: str
438
- :param account_name: The name of the storage account within the specified resource group.
439
- Storage account names must be between 3 and 24 characters in length and use numbers and
440
- lower-case letters only. Required.
441
- :type account_name: str
442
- :param object_replication_policy_id: The ID of object replication policy or 'default' if the
443
- policy ID is unknown. Required.
444
- :type object_replication_policy_id: str
445
- :param properties: The object replication policy set to a storage account. A unique policy ID
446
- will be created if absent. Is either a ObjectReplicationPolicy type or a IO[bytes] type.
447
- Required.
448
- :type properties: ~azure.mgmt.storage.v2019_06_01.models.ObjectReplicationPolicy or IO[bytes]
449
- :return: ObjectReplicationPolicy or the result of cls(response)
450
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.ObjectReplicationPolicy
451
- :raises ~azure.core.exceptions.HttpResponseError:
452
- """
453
- error_map: MutableMapping = {
454
- 401: ClientAuthenticationError,
455
- 404: ResourceNotFoundError,
456
- 409: ResourceExistsError,
457
- 304: ResourceNotModifiedError,
458
- }
459
- error_map.update(kwargs.pop("error_map", {}) or {})
460
-
461
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
462
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
463
-
464
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
465
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
466
- cls: ClsType[_models.ObjectReplicationPolicy] = kwargs.pop("cls", None)
467
-
468
- content_type = content_type or "application/json"
469
- _json = None
470
- _content = None
471
- if isinstance(properties, (IOBase, bytes)):
472
- _content = properties
473
- else:
474
- _json = self._serialize.body(properties, "ObjectReplicationPolicy")
475
-
476
- _request = build_create_or_update_request(
477
- resource_group_name=resource_group_name,
478
- account_name=account_name,
479
- object_replication_policy_id=object_replication_policy_id,
480
- subscription_id=self._config.subscription_id,
481
- api_version=api_version,
482
- content_type=content_type,
483
- json=_json,
484
- content=_content,
485
- headers=_headers,
486
- params=_params,
487
- )
488
- _request.url = self._client.format_url(_request.url)
489
-
490
- _stream = False
491
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
492
- _request, stream=_stream, **kwargs
493
- )
494
-
495
- response = pipeline_response.http_response
496
-
497
- if response.status_code not in [200]:
498
- map_error(status_code=response.status_code, response=response, error_map=error_map)
499
- error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
500
- raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
501
-
502
- deserialized = self._deserialize("ObjectReplicationPolicy", pipeline_response.http_response)
503
-
504
- if cls:
505
- return cls(pipeline_response, deserialized, {}) # type: ignore
506
-
507
- return deserialized # type: ignore
508
-
509
- @distributed_trace
510
- def delete( # pylint: disable=inconsistent-return-statements
511
- self, resource_group_name: str, account_name: str, object_replication_policy_id: str, **kwargs: Any
512
- ) -> None:
513
- """Deletes the object replication policy associated with the specified storage account.
514
-
515
- :param resource_group_name: The name of the resource group within the user's subscription. The
516
- name is case insensitive. Required.
517
- :type resource_group_name: str
518
- :param account_name: The name of the storage account within the specified resource group.
519
- Storage account names must be between 3 and 24 characters in length and use numbers and
520
- lower-case letters only. Required.
521
- :type account_name: str
522
- :param object_replication_policy_id: The ID of object replication policy or 'default' if the
523
- policy ID is unknown. Required.
524
- :type object_replication_policy_id: str
525
- :return: None or the result of cls(response)
526
- :rtype: None
527
- :raises ~azure.core.exceptions.HttpResponseError:
528
- """
529
- error_map: MutableMapping = {
530
- 401: ClientAuthenticationError,
531
- 404: ResourceNotFoundError,
532
- 409: ResourceExistsError,
533
- 304: ResourceNotModifiedError,
534
- }
535
- error_map.update(kwargs.pop("error_map", {}) or {})
536
-
537
- _headers = kwargs.pop("headers", {}) or {}
538
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
539
-
540
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
541
- cls: ClsType[None] = kwargs.pop("cls", None)
542
-
543
- _request = build_delete_request(
544
- resource_group_name=resource_group_name,
545
- account_name=account_name,
546
- object_replication_policy_id=object_replication_policy_id,
547
- subscription_id=self._config.subscription_id,
548
- api_version=api_version,
549
- headers=_headers,
550
- params=_params,
551
- )
552
- _request.url = self._client.format_url(_request.url)
553
-
554
- _stream = False
555
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
556
- _request, stream=_stream, **kwargs
557
- )
558
-
559
- response = pipeline_response.http_response
560
-
561
- if response.status_code not in [200, 204]:
562
- map_error(status_code=response.status_code, response=response, error_map=error_map)
563
- error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
564
- raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
565
-
566
- if cls:
567
- return cls(pipeline_response, None, {}) # type: ignore