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