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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) hide show
  1. azure/mgmt/storage/__init__.py +19 -7
  2. azure/mgmt/storage/_configuration.py +27 -29
  3. azure/mgmt/storage/{v2016_01_01/models/_patch.py → _patch.py} +5 -4
  4. azure/mgmt/storage/_storage_management_client.py +184 -499
  5. azure/mgmt/storage/{v2016_01_01/_version.py → _utils/__init__.py} +0 -3
  6. azure/mgmt/storage/{_serialization.py → _utils/serialization.py} +46 -131
  7. azure/mgmt/storage/_version.py +1 -1
  8. azure/mgmt/storage/aio/__init__.py +21 -2
  9. azure/mgmt/storage/aio/_configuration.py +27 -29
  10. azure/mgmt/storage/{v2017_10_01/aio/operations → aio}/_patch.py +5 -4
  11. azure/mgmt/storage/aio/_storage_management_client.py +188 -497
  12. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/__init__.py +1 -0
  13. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_blob_containers_operations.py +66 -69
  14. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_blob_inventory_policies_operations.py +26 -34
  15. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_blob_services_operations.py +20 -22
  16. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_deleted_accounts_operations.py +14 -17
  17. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_encryption_scopes_operations.py +27 -30
  18. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_file_services_operations.py +24 -27
  19. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_file_shares_operations.py +36 -39
  20. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_local_users_operations.py +26 -29
  21. azure/mgmt/storage/{v2019_06_01/aio → aio}/operations/_management_policies_operations.py +23 -30
  22. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_network_security_perimeter_configurations_operations.py +16 -19
  23. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_object_replication_policies_operations.py +21 -23
  24. azure/mgmt/storage/{v2017_10_01/aio → aio}/operations/_operations.py +12 -15
  25. azure/mgmt/storage/{v2016_01_01/aio → aio}/operations/_patch.py +5 -4
  26. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_private_endpoint_connections_operations.py +21 -23
  27. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_private_link_resources_operations.py +11 -13
  28. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_queue_operations.py +27 -30
  29. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_queue_services_operations.py +19 -21
  30. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_skus_operations.py +12 -15
  31. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_storage_accounts_operations.py +81 -96
  32. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_storage_task_assignment_instances_report_operations.py +14 -16
  33. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_storage_task_assignments_instances_report_operations.py +14 -16
  34. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_storage_task_assignments_operations.py +30 -39
  35. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_table_operations.py +27 -29
  36. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_table_services_operations.py +19 -21
  37. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_usages_operations.py +12 -14
  38. azure/mgmt/storage/{v2024_01_01/models → models}/_models_py3.py +870 -927
  39. azure/mgmt/storage/{v2016_01_01/operations → models}/_patch.py +5 -4
  40. azure/mgmt/storage/{v2024_01_01/models → models}/_storage_management_client_enums.py +1 -0
  41. azure/mgmt/storage/{v2024_01_01/operations → operations}/__init__.py +1 -0
  42. azure/mgmt/storage/{v2024_01_01/operations → operations}/_blob_containers_operations.py +81 -84
  43. azure/mgmt/storage/{v2024_01_01/operations → operations}/_blob_inventory_policies_operations.py +31 -39
  44. azure/mgmt/storage/{v2024_01_01/operations → operations}/_blob_services_operations.py +24 -27
  45. azure/mgmt/storage/{v2024_01_01/operations → operations}/_deleted_accounts_operations.py +16 -18
  46. azure/mgmt/storage/{v2024_01_01/operations → operations}/_encryption_scopes_operations.py +32 -34
  47. azure/mgmt/storage/{v2024_01_01/operations → operations}/_file_services_operations.py +30 -32
  48. azure/mgmt/storage/{v2024_01_01/operations → operations}/_file_shares_operations.py +44 -47
  49. azure/mgmt/storage/{v2024_01_01/operations → operations}/_local_users_operations.py +33 -35
  50. azure/mgmt/storage/{v2024_01_01/operations → operations}/_management_policies_operations.py +27 -34
  51. azure/mgmt/storage/{v2024_01_01/operations → operations}/_network_security_perimeter_configurations_operations.py +20 -22
  52. azure/mgmt/storage/{v2024_01_01/operations → operations}/_object_replication_policies_operations.py +26 -29
  53. azure/mgmt/storage/{v2024_01_01/operations → operations}/_operations.py +12 -15
  54. azure/mgmt/storage/operations/_patch.py +21 -0
  55. azure/mgmt/storage/{v2024_01_01/operations → operations}/_private_endpoint_connections_operations.py +26 -29
  56. azure/mgmt/storage/{v2024_01_01/operations → operations}/_private_link_resources_operations.py +13 -15
  57. azure/mgmt/storage/{v2024_01_01/operations → operations}/_queue_operations.py +33 -35
  58. azure/mgmt/storage/{v2024_01_01/operations → operations}/_queue_services_operations.py +23 -25
  59. azure/mgmt/storage/{v2024_01_01/operations → operations}/_skus_operations.py +12 -15
  60. azure/mgmt/storage/{v2024_01_01/operations → operations}/_storage_accounts_operations.py +98 -106
  61. azure/mgmt/storage/{v2024_01_01/operations → operations}/_storage_task_assignment_instances_report_operations.py +15 -19
  62. azure/mgmt/storage/{v2024_01_01/operations → operations}/_storage_task_assignments_instances_report_operations.py +15 -19
  63. azure/mgmt/storage/{v2024_01_01/operations → operations}/_storage_task_assignments_operations.py +36 -47
  64. azure/mgmt/storage/{v2024_01_01/operations → operations}/_table_operations.py +33 -35
  65. azure/mgmt/storage/{v2024_01_01/operations → operations}/_table_services_operations.py +23 -25
  66. azure/mgmt/storage/{v2024_01_01/operations → operations}/_usages_operations.py +13 -16
  67. {azure_mgmt_storage-22.1.1.dist-info → azure_mgmt_storage-23.0.0.dist-info}/METADATA +20 -10
  68. azure_mgmt_storage-23.0.0.dist-info/RECORD +73 -0
  69. {azure_mgmt_storage-22.1.1.dist-info → azure_mgmt_storage-23.0.0.dist-info}/WHEEL +1 -1
  70. azure/mgmt/storage/models.py +0 -8
  71. azure/mgmt/storage/v2016_01_01/__init__.py +0 -32
  72. azure/mgmt/storage/v2016_01_01/_configuration.py +0 -65
  73. azure/mgmt/storage/v2016_01_01/_patch.py +0 -32
  74. azure/mgmt/storage/v2016_01_01/_storage_management_client.py +0 -117
  75. azure/mgmt/storage/v2016_01_01/aio/__init__.py +0 -29
  76. azure/mgmt/storage/v2016_01_01/aio/_configuration.py +0 -65
  77. azure/mgmt/storage/v2016_01_01/aio/_patch.py +0 -32
  78. azure/mgmt/storage/v2016_01_01/aio/_storage_management_client.py +0 -120
  79. azure/mgmt/storage/v2016_01_01/aio/operations/__init__.py +0 -27
  80. azure/mgmt/storage/v2016_01_01/aio/operations/_storage_accounts_operations.py +0 -1023
  81. azure/mgmt/storage/v2016_01_01/aio/operations/_usage_operations.py +0 -130
  82. azure/mgmt/storage/v2016_01_01/models/__init__.py +0 -88
  83. azure/mgmt/storage/v2016_01_01/models/_models_py3.py +0 -829
  84. azure/mgmt/storage/v2016_01_01/models/_storage_management_client_enums.py +0 -99
  85. azure/mgmt/storage/v2016_01_01/operations/__init__.py +0 -27
  86. azure/mgmt/storage/v2016_01_01/operations/_storage_accounts_operations.py +0 -1278
  87. azure/mgmt/storage/v2016_01_01/operations/_usage_operations.py +0 -157
  88. azure/mgmt/storage/v2016_01_01/py.typed +0 -1
  89. azure/mgmt/storage/v2017_10_01/__init__.py +0 -32
  90. azure/mgmt/storage/v2017_10_01/_configuration.py +0 -65
  91. azure/mgmt/storage/v2017_10_01/_patch.py +0 -32
  92. azure/mgmt/storage/v2017_10_01/_storage_management.py +0 -121
  93. azure/mgmt/storage/v2017_10_01/_version.py +0 -9
  94. azure/mgmt/storage/v2017_10_01/aio/__init__.py +0 -29
  95. azure/mgmt/storage/v2017_10_01/aio/_configuration.py +0 -65
  96. azure/mgmt/storage/v2017_10_01/aio/_patch.py +0 -32
  97. azure/mgmt/storage/v2017_10_01/aio/_storage_management.py +0 -124
  98. azure/mgmt/storage/v2017_10_01/aio/operations/__init__.py +0 -31
  99. azure/mgmt/storage/v2017_10_01/aio/operations/_skus_operations.py +0 -130
  100. azure/mgmt/storage/v2017_10_01/aio/operations/_storage_accounts_operations.py +0 -1299
  101. azure/mgmt/storage/v2017_10_01/aio/operations/_usage_operations.py +0 -130
  102. azure/mgmt/storage/v2017_10_01/models/__init__.py +0 -140
  103. azure/mgmt/storage/v2017_10_01/models/_models_py3.py +0 -1851
  104. azure/mgmt/storage/v2017_10_01/models/_patch.py +0 -20
  105. azure/mgmt/storage/v2017_10_01/models/_storage_management_enums.py +0 -192
  106. azure/mgmt/storage/v2017_10_01/operations/__init__.py +0 -31
  107. azure/mgmt/storage/v2017_10_01/operations/_operations.py +0 -151
  108. azure/mgmt/storage/v2017_10_01/operations/_patch.py +0 -20
  109. azure/mgmt/storage/v2017_10_01/operations/_skus_operations.py +0 -157
  110. azure/mgmt/storage/v2017_10_01/operations/_storage_accounts_operations.py +0 -1638
  111. azure/mgmt/storage/v2017_10_01/operations/_usage_operations.py +0 -157
  112. azure/mgmt/storage/v2017_10_01/py.typed +0 -1
  113. azure/mgmt/storage/v2019_06_01/__init__.py +0 -32
  114. azure/mgmt/storage/v2019_06_01/_configuration.py +0 -64
  115. azure/mgmt/storage/v2019_06_01/_patch.py +0 -32
  116. azure/mgmt/storage/v2019_06_01/_storage_management_client.py +0 -213
  117. azure/mgmt/storage/v2019_06_01/_version.py +0 -9
  118. azure/mgmt/storage/v2019_06_01/aio/__init__.py +0 -29
  119. azure/mgmt/storage/v2019_06_01/aio/_configuration.py +0 -64
  120. azure/mgmt/storage/v2019_06_01/aio/_patch.py +0 -32
  121. azure/mgmt/storage/v2019_06_01/aio/_storage_management_client.py +0 -217
  122. azure/mgmt/storage/v2019_06_01/aio/operations/__init__.py +0 -59
  123. azure/mgmt/storage/v2019_06_01/aio/operations/_blob_containers_operations.py +0 -1725
  124. azure/mgmt/storage/v2019_06_01/aio/operations/_blob_inventory_policies_operations.py +0 -437
  125. azure/mgmt/storage/v2019_06_01/aio/operations/_blob_services_operations.py +0 -368
  126. azure/mgmt/storage/v2019_06_01/aio/operations/_encryption_scopes_operations.py +0 -538
  127. azure/mgmt/storage/v2019_06_01/aio/operations/_file_services_operations.py +0 -335
  128. azure/mgmt/storage/v2019_06_01/aio/operations/_file_shares_operations.py +0 -771
  129. azure/mgmt/storage/v2019_06_01/aio/operations/_object_replication_policies_operations.py +0 -428
  130. azure/mgmt/storage/v2019_06_01/aio/operations/_operations.py +0 -130
  131. azure/mgmt/storage/v2019_06_01/aio/operations/_patch.py +0 -20
  132. azure/mgmt/storage/v2019_06_01/aio/operations/_private_endpoint_connections_operations.py +0 -424
  133. azure/mgmt/storage/v2019_06_01/aio/operations/_private_link_resources_operations.py +0 -113
  134. azure/mgmt/storage/v2019_06_01/aio/operations/_queue_operations.py +0 -597
  135. azure/mgmt/storage/v2019_06_01/aio/operations/_queue_services_operations.py +0 -335
  136. azure/mgmt/storage/v2019_06_01/aio/operations/_skus_operations.py +0 -131
  137. azure/mgmt/storage/v2019_06_01/aio/operations/_storage_accounts_operations.py +0 -1696
  138. azure/mgmt/storage/v2019_06_01/aio/operations/_table_operations.py +0 -394
  139. azure/mgmt/storage/v2019_06_01/aio/operations/_table_services_operations.py +0 -335
  140. azure/mgmt/storage/v2019_06_01/aio/operations/_usages_operations.py +0 -134
  141. azure/mgmt/storage/v2019_06_01/models/__init__.py +0 -364
  142. azure/mgmt/storage/v2019_06_01/models/_models_py3.py +0 -6038
  143. azure/mgmt/storage/v2019_06_01/models/_patch.py +0 -20
  144. azure/mgmt/storage/v2019_06_01/models/_storage_management_client_enums.py +0 -456
  145. azure/mgmt/storage/v2019_06_01/operations/__init__.py +0 -59
  146. azure/mgmt/storage/v2019_06_01/operations/_blob_containers_operations.py +0 -2226
  147. azure/mgmt/storage/v2019_06_01/operations/_blob_inventory_policies_operations.py +0 -582
  148. azure/mgmt/storage/v2019_06_01/operations/_blob_services_operations.py +0 -476
  149. azure/mgmt/storage/v2019_06_01/operations/_encryption_scopes_operations.py +0 -677
  150. azure/mgmt/storage/v2019_06_01/operations/_file_services_operations.py +0 -444
  151. azure/mgmt/storage/v2019_06_01/operations/_file_shares_operations.py +0 -1000
  152. azure/mgmt/storage/v2019_06_01/operations/_management_policies_operations.py +0 -453
  153. azure/mgmt/storage/v2019_06_01/operations/_object_replication_policies_operations.py +0 -567
  154. azure/mgmt/storage/v2019_06_01/operations/_operations.py +0 -151
  155. azure/mgmt/storage/v2019_06_01/operations/_patch.py +0 -20
  156. azure/mgmt/storage/v2019_06_01/operations/_private_endpoint_connections_operations.py +0 -575
  157. azure/mgmt/storage/v2019_06_01/operations/_private_link_resources_operations.py +0 -149
  158. azure/mgmt/storage/v2019_06_01/operations/_queue_operations.py +0 -805
  159. azure/mgmt/storage/v2019_06_01/operations/_queue_services_operations.py +0 -444
  160. azure/mgmt/storage/v2019_06_01/operations/_skus_operations.py +0 -157
  161. azure/mgmt/storage/v2019_06_01/operations/_storage_accounts_operations.py +0 -2122
  162. azure/mgmt/storage/v2019_06_01/operations/_table_operations.py +0 -563
  163. azure/mgmt/storage/v2019_06_01/operations/_table_services_operations.py +0 -444
  164. azure/mgmt/storage/v2019_06_01/operations/_usages_operations.py +0 -164
  165. azure/mgmt/storage/v2019_06_01/py.typed +0 -1
  166. azure/mgmt/storage/v2024_01_01/__init__.py +0 -32
  167. azure/mgmt/storage/v2024_01_01/_configuration.py +0 -64
  168. azure/mgmt/storage/v2024_01_01/_patch.py +0 -20
  169. azure/mgmt/storage/v2024_01_01/_storage_management_client.py +0 -256
  170. azure/mgmt/storage/v2024_01_01/_version.py +0 -9
  171. azure/mgmt/storage/v2024_01_01/aio/__init__.py +0 -29
  172. azure/mgmt/storage/v2024_01_01/aio/_configuration.py +0 -64
  173. azure/mgmt/storage/v2024_01_01/aio/_patch.py +0 -20
  174. azure/mgmt/storage/v2024_01_01/aio/_storage_management_client.py +0 -261
  175. azure/mgmt/storage/v2024_01_01/aio/operations/_management_policies_operations.py +0 -343
  176. azure/mgmt/storage/v2024_01_01/aio/operations/_operations.py +0 -130
  177. azure/mgmt/storage/v2024_01_01/aio/operations/_patch.py +0 -20
  178. azure/mgmt/storage/v2024_01_01/models/_patch.py +0 -20
  179. azure/mgmt/storage/v2024_01_01/operations/_patch.py +0 -20
  180. azure/mgmt/storage/v2024_01_01/py.typed +0 -1
  181. azure_mgmt_storage-22.1.1.dist-info/RECORD +0 -183
  182. /azure/mgmt/storage/{v2024_01_01/models → models}/__init__.py +0 -0
  183. {azure_mgmt_storage-22.1.1.dist-info → azure_mgmt_storage-23.0.0.dist-info}/LICENSE +0 -0
  184. {azure_mgmt_storage-22.1.1.dist-info → azure_mgmt_storage-23.0.0.dist-info}/top_level.txt +0 -0
@@ -1,453 +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, Optional, TypeVar, Union, overload
11
-
12
- from azure.core.exceptions import (
13
- ClientAuthenticationError,
14
- HttpResponseError,
15
- ResourceExistsError,
16
- ResourceNotFoundError,
17
- ResourceNotModifiedError,
18
- map_error,
19
- )
20
- from azure.core.pipeline import PipelineResponse
21
- from azure.core.rest import HttpRequest, HttpResponse
22
- from azure.core.tracing.decorator import distributed_trace
23
- from azure.core.utils import case_insensitive_dict
24
- from azure.mgmt.core.exceptions import ARMErrorFormat
25
-
26
- from .. import models as _models
27
- from ..._serialization import Serializer
28
-
29
- if sys.version_info >= (3, 9):
30
- from collections.abc import MutableMapping
31
- else:
32
- from typing import MutableMapping # type: ignore
33
- T = TypeVar("T")
34
- ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
35
-
36
- _SERIALIZER = Serializer()
37
- _SERIALIZER.client_side_validation = False
38
-
39
-
40
- def build_get_request(
41
- resource_group_name: str,
42
- account_name: str,
43
- management_policy_name: Union[str, _models.ManagementPolicyName],
44
- subscription_id: str,
45
- **kwargs: Any
46
- ) -> HttpRequest:
47
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
48
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
49
-
50
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01"))
51
- accept = _headers.pop("Accept", "application/json")
52
-
53
- # Construct URL
54
- _url = kwargs.pop(
55
- "template_url",
56
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}",
57
- ) # pylint: disable=line-too-long
58
- path_format_arguments = {
59
- "resourceGroupName": _SERIALIZER.url(
60
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
61
- ),
62
- "accountName": _SERIALIZER.url("account_name", account_name, "str", max_length=24, min_length=3),
63
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
64
- "managementPolicyName": _SERIALIZER.url("management_policy_name", management_policy_name, "str"),
65
- }
66
-
67
- _url: str = _url.format(**path_format_arguments) # type: ignore
68
-
69
- # Construct parameters
70
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
71
-
72
- # Construct headers
73
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
74
-
75
- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
76
-
77
-
78
- def build_create_or_update_request(
79
- resource_group_name: str,
80
- account_name: str,
81
- management_policy_name: Union[str, _models.ManagementPolicyName],
82
- subscription_id: str,
83
- **kwargs: Any
84
- ) -> HttpRequest:
85
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
86
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
87
-
88
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01"))
89
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
90
- accept = _headers.pop("Accept", "application/json")
91
-
92
- # Construct URL
93
- _url = kwargs.pop(
94
- "template_url",
95
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}",
96
- ) # pylint: disable=line-too-long
97
- path_format_arguments = {
98
- "resourceGroupName": _SERIALIZER.url(
99
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
100
- ),
101
- "accountName": _SERIALIZER.url("account_name", account_name, "str", max_length=24, min_length=3),
102
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
103
- "managementPolicyName": _SERIALIZER.url("management_policy_name", management_policy_name, "str"),
104
- }
105
-
106
- _url: str = _url.format(**path_format_arguments) # type: ignore
107
-
108
- # Construct parameters
109
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
110
-
111
- # Construct headers
112
- if content_type is not None:
113
- _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
114
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
115
-
116
- return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs)
117
-
118
-
119
- def build_delete_request(
120
- resource_group_name: str,
121
- account_name: str,
122
- management_policy_name: Union[str, _models.ManagementPolicyName],
123
- subscription_id: str,
124
- **kwargs: Any
125
- ) -> HttpRequest:
126
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
127
-
128
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01"))
129
- # Construct URL
130
- _url = kwargs.pop(
131
- "template_url",
132
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}",
133
- ) # pylint: disable=line-too-long
134
- path_format_arguments = {
135
- "resourceGroupName": _SERIALIZER.url(
136
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
137
- ),
138
- "accountName": _SERIALIZER.url("account_name", account_name, "str", max_length=24, min_length=3),
139
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
140
- "managementPolicyName": _SERIALIZER.url("management_policy_name", management_policy_name, "str"),
141
- }
142
-
143
- _url: str = _url.format(**path_format_arguments) # type: ignore
144
-
145
- # Construct parameters
146
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
147
-
148
- return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs)
149
-
150
-
151
- class ManagementPoliciesOperations:
152
- """
153
- .. warning::
154
- **DO NOT** instantiate this class directly.
155
-
156
- Instead, you should access the following operations through
157
- :class:`~azure.mgmt.storage.v2019_06_01.StorageManagementClient`'s
158
- :attr:`management_policies` attribute.
159
- """
160
-
161
- models = _models
162
-
163
- def __init__(self, *args, **kwargs):
164
- input_args = list(args)
165
- self._client = input_args.pop(0) if input_args else kwargs.pop("client")
166
- self._config = input_args.pop(0) if input_args else kwargs.pop("config")
167
- self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
168
- self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
169
- self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
170
-
171
- @distributed_trace
172
- def get(
173
- self,
174
- resource_group_name: str,
175
- account_name: str,
176
- management_policy_name: Union[str, _models.ManagementPolicyName],
177
- **kwargs: Any
178
- ) -> _models.ManagementPolicy:
179
- """Gets the managementpolicy associated with the specified storage account.
180
-
181
- :param resource_group_name: The name of the resource group within the user's subscription. The
182
- name is case insensitive. Required.
183
- :type resource_group_name: str
184
- :param account_name: The name of the storage account within the specified resource group.
185
- Storage account names must be between 3 and 24 characters in length and use numbers and
186
- lower-case letters only. Required.
187
- :type account_name: str
188
- :param management_policy_name: The name of the Storage Account Management Policy. It should
189
- always be 'default'. "default" Required.
190
- :type management_policy_name: str or
191
- ~azure.mgmt.storage.v2019_06_01.models.ManagementPolicyName
192
- :return: ManagementPolicy or the result of cls(response)
193
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.ManagementPolicy
194
- :raises ~azure.core.exceptions.HttpResponseError:
195
- """
196
- error_map: MutableMapping = {
197
- 401: ClientAuthenticationError,
198
- 404: ResourceNotFoundError,
199
- 409: ResourceExistsError,
200
- 304: ResourceNotModifiedError,
201
- }
202
- error_map.update(kwargs.pop("error_map", {}) or {})
203
-
204
- _headers = kwargs.pop("headers", {}) or {}
205
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
206
-
207
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
208
- cls: ClsType[_models.ManagementPolicy] = kwargs.pop("cls", None)
209
-
210
- _request = build_get_request(
211
- resource_group_name=resource_group_name,
212
- account_name=account_name,
213
- management_policy_name=management_policy_name,
214
- subscription_id=self._config.subscription_id,
215
- api_version=api_version,
216
- headers=_headers,
217
- params=_params,
218
- )
219
- _request.url = self._client.format_url(_request.url)
220
-
221
- _stream = False
222
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
223
- _request, stream=_stream, **kwargs
224
- )
225
-
226
- response = pipeline_response.http_response
227
-
228
- if response.status_code not in [200]:
229
- map_error(status_code=response.status_code, response=response, error_map=error_map)
230
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
231
-
232
- deserialized = self._deserialize("ManagementPolicy", pipeline_response.http_response)
233
-
234
- if cls:
235
- return cls(pipeline_response, deserialized, {}) # type: ignore
236
-
237
- return deserialized # type: ignore
238
-
239
- @overload
240
- def create_or_update(
241
- self,
242
- resource_group_name: str,
243
- account_name: str,
244
- management_policy_name: Union[str, _models.ManagementPolicyName],
245
- properties: _models.ManagementPolicy,
246
- *,
247
- content_type: str = "application/json",
248
- **kwargs: Any
249
- ) -> _models.ManagementPolicy:
250
- """Sets the managementpolicy to the specified storage account.
251
-
252
- :param resource_group_name: The name of the resource group within the user's subscription. The
253
- name is case insensitive. Required.
254
- :type resource_group_name: str
255
- :param account_name: The name of the storage account within the specified resource group.
256
- Storage account names must be between 3 and 24 characters in length and use numbers and
257
- lower-case letters only. Required.
258
- :type account_name: str
259
- :param management_policy_name: The name of the Storage Account Management Policy. It should
260
- always be 'default'. "default" Required.
261
- :type management_policy_name: str or
262
- ~azure.mgmt.storage.v2019_06_01.models.ManagementPolicyName
263
- :param properties: The ManagementPolicy set to a storage account. Required.
264
- :type properties: ~azure.mgmt.storage.v2019_06_01.models.ManagementPolicy
265
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
266
- Default value is "application/json".
267
- :paramtype content_type: str
268
- :return: ManagementPolicy or the result of cls(response)
269
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.ManagementPolicy
270
- :raises ~azure.core.exceptions.HttpResponseError:
271
- """
272
-
273
- @overload
274
- def create_or_update(
275
- self,
276
- resource_group_name: str,
277
- account_name: str,
278
- management_policy_name: Union[str, _models.ManagementPolicyName],
279
- properties: IO[bytes],
280
- *,
281
- content_type: str = "application/json",
282
- **kwargs: Any
283
- ) -> _models.ManagementPolicy:
284
- """Sets the managementpolicy to the specified storage account.
285
-
286
- :param resource_group_name: The name of the resource group within the user's subscription. The
287
- name is case insensitive. Required.
288
- :type resource_group_name: str
289
- :param account_name: The name of the storage account within the specified resource group.
290
- Storage account names must be between 3 and 24 characters in length and use numbers and
291
- lower-case letters only. Required.
292
- :type account_name: str
293
- :param management_policy_name: The name of the Storage Account Management Policy. It should
294
- always be 'default'. "default" Required.
295
- :type management_policy_name: str or
296
- ~azure.mgmt.storage.v2019_06_01.models.ManagementPolicyName
297
- :param properties: The ManagementPolicy set to a storage account. Required.
298
- :type properties: IO[bytes]
299
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
300
- Default value is "application/json".
301
- :paramtype content_type: str
302
- :return: ManagementPolicy or the result of cls(response)
303
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.ManagementPolicy
304
- :raises ~azure.core.exceptions.HttpResponseError:
305
- """
306
-
307
- @distributed_trace
308
- def create_or_update(
309
- self,
310
- resource_group_name: str,
311
- account_name: str,
312
- management_policy_name: Union[str, _models.ManagementPolicyName],
313
- properties: Union[_models.ManagementPolicy, IO[bytes]],
314
- **kwargs: Any
315
- ) -> _models.ManagementPolicy:
316
- """Sets the managementpolicy to the specified storage account.
317
-
318
- :param resource_group_name: The name of the resource group within the user's subscription. The
319
- name is case insensitive. Required.
320
- :type resource_group_name: str
321
- :param account_name: The name of the storage account within the specified resource group.
322
- Storage account names must be between 3 and 24 characters in length and use numbers and
323
- lower-case letters only. Required.
324
- :type account_name: str
325
- :param management_policy_name: The name of the Storage Account Management Policy. It should
326
- always be 'default'. "default" Required.
327
- :type management_policy_name: str or
328
- ~azure.mgmt.storage.v2019_06_01.models.ManagementPolicyName
329
- :param properties: The ManagementPolicy set to a storage account. Is either a ManagementPolicy
330
- type or a IO[bytes] type. Required.
331
- :type properties: ~azure.mgmt.storage.v2019_06_01.models.ManagementPolicy or IO[bytes]
332
- :return: ManagementPolicy or the result of cls(response)
333
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.ManagementPolicy
334
- :raises ~azure.core.exceptions.HttpResponseError:
335
- """
336
- error_map: MutableMapping = {
337
- 401: ClientAuthenticationError,
338
- 404: ResourceNotFoundError,
339
- 409: ResourceExistsError,
340
- 304: ResourceNotModifiedError,
341
- }
342
- error_map.update(kwargs.pop("error_map", {}) or {})
343
-
344
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
345
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
346
-
347
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
348
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
349
- cls: ClsType[_models.ManagementPolicy] = kwargs.pop("cls", None)
350
-
351
- content_type = content_type or "application/json"
352
- _json = None
353
- _content = None
354
- if isinstance(properties, (IOBase, bytes)):
355
- _content = properties
356
- else:
357
- _json = self._serialize.body(properties, "ManagementPolicy")
358
-
359
- _request = build_create_or_update_request(
360
- resource_group_name=resource_group_name,
361
- account_name=account_name,
362
- management_policy_name=management_policy_name,
363
- subscription_id=self._config.subscription_id,
364
- api_version=api_version,
365
- content_type=content_type,
366
- json=_json,
367
- content=_content,
368
- headers=_headers,
369
- params=_params,
370
- )
371
- _request.url = self._client.format_url(_request.url)
372
-
373
- _stream = False
374
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
375
- _request, stream=_stream, **kwargs
376
- )
377
-
378
- response = pipeline_response.http_response
379
-
380
- if response.status_code not in [200]:
381
- map_error(status_code=response.status_code, response=response, error_map=error_map)
382
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
383
-
384
- deserialized = self._deserialize("ManagementPolicy", pipeline_response.http_response)
385
-
386
- if cls:
387
- return cls(pipeline_response, deserialized, {}) # type: ignore
388
-
389
- return deserialized # type: ignore
390
-
391
- @distributed_trace
392
- def delete( # pylint: disable=inconsistent-return-statements
393
- self,
394
- resource_group_name: str,
395
- account_name: str,
396
- management_policy_name: Union[str, _models.ManagementPolicyName],
397
- **kwargs: Any
398
- ) -> None:
399
- """Deletes the managementpolicy associated with the specified storage account.
400
-
401
- :param resource_group_name: The name of the resource group within the user's subscription. The
402
- name is case insensitive. Required.
403
- :type resource_group_name: str
404
- :param account_name: The name of the storage account within the specified resource group.
405
- Storage account names must be between 3 and 24 characters in length and use numbers and
406
- lower-case letters only. Required.
407
- :type account_name: str
408
- :param management_policy_name: The name of the Storage Account Management Policy. It should
409
- always be 'default'. "default" Required.
410
- :type management_policy_name: str or
411
- ~azure.mgmt.storage.v2019_06_01.models.ManagementPolicyName
412
- :return: None or the result of cls(response)
413
- :rtype: None
414
- :raises ~azure.core.exceptions.HttpResponseError:
415
- """
416
- error_map: MutableMapping = {
417
- 401: ClientAuthenticationError,
418
- 404: ResourceNotFoundError,
419
- 409: ResourceExistsError,
420
- 304: ResourceNotModifiedError,
421
- }
422
- error_map.update(kwargs.pop("error_map", {}) or {})
423
-
424
- _headers = kwargs.pop("headers", {}) or {}
425
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
426
-
427
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
428
- cls: ClsType[None] = kwargs.pop("cls", None)
429
-
430
- _request = build_delete_request(
431
- resource_group_name=resource_group_name,
432
- account_name=account_name,
433
- management_policy_name=management_policy_name,
434
- subscription_id=self._config.subscription_id,
435
- api_version=api_version,
436
- headers=_headers,
437
- params=_params,
438
- )
439
- _request.url = self._client.format_url(_request.url)
440
-
441
- _stream = False
442
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
443
- _request, stream=_stream, **kwargs
444
- )
445
-
446
- response = pipeline_response.http_response
447
-
448
- if response.status_code not in [200, 204]:
449
- map_error(status_code=response.status_code, response=response, error_map=error_map)
450
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
451
-
452
- if cls:
453
- return cls(pipeline_response, None, {}) # type: ignore