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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. azure/mgmt/storage/_storage_management_client.py +76 -76
  2. azure/mgmt/storage/_version.py +1 -1
  3. azure/mgmt/storage/aio/_storage_management_client.py +76 -76
  4. azure/mgmt/storage/models.py +1 -1
  5. azure/mgmt/storage/v2016_01_01/_version.py +1 -1
  6. azure/mgmt/storage/v2017_10_01/_version.py +1 -1
  7. azure/mgmt/storage/v2019_06_01/_version.py +1 -1
  8. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/_configuration.py +2 -2
  9. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/_storage_management_client.py +49 -49
  10. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/_version.py +1 -1
  11. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/aio/_configuration.py +2 -2
  12. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/aio/_storage_management_client.py +49 -49
  13. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/aio/operations/_blob_containers_operations.py +57 -57
  14. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/aio/operations/_blob_inventory_policies_operations.py +17 -17
  15. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/aio/operations/_blob_services_operations.py +11 -11
  16. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/aio/operations/_deleted_accounts_operations.py +5 -5
  17. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/aio/operations/_encryption_scopes_operations.py +18 -18
  18. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/aio/operations/_file_services_operations.py +173 -12
  19. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/aio/operations/_file_shares_operations.py +27 -27
  20. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/aio/operations/_local_users_operations.py +17 -17
  21. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/aio/operations/_management_policies_operations.py +15 -15
  22. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/aio/operations/_network_security_perimeter_configurations_operations.py +7 -7
  23. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/aio/operations/_object_replication_policies_operations.py +12 -12
  24. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/aio/operations/_operations.py +3 -3
  25. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/aio/operations/_private_endpoint_connections_operations.py +12 -12
  26. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/aio/operations/_private_link_resources_operations.py +3 -3
  27. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/aio/operations/_queue_operations.py +18 -18
  28. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/aio/operations/_queue_services_operations.py +11 -11
  29. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/aio/operations/_skus_operations.py +3 -3
  30. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/aio/operations/_storage_accounts_operations.py +69 -69
  31. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/aio/operations/_storage_task_assignment_instances_report_operations.py +3 -3
  32. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/aio/operations/_storage_task_assignments_instances_report_operations.py +3 -3
  33. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/aio/operations/_storage_task_assignments_operations.py +21 -21
  34. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/aio/operations/_table_operations.py +18 -18
  35. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/aio/operations/_table_services_operations.py +11 -11
  36. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/aio/operations/_usages_operations.py +3 -3
  37. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/models/__init__.py +22 -0
  38. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/models/_models_py3.py +1132 -526
  39. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/models/_storage_management_client_enums.py +6 -0
  40. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/operations/_blob_containers_operations.py +71 -71
  41. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/operations/_blob_inventory_policies_operations.py +21 -21
  42. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/operations/_blob_services_operations.py +14 -14
  43. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/operations/_deleted_accounts_operations.py +7 -7
  44. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/operations/_encryption_scopes_operations.py +22 -22
  45. azure/mgmt/storage/v2024_01_01/operations/_file_services_operations.py +669 -0
  46. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/operations/_file_shares_operations.py +34 -34
  47. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/operations/_local_users_operations.py +23 -23
  48. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/operations/_management_policies_operations.py +18 -18
  49. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/operations/_network_security_perimeter_configurations_operations.py +10 -10
  50. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/operations/_object_replication_policies_operations.py +16 -16
  51. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/operations/_operations.py +4 -4
  52. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/operations/_private_endpoint_connections_operations.py +16 -16
  53. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/operations/_private_link_resources_operations.py +4 -4
  54. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/operations/_queue_operations.py +23 -23
  55. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/operations/_queue_services_operations.py +14 -14
  56. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/operations/_skus_operations.py +4 -4
  57. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/operations/_storage_accounts_operations.py +87 -87
  58. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/operations/_storage_task_assignment_instances_report_operations.py +4 -4
  59. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/operations/_storage_task_assignments_instances_report_operations.py +4 -4
  60. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/operations/_storage_task_assignments_operations.py +26 -26
  61. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/operations/_table_operations.py +23 -23
  62. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/operations/_table_services_operations.py +14 -14
  63. azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/operations/_usages_operations.py +4 -4
  64. {azure_mgmt_storage-22.0.0.dist-info → azure_mgmt_storage-22.1.1.dist-info}/METADATA +37 -1
  65. {azure_mgmt_storage-22.0.0.dist-info → azure_mgmt_storage-22.1.1.dist-info}/RECORD +78 -78
  66. azure/mgmt/storage/v2023_05_01/operations/_file_services_operations.py +0 -431
  67. /azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/__init__.py +0 -0
  68. /azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/_patch.py +0 -0
  69. /azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/aio/__init__.py +0 -0
  70. /azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/aio/_patch.py +0 -0
  71. /azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/aio/operations/__init__.py +0 -0
  72. /azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/aio/operations/_patch.py +0 -0
  73. /azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/models/_patch.py +0 -0
  74. /azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/operations/__init__.py +0 -0
  75. /azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/operations/_patch.py +0 -0
  76. /azure/mgmt/storage/{v2023_05_01 → v2024_01_01}/py.typed +0 -0
  77. {azure_mgmt_storage-22.0.0.dist-info → azure_mgmt_storage-22.1.1.dist-info}/LICENSE +0 -0
  78. {azure_mgmt_storage-22.0.0.dist-info → azure_mgmt_storage-22.1.1.dist-info}/WHEEL +0 -0
  79. {azure_mgmt_storage-22.0.0.dist-info → azure_mgmt_storage-22.1.1.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,669 @@
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, Literal, 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", "2024-01-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}/fileServices",
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(
59
+ "account_name", account_name, "str", max_length=24, min_length=3, pattern=r"^[a-z0-9]+$"
60
+ ),
61
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
62
+ }
63
+
64
+ _url: str = _url.format(**path_format_arguments) # type: ignore
65
+
66
+ # Construct parameters
67
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
68
+
69
+ # Construct headers
70
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
71
+
72
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
73
+
74
+
75
+ def build_set_service_properties_request(
76
+ resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any
77
+ ) -> HttpRequest:
78
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
79
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
80
+
81
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01"))
82
+ file_services_name: Literal["default"] = kwargs.pop("file_services_name", "default")
83
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
84
+ accept = _headers.pop("Accept", "application/json")
85
+
86
+ # Construct URL
87
+ _url = kwargs.pop(
88
+ "template_url",
89
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}",
90
+ ) # pylint: disable=line-too-long
91
+ path_format_arguments = {
92
+ "resourceGroupName": _SERIALIZER.url(
93
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
94
+ ),
95
+ "accountName": _SERIALIZER.url(
96
+ "account_name", account_name, "str", max_length=24, min_length=3, pattern=r"^[a-z0-9]+$"
97
+ ),
98
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
99
+ "FileServicesName": _SERIALIZER.url("file_services_name", file_services_name, "str"),
100
+ }
101
+
102
+ _url: str = _url.format(**path_format_arguments) # type: ignore
103
+
104
+ # Construct parameters
105
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
106
+
107
+ # Construct headers
108
+ if content_type is not None:
109
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
110
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
111
+
112
+ return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs)
113
+
114
+
115
+ def build_get_service_properties_request(
116
+ resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any
117
+ ) -> HttpRequest:
118
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
119
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
120
+
121
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01"))
122
+ file_services_name: Literal["default"] = kwargs.pop("file_services_name", "default")
123
+ accept = _headers.pop("Accept", "application/json")
124
+
125
+ # Construct URL
126
+ _url = kwargs.pop(
127
+ "template_url",
128
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}",
129
+ ) # pylint: disable=line-too-long
130
+ path_format_arguments = {
131
+ "resourceGroupName": _SERIALIZER.url(
132
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
133
+ ),
134
+ "accountName": _SERIALIZER.url(
135
+ "account_name", account_name, "str", max_length=24, min_length=3, pattern=r"^[a-z0-9]+$"
136
+ ),
137
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
138
+ "FileServicesName": _SERIALIZER.url("file_services_name", file_services_name, "str"),
139
+ }
140
+
141
+ _url: str = _url.format(**path_format_arguments) # type: ignore
142
+
143
+ # Construct parameters
144
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
145
+
146
+ # Construct headers
147
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
148
+
149
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
150
+
151
+
152
+ def build_list_service_usages_request(
153
+ resource_group_name: str,
154
+ account_name: str,
155
+ subscription_id: str,
156
+ *,
157
+ maxpagesize: Optional[int] = None,
158
+ **kwargs: Any
159
+ ) -> 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", "2024-01-01"))
164
+ file_services_name: Literal["default"] = kwargs.pop("file_services_name", "default")
165
+ accept = _headers.pop("Accept", "application/json")
166
+
167
+ # Construct URL
168
+ _url = kwargs.pop(
169
+ "template_url",
170
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}/usages",
171
+ ) # pylint: disable=line-too-long
172
+ path_format_arguments = {
173
+ "resourceGroupName": _SERIALIZER.url(
174
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
175
+ ),
176
+ "accountName": _SERIALIZER.url(
177
+ "account_name", account_name, "str", max_length=24, min_length=3, pattern=r"^[a-z0-9]+$"
178
+ ),
179
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
180
+ "FileServicesName": _SERIALIZER.url("file_services_name", file_services_name, "str"),
181
+ }
182
+
183
+ _url: str = _url.format(**path_format_arguments) # type: ignore
184
+
185
+ # Construct parameters
186
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
187
+ if maxpagesize is not None:
188
+ _params["$maxpagesize"] = _SERIALIZER.query("maxpagesize", maxpagesize, "int")
189
+
190
+ # Construct headers
191
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
192
+
193
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
194
+
195
+
196
+ def build_get_service_usage_request(
197
+ resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any
198
+ ) -> HttpRequest:
199
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
200
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
201
+
202
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01"))
203
+ file_services_name: Literal["default"] = kwargs.pop("file_services_name", "default")
204
+ file_service_usages_name: Literal["default"] = kwargs.pop("file_service_usages_name", "default")
205
+ accept = _headers.pop("Accept", "application/json")
206
+
207
+ # Construct URL
208
+ _url = kwargs.pop(
209
+ "template_url",
210
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}/usages/{fileServiceUsagesName}",
211
+ ) # pylint: disable=line-too-long
212
+ path_format_arguments = {
213
+ "resourceGroupName": _SERIALIZER.url(
214
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
215
+ ),
216
+ "accountName": _SERIALIZER.url(
217
+ "account_name", account_name, "str", max_length=24, min_length=3, pattern=r"^[a-z0-9]+$"
218
+ ),
219
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
220
+ "FileServicesName": _SERIALIZER.url("file_services_name", file_services_name, "str"),
221
+ "fileServiceUsagesName": _SERIALIZER.url("file_service_usages_name", file_service_usages_name, "str"),
222
+ }
223
+
224
+ _url: str = _url.format(**path_format_arguments) # type: ignore
225
+
226
+ # Construct parameters
227
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
228
+
229
+ # Construct headers
230
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
231
+
232
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
233
+
234
+
235
+ class FileServicesOperations:
236
+ """
237
+ .. warning::
238
+ **DO NOT** instantiate this class directly.
239
+
240
+ Instead, you should access the following operations through
241
+ :class:`~azure.mgmt.storage.v2024_01_01.StorageManagementClient`'s
242
+ :attr:`file_services` attribute.
243
+ """
244
+
245
+ models = _models
246
+
247
+ def __init__(self, *args, **kwargs):
248
+ input_args = list(args)
249
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
250
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
251
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
252
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
253
+ self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
254
+
255
+ @distributed_trace
256
+ def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> _models.FileServiceItems:
257
+ """List all file services in storage accounts.
258
+
259
+ :param resource_group_name: The name of the resource group within the user's subscription. The
260
+ name is case insensitive. Required.
261
+ :type resource_group_name: str
262
+ :param account_name: The name of the storage account within the specified resource group.
263
+ Storage account names must be between 3 and 24 characters in length and use numbers and
264
+ lower-case letters only. Required.
265
+ :type account_name: str
266
+ :return: FileServiceItems or the result of cls(response)
267
+ :rtype: ~azure.mgmt.storage.v2024_01_01.models.FileServiceItems
268
+ :raises ~azure.core.exceptions.HttpResponseError:
269
+ """
270
+ error_map: MutableMapping = {
271
+ 401: ClientAuthenticationError,
272
+ 404: ResourceNotFoundError,
273
+ 409: ResourceExistsError,
274
+ 304: ResourceNotModifiedError,
275
+ }
276
+ error_map.update(kwargs.pop("error_map", {}) or {})
277
+
278
+ _headers = kwargs.pop("headers", {}) or {}
279
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
280
+
281
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-01-01"))
282
+ cls: ClsType[_models.FileServiceItems] = kwargs.pop("cls", None)
283
+
284
+ _request = build_list_request(
285
+ resource_group_name=resource_group_name,
286
+ account_name=account_name,
287
+ subscription_id=self._config.subscription_id,
288
+ api_version=api_version,
289
+ headers=_headers,
290
+ params=_params,
291
+ )
292
+ _request.url = self._client.format_url(_request.url)
293
+
294
+ _stream = False
295
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
296
+ _request, stream=_stream, **kwargs
297
+ )
298
+
299
+ response = pipeline_response.http_response
300
+
301
+ if response.status_code not in [200]:
302
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
303
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
304
+
305
+ deserialized = self._deserialize("FileServiceItems", pipeline_response.http_response)
306
+
307
+ if cls:
308
+ return cls(pipeline_response, deserialized, {}) # type: ignore
309
+
310
+ return deserialized # type: ignore
311
+
312
+ @overload
313
+ def set_service_properties(
314
+ self,
315
+ resource_group_name: str,
316
+ account_name: str,
317
+ parameters: _models.FileServiceProperties,
318
+ *,
319
+ content_type: str = "application/json",
320
+ **kwargs: Any
321
+ ) -> _models.FileServiceProperties:
322
+ """Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource
323
+ Sharing) rules.
324
+
325
+ :param resource_group_name: The name of the resource group within the user's subscription. The
326
+ name is case insensitive. Required.
327
+ :type resource_group_name: str
328
+ :param account_name: The name of the storage account within the specified resource group.
329
+ Storage account names must be between 3 and 24 characters in length and use numbers and
330
+ lower-case letters only. Required.
331
+ :type account_name: str
332
+ :param parameters: The properties of file services in storage accounts, including CORS
333
+ (Cross-Origin Resource Sharing) rules. Required.
334
+ :type parameters: ~azure.mgmt.storage.v2024_01_01.models.FileServiceProperties
335
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
336
+ Default value is "application/json".
337
+ :paramtype content_type: str
338
+ :return: FileServiceProperties or the result of cls(response)
339
+ :rtype: ~azure.mgmt.storage.v2024_01_01.models.FileServiceProperties
340
+ :raises ~azure.core.exceptions.HttpResponseError:
341
+ """
342
+
343
+ @overload
344
+ def set_service_properties(
345
+ self,
346
+ resource_group_name: str,
347
+ account_name: str,
348
+ parameters: IO[bytes],
349
+ *,
350
+ content_type: str = "application/json",
351
+ **kwargs: Any
352
+ ) -> _models.FileServiceProperties:
353
+ """Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource
354
+ Sharing) rules.
355
+
356
+ :param resource_group_name: The name of the resource group within the user's subscription. The
357
+ name is case insensitive. Required.
358
+ :type resource_group_name: str
359
+ :param account_name: The name of the storage account within the specified resource group.
360
+ Storage account names must be between 3 and 24 characters in length and use numbers and
361
+ lower-case letters only. Required.
362
+ :type account_name: str
363
+ :param parameters: The properties of file services in storage accounts, including CORS
364
+ (Cross-Origin Resource Sharing) rules. Required.
365
+ :type parameters: IO[bytes]
366
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
367
+ Default value is "application/json".
368
+ :paramtype content_type: str
369
+ :return: FileServiceProperties or the result of cls(response)
370
+ :rtype: ~azure.mgmt.storage.v2024_01_01.models.FileServiceProperties
371
+ :raises ~azure.core.exceptions.HttpResponseError:
372
+ """
373
+
374
+ @distributed_trace
375
+ def set_service_properties(
376
+ self,
377
+ resource_group_name: str,
378
+ account_name: str,
379
+ parameters: Union[_models.FileServiceProperties, IO[bytes]],
380
+ **kwargs: Any
381
+ ) -> _models.FileServiceProperties:
382
+ """Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource
383
+ Sharing) rules.
384
+
385
+ :param resource_group_name: The name of the resource group within the user's subscription. The
386
+ name is case insensitive. Required.
387
+ :type resource_group_name: str
388
+ :param account_name: The name of the storage account within the specified resource group.
389
+ Storage account names must be between 3 and 24 characters in length and use numbers and
390
+ lower-case letters only. Required.
391
+ :type account_name: str
392
+ :param parameters: The properties of file services in storage accounts, including CORS
393
+ (Cross-Origin Resource Sharing) rules. Is either a FileServiceProperties type or a IO[bytes]
394
+ type. Required.
395
+ :type parameters: ~azure.mgmt.storage.v2024_01_01.models.FileServiceProperties or IO[bytes]
396
+ :return: FileServiceProperties or the result of cls(response)
397
+ :rtype: ~azure.mgmt.storage.v2024_01_01.models.FileServiceProperties
398
+ :raises ~azure.core.exceptions.HttpResponseError:
399
+ """
400
+ error_map: MutableMapping = {
401
+ 401: ClientAuthenticationError,
402
+ 404: ResourceNotFoundError,
403
+ 409: ResourceExistsError,
404
+ 304: ResourceNotModifiedError,
405
+ }
406
+ error_map.update(kwargs.pop("error_map", {}) or {})
407
+
408
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
409
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
410
+
411
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-01-01"))
412
+ file_services_name: Literal["default"] = kwargs.pop("file_services_name", "default")
413
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
414
+ cls: ClsType[_models.FileServiceProperties] = kwargs.pop("cls", None)
415
+
416
+ content_type = content_type or "application/json"
417
+ _json = None
418
+ _content = None
419
+ if isinstance(parameters, (IOBase, bytes)):
420
+ _content = parameters
421
+ else:
422
+ _json = self._serialize.body(parameters, "FileServiceProperties")
423
+
424
+ _request = build_set_service_properties_request(
425
+ resource_group_name=resource_group_name,
426
+ account_name=account_name,
427
+ subscription_id=self._config.subscription_id,
428
+ api_version=api_version,
429
+ file_services_name=file_services_name,
430
+ content_type=content_type,
431
+ json=_json,
432
+ content=_content,
433
+ headers=_headers,
434
+ params=_params,
435
+ )
436
+ _request.url = self._client.format_url(_request.url)
437
+
438
+ _stream = False
439
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
440
+ _request, stream=_stream, **kwargs
441
+ )
442
+
443
+ response = pipeline_response.http_response
444
+
445
+ if response.status_code not in [200]:
446
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
447
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
448
+
449
+ deserialized = self._deserialize("FileServiceProperties", pipeline_response.http_response)
450
+
451
+ if cls:
452
+ return cls(pipeline_response, deserialized, {}) # type: ignore
453
+
454
+ return deserialized # type: ignore
455
+
456
+ @distributed_trace
457
+ def get_service_properties(
458
+ self, resource_group_name: str, account_name: str, **kwargs: Any
459
+ ) -> _models.FileServiceProperties:
460
+ """Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource
461
+ Sharing) rules.
462
+
463
+ :param resource_group_name: The name of the resource group within the user's subscription. The
464
+ name is case insensitive. Required.
465
+ :type resource_group_name: str
466
+ :param account_name: The name of the storage account within the specified resource group.
467
+ Storage account names must be between 3 and 24 characters in length and use numbers and
468
+ lower-case letters only. Required.
469
+ :type account_name: str
470
+ :return: FileServiceProperties or the result of cls(response)
471
+ :rtype: ~azure.mgmt.storage.v2024_01_01.models.FileServiceProperties
472
+ :raises ~azure.core.exceptions.HttpResponseError:
473
+ """
474
+ error_map: MutableMapping = {
475
+ 401: ClientAuthenticationError,
476
+ 404: ResourceNotFoundError,
477
+ 409: ResourceExistsError,
478
+ 304: ResourceNotModifiedError,
479
+ }
480
+ error_map.update(kwargs.pop("error_map", {}) or {})
481
+
482
+ _headers = kwargs.pop("headers", {}) or {}
483
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
484
+
485
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-01-01"))
486
+ file_services_name: Literal["default"] = kwargs.pop("file_services_name", "default")
487
+ cls: ClsType[_models.FileServiceProperties] = kwargs.pop("cls", None)
488
+
489
+ _request = build_get_service_properties_request(
490
+ resource_group_name=resource_group_name,
491
+ account_name=account_name,
492
+ subscription_id=self._config.subscription_id,
493
+ api_version=api_version,
494
+ file_services_name=file_services_name,
495
+ headers=_headers,
496
+ params=_params,
497
+ )
498
+ _request.url = self._client.format_url(_request.url)
499
+
500
+ _stream = False
501
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
502
+ _request, stream=_stream, **kwargs
503
+ )
504
+
505
+ response = pipeline_response.http_response
506
+
507
+ if response.status_code not in [200]:
508
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
509
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
510
+
511
+ deserialized = self._deserialize("FileServiceProperties", pipeline_response.http_response)
512
+
513
+ if cls:
514
+ return cls(pipeline_response, deserialized, {}) # type: ignore
515
+
516
+ return deserialized # type: ignore
517
+
518
+ @distributed_trace
519
+ def list_service_usages(
520
+ self, resource_group_name: str, account_name: str, maxpagesize: Optional[int] = None, **kwargs: Any
521
+ ) -> Iterable["_models.FileServiceUsage"]:
522
+ """Gets the usages of file service in storage account.
523
+
524
+ :param resource_group_name: The name of the resource group within the user's subscription. The
525
+ name is case insensitive. Required.
526
+ :type resource_group_name: str
527
+ :param account_name: The name of the storage account within the specified resource group.
528
+ Storage account names must be between 3 and 24 characters in length and use numbers and
529
+ lower-case letters only. Required.
530
+ :type account_name: str
531
+ :param maxpagesize: Optional, specifies the maximum number of file service usages to be
532
+ included in the list response. Default value is None.
533
+ :type maxpagesize: int
534
+ :return: An iterator like instance of either FileServiceUsage or the result of cls(response)
535
+ :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2024_01_01.models.FileServiceUsage]
536
+ :raises ~azure.core.exceptions.HttpResponseError:
537
+ """
538
+ _headers = kwargs.pop("headers", {}) or {}
539
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
540
+
541
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-01-01"))
542
+ file_services_name: Literal["default"] = kwargs.pop("file_services_name", "default")
543
+ cls: ClsType[_models.FileServiceUsages] = kwargs.pop("cls", None)
544
+
545
+ error_map: MutableMapping = {
546
+ 401: ClientAuthenticationError,
547
+ 404: ResourceNotFoundError,
548
+ 409: ResourceExistsError,
549
+ 304: ResourceNotModifiedError,
550
+ }
551
+ error_map.update(kwargs.pop("error_map", {}) or {})
552
+
553
+ def prepare_request(next_link=None):
554
+ if not next_link:
555
+
556
+ _request = build_list_service_usages_request(
557
+ resource_group_name=resource_group_name,
558
+ account_name=account_name,
559
+ subscription_id=self._config.subscription_id,
560
+ maxpagesize=maxpagesize,
561
+ api_version=api_version,
562
+ file_services_name=file_services_name,
563
+ headers=_headers,
564
+ params=_params,
565
+ )
566
+ _request.url = self._client.format_url(_request.url)
567
+
568
+ else:
569
+ # make call to next link with the client's api-version
570
+ _parsed_next_link = urllib.parse.urlparse(next_link)
571
+ _next_request_params = case_insensitive_dict(
572
+ {
573
+ key: [urllib.parse.quote(v) for v in value]
574
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
575
+ }
576
+ )
577
+ _next_request_params["api-version"] = self._api_version
578
+ _request = HttpRequest(
579
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
580
+ )
581
+ _request.url = self._client.format_url(_request.url)
582
+ _request.method = "GET"
583
+ return _request
584
+
585
+ def extract_data(pipeline_response):
586
+ deserialized = self._deserialize("FileServiceUsages", pipeline_response)
587
+ list_of_elem = deserialized.value
588
+ if cls:
589
+ list_of_elem = cls(list_of_elem) # type: ignore
590
+ return deserialized.next_link or None, iter(list_of_elem)
591
+
592
+ def get_next(next_link=None):
593
+ _request = prepare_request(next_link)
594
+
595
+ _stream = False
596
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
597
+ _request, stream=_stream, **kwargs
598
+ )
599
+ response = pipeline_response.http_response
600
+
601
+ if response.status_code not in [200]:
602
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
603
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
604
+
605
+ return pipeline_response
606
+
607
+ return ItemPaged(get_next, extract_data)
608
+
609
+ @distributed_trace
610
+ def get_service_usage(self, resource_group_name: str, account_name: str, **kwargs: Any) -> _models.FileServiceUsage:
611
+ """Gets the usage of file service in storage account including account limits, file share limits
612
+ and constants used in recommendations and bursting formula.
613
+
614
+ :param resource_group_name: The name of the resource group within the user's subscription. The
615
+ name is case insensitive. Required.
616
+ :type resource_group_name: str
617
+ :param account_name: The name of the storage account within the specified resource group.
618
+ Storage account names must be between 3 and 24 characters in length and use numbers and
619
+ lower-case letters only. Required.
620
+ :type account_name: str
621
+ :return: FileServiceUsage or the result of cls(response)
622
+ :rtype: ~azure.mgmt.storage.v2024_01_01.models.FileServiceUsage
623
+ :raises ~azure.core.exceptions.HttpResponseError:
624
+ """
625
+ error_map: MutableMapping = {
626
+ 401: ClientAuthenticationError,
627
+ 404: ResourceNotFoundError,
628
+ 409: ResourceExistsError,
629
+ 304: ResourceNotModifiedError,
630
+ }
631
+ error_map.update(kwargs.pop("error_map", {}) or {})
632
+
633
+ _headers = kwargs.pop("headers", {}) or {}
634
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
635
+
636
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-01-01"))
637
+ file_services_name: Literal["default"] = kwargs.pop("file_services_name", "default")
638
+ file_service_usages_name: Literal["default"] = kwargs.pop("file_service_usages_name", "default")
639
+ cls: ClsType[_models.FileServiceUsage] = kwargs.pop("cls", None)
640
+
641
+ _request = build_get_service_usage_request(
642
+ resource_group_name=resource_group_name,
643
+ account_name=account_name,
644
+ subscription_id=self._config.subscription_id,
645
+ api_version=api_version,
646
+ file_services_name=file_services_name,
647
+ file_service_usages_name=file_service_usages_name,
648
+ headers=_headers,
649
+ params=_params,
650
+ )
651
+ _request.url = self._client.format_url(_request.url)
652
+
653
+ _stream = False
654
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
655
+ _request, stream=_stream, **kwargs
656
+ )
657
+
658
+ response = pipeline_response.http_response
659
+
660
+ if response.status_code not in [200]:
661
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
662
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
663
+
664
+ deserialized = self._deserialize("FileServiceUsage", pipeline_response.http_response)
665
+
666
+ if cls:
667
+ return cls(pipeline_response, deserialized, {}) # type: ignore
668
+
669
+ return deserialized # type: ignore