azure-mgmt-storage 22.0.0__py3-none-any.whl → 22.1.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 (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.0.dist-info}/METADATA +31 -1
  65. {azure_mgmt_storage-22.0.0.dist-info → azure_mgmt_storage-22.1.0.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.0.dist-info}/LICENSE +0 -0
  78. {azure_mgmt_storage-22.0.0.dist-info → azure_mgmt_storage-22.1.0.dist-info}/WHEEL +0 -0
  79. {azure_mgmt_storage-22.0.0.dist-info → azure_mgmt_storage-22.1.0.dist-info}/top_level.txt +0 -0
@@ -1,431 +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, Literal, 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_list_request(resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest:
41
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
42
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
43
-
44
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01"))
45
- accept = _headers.pop("Accept", "application/json")
46
-
47
- # Construct URL
48
- _url = kwargs.pop(
49
- "template_url",
50
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices",
51
- ) # pylint: disable=line-too-long
52
- path_format_arguments = {
53
- "resourceGroupName": _SERIALIZER.url(
54
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
55
- ),
56
- "accountName": _SERIALIZER.url(
57
- "account_name", account_name, "str", max_length=24, min_length=3, pattern=r"^[a-z0-9]+$"
58
- ),
59
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
60
- }
61
-
62
- _url: str = _url.format(**path_format_arguments) # type: ignore
63
-
64
- # Construct parameters
65
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
66
-
67
- # Construct headers
68
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
69
-
70
- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
71
-
72
-
73
- def build_set_service_properties_request(
74
- resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any
75
- ) -> HttpRequest:
76
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
77
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
78
-
79
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01"))
80
- file_services_name: Literal["default"] = kwargs.pop("file_services_name", "default")
81
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
82
- accept = _headers.pop("Accept", "application/json")
83
-
84
- # Construct URL
85
- _url = kwargs.pop(
86
- "template_url",
87
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}",
88
- ) # pylint: disable=line-too-long
89
- path_format_arguments = {
90
- "resourceGroupName": _SERIALIZER.url(
91
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
92
- ),
93
- "accountName": _SERIALIZER.url(
94
- "account_name", account_name, "str", max_length=24, min_length=3, pattern=r"^[a-z0-9]+$"
95
- ),
96
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
97
- "FileServicesName": _SERIALIZER.url("file_services_name", file_services_name, "str"),
98
- }
99
-
100
- _url: str = _url.format(**path_format_arguments) # type: ignore
101
-
102
- # Construct parameters
103
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
104
-
105
- # Construct headers
106
- if content_type is not None:
107
- _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
108
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
109
-
110
- return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs)
111
-
112
-
113
- def build_get_service_properties_request(
114
- resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any
115
- ) -> HttpRequest:
116
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
117
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
118
-
119
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01"))
120
- file_services_name: Literal["default"] = kwargs.pop("file_services_name", "default")
121
- accept = _headers.pop("Accept", "application/json")
122
-
123
- # Construct URL
124
- _url = kwargs.pop(
125
- "template_url",
126
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}",
127
- ) # pylint: disable=line-too-long
128
- path_format_arguments = {
129
- "resourceGroupName": _SERIALIZER.url(
130
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
131
- ),
132
- "accountName": _SERIALIZER.url(
133
- "account_name", account_name, "str", max_length=24, min_length=3, pattern=r"^[a-z0-9]+$"
134
- ),
135
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
136
- "FileServicesName": _SERIALIZER.url("file_services_name", file_services_name, "str"),
137
- }
138
-
139
- _url: str = _url.format(**path_format_arguments) # type: ignore
140
-
141
- # Construct parameters
142
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
143
-
144
- # Construct headers
145
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
146
-
147
- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
148
-
149
-
150
- class FileServicesOperations:
151
- """
152
- .. warning::
153
- **DO NOT** instantiate this class directly.
154
-
155
- Instead, you should access the following operations through
156
- :class:`~azure.mgmt.storage.v2023_05_01.StorageManagementClient`'s
157
- :attr:`file_services` attribute.
158
- """
159
-
160
- models = _models
161
-
162
- def __init__(self, *args, **kwargs):
163
- input_args = list(args)
164
- self._client = input_args.pop(0) if input_args else kwargs.pop("client")
165
- self._config = input_args.pop(0) if input_args else kwargs.pop("config")
166
- self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
167
- self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
168
- self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
169
-
170
- @distributed_trace
171
- def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> _models.FileServiceItems:
172
- """List all file services in storage accounts.
173
-
174
- :param resource_group_name: The name of the resource group within the user's subscription. The
175
- name is case insensitive. Required.
176
- :type resource_group_name: str
177
- :param account_name: The name of the storage account within the specified resource group.
178
- Storage account names must be between 3 and 24 characters in length and use numbers and
179
- lower-case letters only. Required.
180
- :type account_name: str
181
- :return: FileServiceItems or the result of cls(response)
182
- :rtype: ~azure.mgmt.storage.v2023_05_01.models.FileServiceItems
183
- :raises ~azure.core.exceptions.HttpResponseError:
184
- """
185
- error_map: MutableMapping = {
186
- 401: ClientAuthenticationError,
187
- 404: ResourceNotFoundError,
188
- 409: ResourceExistsError,
189
- 304: ResourceNotModifiedError,
190
- }
191
- error_map.update(kwargs.pop("error_map", {}) or {})
192
-
193
- _headers = kwargs.pop("headers", {}) or {}
194
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
195
-
196
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-05-01"))
197
- cls: ClsType[_models.FileServiceItems] = kwargs.pop("cls", None)
198
-
199
- _request = build_list_request(
200
- resource_group_name=resource_group_name,
201
- account_name=account_name,
202
- subscription_id=self._config.subscription_id,
203
- api_version=api_version,
204
- headers=_headers,
205
- params=_params,
206
- )
207
- _request.url = self._client.format_url(_request.url)
208
-
209
- _stream = False
210
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
211
- _request, stream=_stream, **kwargs
212
- )
213
-
214
- response = pipeline_response.http_response
215
-
216
- if response.status_code not in [200]:
217
- map_error(status_code=response.status_code, response=response, error_map=error_map)
218
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
219
-
220
- deserialized = self._deserialize("FileServiceItems", pipeline_response.http_response)
221
-
222
- if cls:
223
- return cls(pipeline_response, deserialized, {}) # type: ignore
224
-
225
- return deserialized # type: ignore
226
-
227
- @overload
228
- def set_service_properties(
229
- self,
230
- resource_group_name: str,
231
- account_name: str,
232
- parameters: _models.FileServiceProperties,
233
- *,
234
- content_type: str = "application/json",
235
- **kwargs: Any
236
- ) -> _models.FileServiceProperties:
237
- """Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource
238
- Sharing) rules.
239
-
240
- :param resource_group_name: The name of the resource group within the user's subscription. The
241
- name is case insensitive. Required.
242
- :type resource_group_name: str
243
- :param account_name: The name of the storage account within the specified resource group.
244
- Storage account names must be between 3 and 24 characters in length and use numbers and
245
- lower-case letters only. Required.
246
- :type account_name: str
247
- :param parameters: The properties of file services in storage accounts, including CORS
248
- (Cross-Origin Resource Sharing) rules. Required.
249
- :type parameters: ~azure.mgmt.storage.v2023_05_01.models.FileServiceProperties
250
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
251
- Default value is "application/json".
252
- :paramtype content_type: str
253
- :return: FileServiceProperties or the result of cls(response)
254
- :rtype: ~azure.mgmt.storage.v2023_05_01.models.FileServiceProperties
255
- :raises ~azure.core.exceptions.HttpResponseError:
256
- """
257
-
258
- @overload
259
- def set_service_properties(
260
- self,
261
- resource_group_name: str,
262
- account_name: str,
263
- parameters: IO[bytes],
264
- *,
265
- content_type: str = "application/json",
266
- **kwargs: Any
267
- ) -> _models.FileServiceProperties:
268
- """Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource
269
- Sharing) rules.
270
-
271
- :param resource_group_name: The name of the resource group within the user's subscription. The
272
- name is case insensitive. Required.
273
- :type resource_group_name: str
274
- :param account_name: The name of the storage account within the specified resource group.
275
- Storage account names must be between 3 and 24 characters in length and use numbers and
276
- lower-case letters only. Required.
277
- :type account_name: str
278
- :param parameters: The properties of file services in storage accounts, including CORS
279
- (Cross-Origin Resource Sharing) rules. Required.
280
- :type parameters: IO[bytes]
281
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
282
- Default value is "application/json".
283
- :paramtype content_type: str
284
- :return: FileServiceProperties or the result of cls(response)
285
- :rtype: ~azure.mgmt.storage.v2023_05_01.models.FileServiceProperties
286
- :raises ~azure.core.exceptions.HttpResponseError:
287
- """
288
-
289
- @distributed_trace
290
- def set_service_properties(
291
- self,
292
- resource_group_name: str,
293
- account_name: str,
294
- parameters: Union[_models.FileServiceProperties, IO[bytes]],
295
- **kwargs: Any
296
- ) -> _models.FileServiceProperties:
297
- """Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource
298
- Sharing) rules.
299
-
300
- :param resource_group_name: The name of the resource group within the user's subscription. The
301
- name is case insensitive. Required.
302
- :type resource_group_name: str
303
- :param account_name: The name of the storage account within the specified resource group.
304
- Storage account names must be between 3 and 24 characters in length and use numbers and
305
- lower-case letters only. Required.
306
- :type account_name: str
307
- :param parameters: The properties of file services in storage accounts, including CORS
308
- (Cross-Origin Resource Sharing) rules. Is either a FileServiceProperties type or a IO[bytes]
309
- type. Required.
310
- :type parameters: ~azure.mgmt.storage.v2023_05_01.models.FileServiceProperties or IO[bytes]
311
- :return: FileServiceProperties or the result of cls(response)
312
- :rtype: ~azure.mgmt.storage.v2023_05_01.models.FileServiceProperties
313
- :raises ~azure.core.exceptions.HttpResponseError:
314
- """
315
- error_map: MutableMapping = {
316
- 401: ClientAuthenticationError,
317
- 404: ResourceNotFoundError,
318
- 409: ResourceExistsError,
319
- 304: ResourceNotModifiedError,
320
- }
321
- error_map.update(kwargs.pop("error_map", {}) or {})
322
-
323
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
324
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
325
-
326
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-05-01"))
327
- file_services_name: Literal["default"] = kwargs.pop("file_services_name", "default")
328
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
329
- cls: ClsType[_models.FileServiceProperties] = kwargs.pop("cls", None)
330
-
331
- content_type = content_type or "application/json"
332
- _json = None
333
- _content = None
334
- if isinstance(parameters, (IOBase, bytes)):
335
- _content = parameters
336
- else:
337
- _json = self._serialize.body(parameters, "FileServiceProperties")
338
-
339
- _request = build_set_service_properties_request(
340
- resource_group_name=resource_group_name,
341
- account_name=account_name,
342
- subscription_id=self._config.subscription_id,
343
- api_version=api_version,
344
- file_services_name=file_services_name,
345
- content_type=content_type,
346
- json=_json,
347
- content=_content,
348
- headers=_headers,
349
- params=_params,
350
- )
351
- _request.url = self._client.format_url(_request.url)
352
-
353
- _stream = False
354
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
355
- _request, stream=_stream, **kwargs
356
- )
357
-
358
- response = pipeline_response.http_response
359
-
360
- if response.status_code not in [200]:
361
- map_error(status_code=response.status_code, response=response, error_map=error_map)
362
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
363
-
364
- deserialized = self._deserialize("FileServiceProperties", pipeline_response.http_response)
365
-
366
- if cls:
367
- return cls(pipeline_response, deserialized, {}) # type: ignore
368
-
369
- return deserialized # type: ignore
370
-
371
- @distributed_trace
372
- def get_service_properties(
373
- self, resource_group_name: str, account_name: str, **kwargs: Any
374
- ) -> _models.FileServiceProperties:
375
- """Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource
376
- Sharing) rules.
377
-
378
- :param resource_group_name: The name of the resource group within the user's subscription. The
379
- name is case insensitive. Required.
380
- :type resource_group_name: str
381
- :param account_name: The name of the storage account within the specified resource group.
382
- Storage account names must be between 3 and 24 characters in length and use numbers and
383
- lower-case letters only. Required.
384
- :type account_name: str
385
- :return: FileServiceProperties or the result of cls(response)
386
- :rtype: ~azure.mgmt.storage.v2023_05_01.models.FileServiceProperties
387
- :raises ~azure.core.exceptions.HttpResponseError:
388
- """
389
- error_map: MutableMapping = {
390
- 401: ClientAuthenticationError,
391
- 404: ResourceNotFoundError,
392
- 409: ResourceExistsError,
393
- 304: ResourceNotModifiedError,
394
- }
395
- error_map.update(kwargs.pop("error_map", {}) or {})
396
-
397
- _headers = kwargs.pop("headers", {}) or {}
398
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
399
-
400
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-05-01"))
401
- file_services_name: Literal["default"] = kwargs.pop("file_services_name", "default")
402
- cls: ClsType[_models.FileServiceProperties] = kwargs.pop("cls", None)
403
-
404
- _request = build_get_service_properties_request(
405
- resource_group_name=resource_group_name,
406
- account_name=account_name,
407
- subscription_id=self._config.subscription_id,
408
- api_version=api_version,
409
- file_services_name=file_services_name,
410
- headers=_headers,
411
- params=_params,
412
- )
413
- _request.url = self._client.format_url(_request.url)
414
-
415
- _stream = False
416
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
417
- _request, stream=_stream, **kwargs
418
- )
419
-
420
- response = pipeline_response.http_response
421
-
422
- if response.status_code not in [200]:
423
- map_error(status_code=response.status_code, response=response, error_map=error_map)
424
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
425
-
426
- deserialized = self._deserialize("FileServiceProperties", pipeline_response.http_response)
427
-
428
- if cls:
429
- return cls(pipeline_response, deserialized, {}) # type: ignore
430
-
431
- return deserialized # type: ignore