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,1000 +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, 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(
43
- resource_group_name: str,
44
- account_name: str,
45
- subscription_id: str,
46
- *,
47
- maxpagesize: Optional[str] = None,
48
- filter: Optional[str] = None,
49
- expand: Literal["deleted"] = "deleted",
50
- **kwargs: Any
51
- ) -> HttpRequest:
52
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
53
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
54
-
55
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01"))
56
- accept = _headers.pop("Accept", "application/json")
57
-
58
- # Construct URL
59
- _url = kwargs.pop(
60
- "template_url",
61
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares",
62
- ) # pylint: disable=line-too-long
63
- path_format_arguments = {
64
- "resourceGroupName": _SERIALIZER.url(
65
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
66
- ),
67
- "accountName": _SERIALIZER.url("account_name", account_name, "str", max_length=24, min_length=3),
68
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
69
- }
70
-
71
- _url: str = _url.format(**path_format_arguments) # type: ignore
72
-
73
- # Construct parameters
74
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
75
- if maxpagesize is not None:
76
- _params["$maxpagesize"] = _SERIALIZER.query("maxpagesize", maxpagesize, "str")
77
- if filter is not None:
78
- _params["$filter"] = _SERIALIZER.query("filter", filter, "str")
79
- if expand is not None:
80
- _params["$expand"] = _SERIALIZER.query("expand", expand, "str")
81
-
82
- # Construct headers
83
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
84
-
85
- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
86
-
87
-
88
- def build_create_request(
89
- resource_group_name: str, account_name: str, share_name: str, subscription_id: str, **kwargs: Any
90
- ) -> HttpRequest:
91
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
92
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
93
-
94
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01"))
95
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
96
- accept = _headers.pop("Accept", "application/json")
97
-
98
- # Construct URL
99
- _url = kwargs.pop(
100
- "template_url",
101
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}",
102
- ) # pylint: disable=line-too-long
103
- path_format_arguments = {
104
- "resourceGroupName": _SERIALIZER.url(
105
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
106
- ),
107
- "accountName": _SERIALIZER.url("account_name", account_name, "str", max_length=24, min_length=3),
108
- "shareName": _SERIALIZER.url("share_name", share_name, "str", max_length=63, min_length=3),
109
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
110
- }
111
-
112
- _url: str = _url.format(**path_format_arguments) # type: ignore
113
-
114
- # Construct parameters
115
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
116
-
117
- # Construct headers
118
- if content_type is not None:
119
- _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
120
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
121
-
122
- return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs)
123
-
124
-
125
- def build_update_request(
126
- resource_group_name: str, account_name: str, share_name: str, subscription_id: str, **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
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
133
- accept = _headers.pop("Accept", "application/json")
134
-
135
- # Construct URL
136
- _url = kwargs.pop(
137
- "template_url",
138
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}",
139
- ) # pylint: disable=line-too-long
140
- path_format_arguments = {
141
- "resourceGroupName": _SERIALIZER.url(
142
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
143
- ),
144
- "accountName": _SERIALIZER.url("account_name", account_name, "str", max_length=24, min_length=3),
145
- "shareName": _SERIALIZER.url("share_name", share_name, "str", max_length=63, min_length=3),
146
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
147
- }
148
-
149
- _url: str = _url.format(**path_format_arguments) # type: ignore
150
-
151
- # Construct parameters
152
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
153
-
154
- # Construct headers
155
- if content_type is not None:
156
- _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
157
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
158
-
159
- return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs)
160
-
161
-
162
- def build_get_request(
163
- resource_group_name: str,
164
- account_name: str,
165
- share_name: str,
166
- subscription_id: str,
167
- *,
168
- expand: Literal["stats"] = "stats",
169
- **kwargs: Any
170
- ) -> HttpRequest:
171
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
172
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
173
-
174
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01"))
175
- accept = _headers.pop("Accept", "application/json")
176
-
177
- # Construct URL
178
- _url = kwargs.pop(
179
- "template_url",
180
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}",
181
- ) # pylint: disable=line-too-long
182
- path_format_arguments = {
183
- "resourceGroupName": _SERIALIZER.url(
184
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
185
- ),
186
- "accountName": _SERIALIZER.url("account_name", account_name, "str", max_length=24, min_length=3),
187
- "shareName": _SERIALIZER.url("share_name", share_name, "str", max_length=63, min_length=3),
188
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
189
- }
190
-
191
- _url: str = _url.format(**path_format_arguments) # type: ignore
192
-
193
- # Construct parameters
194
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
195
- if expand is not None:
196
- _params["$expand"] = _SERIALIZER.query("expand", expand, "str")
197
-
198
- # Construct headers
199
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
200
-
201
- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
202
-
203
-
204
- def build_delete_request(
205
- resource_group_name: str, account_name: str, share_name: str, subscription_id: str, **kwargs: Any
206
- ) -> HttpRequest:
207
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
208
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
209
-
210
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01"))
211
- accept = _headers.pop("Accept", "application/json")
212
-
213
- # Construct URL
214
- _url = kwargs.pop(
215
- "template_url",
216
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}",
217
- ) # pylint: disable=line-too-long
218
- path_format_arguments = {
219
- "resourceGroupName": _SERIALIZER.url(
220
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
221
- ),
222
- "accountName": _SERIALIZER.url("account_name", account_name, "str", max_length=24, min_length=3),
223
- "shareName": _SERIALIZER.url("share_name", share_name, "str", max_length=63, min_length=3),
224
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
225
- }
226
-
227
- _url: str = _url.format(**path_format_arguments) # type: ignore
228
-
229
- # Construct parameters
230
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
231
-
232
- # Construct headers
233
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
234
-
235
- return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs)
236
-
237
-
238
- def build_restore_request(
239
- resource_group_name: str, account_name: str, share_name: str, subscription_id: str, **kwargs: Any
240
- ) -> HttpRequest:
241
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
242
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
243
-
244
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01"))
245
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
246
- accept = _headers.pop("Accept", "application/json")
247
-
248
- # Construct URL
249
- _url = kwargs.pop(
250
- "template_url",
251
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}/restore",
252
- ) # pylint: disable=line-too-long
253
- path_format_arguments = {
254
- "resourceGroupName": _SERIALIZER.url(
255
- "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
256
- ),
257
- "accountName": _SERIALIZER.url("account_name", account_name, "str", max_length=24, min_length=3),
258
- "shareName": _SERIALIZER.url("share_name", share_name, "str", max_length=63, min_length=3),
259
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
260
- }
261
-
262
- _url: str = _url.format(**path_format_arguments) # type: ignore
263
-
264
- # Construct parameters
265
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
266
-
267
- # Construct headers
268
- if content_type is not None:
269
- _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
270
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
271
-
272
- return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
273
-
274
-
275
- class FileSharesOperations:
276
- """
277
- .. warning::
278
- **DO NOT** instantiate this class directly.
279
-
280
- Instead, you should access the following operations through
281
- :class:`~azure.mgmt.storage.v2019_06_01.StorageManagementClient`'s
282
- :attr:`file_shares` attribute.
283
- """
284
-
285
- models = _models
286
-
287
- def __init__(self, *args, **kwargs):
288
- input_args = list(args)
289
- self._client = input_args.pop(0) if input_args else kwargs.pop("client")
290
- self._config = input_args.pop(0) if input_args else kwargs.pop("config")
291
- self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
292
- self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
293
- self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
294
-
295
- @distributed_trace
296
- def list(
297
- self,
298
- resource_group_name: str,
299
- account_name: str,
300
- maxpagesize: Optional[str] = None,
301
- filter: Optional[str] = None,
302
- expand: Literal["deleted"] = "deleted",
303
- **kwargs: Any
304
- ) -> Iterable["_models.FileShareItem"]:
305
- """Lists all shares.
306
-
307
- :param resource_group_name: The name of the resource group within the user's subscription. The
308
- name is case insensitive. Required.
309
- :type resource_group_name: str
310
- :param account_name: The name of the storage account within the specified resource group.
311
- Storage account names must be between 3 and 24 characters in length and use numbers and
312
- lower-case letters only. Required.
313
- :type account_name: str
314
- :param maxpagesize: Optional. Specified maximum number of shares that can be included in the
315
- list. Default value is None.
316
- :type maxpagesize: str
317
- :param filter: Optional. When specified, only share names starting with the filter will be
318
- listed. Default value is None.
319
- :type filter: str
320
- :param expand: Optional, used to expand the properties within share's properties. Known values
321
- are "deleted" and None. Default value is "deleted".
322
- :type expand: str
323
- :return: An iterator like instance of either FileShareItem or the result of cls(response)
324
- :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2019_06_01.models.FileShareItem]
325
- :raises ~azure.core.exceptions.HttpResponseError:
326
- """
327
- _headers = kwargs.pop("headers", {}) or {}
328
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
329
-
330
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
331
- cls: ClsType[_models.FileShareItems] = kwargs.pop("cls", None)
332
-
333
- error_map: MutableMapping = {
334
- 401: ClientAuthenticationError,
335
- 404: ResourceNotFoundError,
336
- 409: ResourceExistsError,
337
- 304: ResourceNotModifiedError,
338
- }
339
- error_map.update(kwargs.pop("error_map", {}) or {})
340
-
341
- def prepare_request(next_link=None):
342
- if not next_link:
343
-
344
- _request = build_list_request(
345
- resource_group_name=resource_group_name,
346
- account_name=account_name,
347
- subscription_id=self._config.subscription_id,
348
- maxpagesize=maxpagesize,
349
- filter=filter,
350
- expand=expand,
351
- api_version=api_version,
352
- headers=_headers,
353
- params=_params,
354
- )
355
- _request.url = self._client.format_url(_request.url)
356
-
357
- else:
358
- # make call to next link with the client's api-version
359
- _parsed_next_link = urllib.parse.urlparse(next_link)
360
- _next_request_params = case_insensitive_dict(
361
- {
362
- key: [urllib.parse.quote(v) for v in value]
363
- for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
364
- }
365
- )
366
- _next_request_params["api-version"] = self._api_version
367
- _request = HttpRequest(
368
- "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
369
- )
370
- _request.url = self._client.format_url(_request.url)
371
- _request.method = "GET"
372
- return _request
373
-
374
- def extract_data(pipeline_response):
375
- deserialized = self._deserialize("FileShareItems", pipeline_response)
376
- list_of_elem = deserialized.value
377
- if cls:
378
- list_of_elem = cls(list_of_elem) # type: ignore
379
- return deserialized.next_link or None, iter(list_of_elem)
380
-
381
- def get_next(next_link=None):
382
- _request = prepare_request(next_link)
383
-
384
- _stream = False
385
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
386
- _request, stream=_stream, **kwargs
387
- )
388
- response = pipeline_response.http_response
389
-
390
- if response.status_code not in [200]:
391
- map_error(status_code=response.status_code, response=response, error_map=error_map)
392
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
393
-
394
- return pipeline_response
395
-
396
- return ItemPaged(get_next, extract_data)
397
-
398
- @overload
399
- def create(
400
- self,
401
- resource_group_name: str,
402
- account_name: str,
403
- share_name: str,
404
- file_share: _models.FileShare,
405
- *,
406
- content_type: str = "application/json",
407
- **kwargs: Any
408
- ) -> _models.FileShare:
409
- """Creates a new share under the specified account as described by request body. The share
410
- resource includes metadata and properties for that share. It does not include a list of the
411
- files contained by the share.
412
-
413
- :param resource_group_name: The name of the resource group within the user's subscription. The
414
- name is case insensitive. Required.
415
- :type resource_group_name: str
416
- :param account_name: The name of the storage account within the specified resource group.
417
- Storage account names must be between 3 and 24 characters in length and use numbers and
418
- lower-case letters only. Required.
419
- :type account_name: str
420
- :param share_name: The name of the file share within the specified storage account. File share
421
- names must be between 3 and 63 characters in length and use numbers, lower-case letters and
422
- dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter
423
- or number. Required.
424
- :type share_name: str
425
- :param file_share: Properties of the file share to create. Required.
426
- :type file_share: ~azure.mgmt.storage.v2019_06_01.models.FileShare
427
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
428
- Default value is "application/json".
429
- :paramtype content_type: str
430
- :return: FileShare or the result of cls(response)
431
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.FileShare
432
- :raises ~azure.core.exceptions.HttpResponseError:
433
- """
434
-
435
- @overload
436
- def create(
437
- self,
438
- resource_group_name: str,
439
- account_name: str,
440
- share_name: str,
441
- file_share: IO[bytes],
442
- *,
443
- content_type: str = "application/json",
444
- **kwargs: Any
445
- ) -> _models.FileShare:
446
- """Creates a new share under the specified account as described by request body. The share
447
- resource includes metadata and properties for that share. It does not include a list of the
448
- files contained by the share.
449
-
450
- :param resource_group_name: The name of the resource group within the user's subscription. The
451
- name is case insensitive. Required.
452
- :type resource_group_name: str
453
- :param account_name: The name of the storage account within the specified resource group.
454
- Storage account names must be between 3 and 24 characters in length and use numbers and
455
- lower-case letters only. Required.
456
- :type account_name: str
457
- :param share_name: The name of the file share within the specified storage account. File share
458
- names must be between 3 and 63 characters in length and use numbers, lower-case letters and
459
- dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter
460
- or number. Required.
461
- :type share_name: str
462
- :param file_share: Properties of the file share to create. Required.
463
- :type file_share: IO[bytes]
464
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
465
- Default value is "application/json".
466
- :paramtype content_type: str
467
- :return: FileShare or the result of cls(response)
468
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.FileShare
469
- :raises ~azure.core.exceptions.HttpResponseError:
470
- """
471
-
472
- @distributed_trace
473
- def create(
474
- self,
475
- resource_group_name: str,
476
- account_name: str,
477
- share_name: str,
478
- file_share: Union[_models.FileShare, IO[bytes]],
479
- **kwargs: Any
480
- ) -> _models.FileShare:
481
- """Creates a new share under the specified account as described by request body. The share
482
- resource includes metadata and properties for that share. It does not include a list of the
483
- files contained by the share.
484
-
485
- :param resource_group_name: The name of the resource group within the user's subscription. The
486
- name is case insensitive. Required.
487
- :type resource_group_name: str
488
- :param account_name: The name of the storage account within the specified resource group.
489
- Storage account names must be between 3 and 24 characters in length and use numbers and
490
- lower-case letters only. Required.
491
- :type account_name: str
492
- :param share_name: The name of the file share within the specified storage account. File share
493
- names must be between 3 and 63 characters in length and use numbers, lower-case letters and
494
- dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter
495
- or number. Required.
496
- :type share_name: str
497
- :param file_share: Properties of the file share to create. Is either a FileShare type or a
498
- IO[bytes] type. Required.
499
- :type file_share: ~azure.mgmt.storage.v2019_06_01.models.FileShare or IO[bytes]
500
- :return: FileShare or the result of cls(response)
501
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.FileShare
502
- :raises ~azure.core.exceptions.HttpResponseError:
503
- """
504
- error_map: MutableMapping = {
505
- 401: ClientAuthenticationError,
506
- 404: ResourceNotFoundError,
507
- 409: ResourceExistsError,
508
- 304: ResourceNotModifiedError,
509
- }
510
- error_map.update(kwargs.pop("error_map", {}) or {})
511
-
512
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
513
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
514
-
515
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
516
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
517
- cls: ClsType[_models.FileShare] = kwargs.pop("cls", None)
518
-
519
- content_type = content_type or "application/json"
520
- _json = None
521
- _content = None
522
- if isinstance(file_share, (IOBase, bytes)):
523
- _content = file_share
524
- else:
525
- _json = self._serialize.body(file_share, "FileShare")
526
-
527
- _request = build_create_request(
528
- resource_group_name=resource_group_name,
529
- account_name=account_name,
530
- share_name=share_name,
531
- subscription_id=self._config.subscription_id,
532
- api_version=api_version,
533
- content_type=content_type,
534
- json=_json,
535
- content=_content,
536
- headers=_headers,
537
- params=_params,
538
- )
539
- _request.url = self._client.format_url(_request.url)
540
-
541
- _stream = False
542
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
543
- _request, stream=_stream, **kwargs
544
- )
545
-
546
- response = pipeline_response.http_response
547
-
548
- if response.status_code not in [200, 201]:
549
- map_error(status_code=response.status_code, response=response, error_map=error_map)
550
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
551
-
552
- deserialized = self._deserialize("FileShare", pipeline_response.http_response)
553
-
554
- if cls:
555
- return cls(pipeline_response, deserialized, {}) # type: ignore
556
-
557
- return deserialized # type: ignore
558
-
559
- @overload
560
- def update(
561
- self,
562
- resource_group_name: str,
563
- account_name: str,
564
- share_name: str,
565
- file_share: _models.FileShare,
566
- *,
567
- content_type: str = "application/json",
568
- **kwargs: Any
569
- ) -> _models.FileShare:
570
- """Updates share properties as specified in request body. Properties not mentioned in the request
571
- will not be changed. Update fails if the specified share does not already exist.
572
-
573
- :param resource_group_name: The name of the resource group within the user's subscription. The
574
- name is case insensitive. Required.
575
- :type resource_group_name: str
576
- :param account_name: The name of the storage account within the specified resource group.
577
- Storage account names must be between 3 and 24 characters in length and use numbers and
578
- lower-case letters only. Required.
579
- :type account_name: str
580
- :param share_name: The name of the file share within the specified storage account. File share
581
- names must be between 3 and 63 characters in length and use numbers, lower-case letters and
582
- dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter
583
- or number. Required.
584
- :type share_name: str
585
- :param file_share: Properties to update for the file share. Required.
586
- :type file_share: ~azure.mgmt.storage.v2019_06_01.models.FileShare
587
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
588
- Default value is "application/json".
589
- :paramtype content_type: str
590
- :return: FileShare or the result of cls(response)
591
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.FileShare
592
- :raises ~azure.core.exceptions.HttpResponseError:
593
- """
594
-
595
- @overload
596
- def update(
597
- self,
598
- resource_group_name: str,
599
- account_name: str,
600
- share_name: str,
601
- file_share: IO[bytes],
602
- *,
603
- content_type: str = "application/json",
604
- **kwargs: Any
605
- ) -> _models.FileShare:
606
- """Updates share properties as specified in request body. Properties not mentioned in the request
607
- will not be changed. Update fails if the specified share does not already exist.
608
-
609
- :param resource_group_name: The name of the resource group within the user's subscription. The
610
- name is case insensitive. Required.
611
- :type resource_group_name: str
612
- :param account_name: The name of the storage account within the specified resource group.
613
- Storage account names must be between 3 and 24 characters in length and use numbers and
614
- lower-case letters only. Required.
615
- :type account_name: str
616
- :param share_name: The name of the file share within the specified storage account. File share
617
- names must be between 3 and 63 characters in length and use numbers, lower-case letters and
618
- dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter
619
- or number. Required.
620
- :type share_name: str
621
- :param file_share: Properties to update for the file share. Required.
622
- :type file_share: IO[bytes]
623
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
624
- Default value is "application/json".
625
- :paramtype content_type: str
626
- :return: FileShare or the result of cls(response)
627
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.FileShare
628
- :raises ~azure.core.exceptions.HttpResponseError:
629
- """
630
-
631
- @distributed_trace
632
- def update(
633
- self,
634
- resource_group_name: str,
635
- account_name: str,
636
- share_name: str,
637
- file_share: Union[_models.FileShare, IO[bytes]],
638
- **kwargs: Any
639
- ) -> _models.FileShare:
640
- """Updates share properties as specified in request body. Properties not mentioned in the request
641
- will not be changed. Update fails if the specified share does not already exist.
642
-
643
- :param resource_group_name: The name of the resource group within the user's subscription. The
644
- name is case insensitive. Required.
645
- :type resource_group_name: str
646
- :param account_name: The name of the storage account within the specified resource group.
647
- Storage account names must be between 3 and 24 characters in length and use numbers and
648
- lower-case letters only. Required.
649
- :type account_name: str
650
- :param share_name: The name of the file share within the specified storage account. File share
651
- names must be between 3 and 63 characters in length and use numbers, lower-case letters and
652
- dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter
653
- or number. Required.
654
- :type share_name: str
655
- :param file_share: Properties to update for the file share. Is either a FileShare type or a
656
- IO[bytes] type. Required.
657
- :type file_share: ~azure.mgmt.storage.v2019_06_01.models.FileShare or IO[bytes]
658
- :return: FileShare or the result of cls(response)
659
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.FileShare
660
- :raises ~azure.core.exceptions.HttpResponseError:
661
- """
662
- error_map: MutableMapping = {
663
- 401: ClientAuthenticationError,
664
- 404: ResourceNotFoundError,
665
- 409: ResourceExistsError,
666
- 304: ResourceNotModifiedError,
667
- }
668
- error_map.update(kwargs.pop("error_map", {}) or {})
669
-
670
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
671
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
672
-
673
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
674
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
675
- cls: ClsType[_models.FileShare] = kwargs.pop("cls", None)
676
-
677
- content_type = content_type or "application/json"
678
- _json = None
679
- _content = None
680
- if isinstance(file_share, (IOBase, bytes)):
681
- _content = file_share
682
- else:
683
- _json = self._serialize.body(file_share, "FileShare")
684
-
685
- _request = build_update_request(
686
- resource_group_name=resource_group_name,
687
- account_name=account_name,
688
- share_name=share_name,
689
- subscription_id=self._config.subscription_id,
690
- api_version=api_version,
691
- content_type=content_type,
692
- json=_json,
693
- content=_content,
694
- headers=_headers,
695
- params=_params,
696
- )
697
- _request.url = self._client.format_url(_request.url)
698
-
699
- _stream = False
700
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
701
- _request, stream=_stream, **kwargs
702
- )
703
-
704
- response = pipeline_response.http_response
705
-
706
- if response.status_code not in [200]:
707
- map_error(status_code=response.status_code, response=response, error_map=error_map)
708
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
709
-
710
- deserialized = self._deserialize("FileShare", pipeline_response.http_response)
711
-
712
- if cls:
713
- return cls(pipeline_response, deserialized, {}) # type: ignore
714
-
715
- return deserialized # type: ignore
716
-
717
- @distributed_trace
718
- def get(
719
- self,
720
- resource_group_name: str,
721
- account_name: str,
722
- share_name: str,
723
- expand: Literal["stats"] = "stats",
724
- **kwargs: Any
725
- ) -> _models.FileShare:
726
- """Gets properties of a specified share.
727
-
728
- :param resource_group_name: The name of the resource group within the user's subscription. The
729
- name is case insensitive. Required.
730
- :type resource_group_name: str
731
- :param account_name: The name of the storage account within the specified resource group.
732
- Storage account names must be between 3 and 24 characters in length and use numbers and
733
- lower-case letters only. Required.
734
- :type account_name: str
735
- :param share_name: The name of the file share within the specified storage account. File share
736
- names must be between 3 and 63 characters in length and use numbers, lower-case letters and
737
- dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter
738
- or number. Required.
739
- :type share_name: str
740
- :param expand: Optional, used to expand the properties within share's properties. Known values
741
- are "stats" and None. Default value is "stats".
742
- :type expand: str
743
- :return: FileShare or the result of cls(response)
744
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.FileShare
745
- :raises ~azure.core.exceptions.HttpResponseError:
746
- """
747
- error_map: MutableMapping = {
748
- 401: ClientAuthenticationError,
749
- 404: ResourceNotFoundError,
750
- 409: ResourceExistsError,
751
- 304: ResourceNotModifiedError,
752
- }
753
- error_map.update(kwargs.pop("error_map", {}) or {})
754
-
755
- _headers = kwargs.pop("headers", {}) or {}
756
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
757
-
758
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
759
- cls: ClsType[_models.FileShare] = kwargs.pop("cls", None)
760
-
761
- _request = build_get_request(
762
- resource_group_name=resource_group_name,
763
- account_name=account_name,
764
- share_name=share_name,
765
- subscription_id=self._config.subscription_id,
766
- expand=expand,
767
- api_version=api_version,
768
- headers=_headers,
769
- params=_params,
770
- )
771
- _request.url = self._client.format_url(_request.url)
772
-
773
- _stream = False
774
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
775
- _request, stream=_stream, **kwargs
776
- )
777
-
778
- response = pipeline_response.http_response
779
-
780
- if response.status_code not in [200]:
781
- map_error(status_code=response.status_code, response=response, error_map=error_map)
782
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
783
-
784
- deserialized = self._deserialize("FileShare", pipeline_response.http_response)
785
-
786
- if cls:
787
- return cls(pipeline_response, deserialized, {}) # type: ignore
788
-
789
- return deserialized # type: ignore
790
-
791
- @distributed_trace
792
- def delete( # pylint: disable=inconsistent-return-statements
793
- self, resource_group_name: str, account_name: str, share_name: str, **kwargs: Any
794
- ) -> None:
795
- """Deletes specified share under its account.
796
-
797
- :param resource_group_name: The name of the resource group within the user's subscription. The
798
- name is case insensitive. Required.
799
- :type resource_group_name: str
800
- :param account_name: The name of the storage account within the specified resource group.
801
- Storage account names must be between 3 and 24 characters in length and use numbers and
802
- lower-case letters only. Required.
803
- :type account_name: str
804
- :param share_name: The name of the file share within the specified storage account. File share
805
- names must be between 3 and 63 characters in length and use numbers, lower-case letters and
806
- dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter
807
- or number. Required.
808
- :type share_name: str
809
- :return: None or the result of cls(response)
810
- :rtype: None
811
- :raises ~azure.core.exceptions.HttpResponseError:
812
- """
813
- error_map: MutableMapping = {
814
- 401: ClientAuthenticationError,
815
- 404: ResourceNotFoundError,
816
- 409: ResourceExistsError,
817
- 304: ResourceNotModifiedError,
818
- }
819
- error_map.update(kwargs.pop("error_map", {}) or {})
820
-
821
- _headers = kwargs.pop("headers", {}) or {}
822
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
823
-
824
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
825
- cls: ClsType[None] = kwargs.pop("cls", None)
826
-
827
- _request = build_delete_request(
828
- resource_group_name=resource_group_name,
829
- account_name=account_name,
830
- share_name=share_name,
831
- subscription_id=self._config.subscription_id,
832
- api_version=api_version,
833
- headers=_headers,
834
- params=_params,
835
- )
836
- _request.url = self._client.format_url(_request.url)
837
-
838
- _stream = False
839
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
840
- _request, stream=_stream, **kwargs
841
- )
842
-
843
- response = pipeline_response.http_response
844
-
845
- if response.status_code not in [200, 204]:
846
- map_error(status_code=response.status_code, response=response, error_map=error_map)
847
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
848
-
849
- if cls:
850
- return cls(pipeline_response, None, {}) # type: ignore
851
-
852
- @overload
853
- def restore(
854
- self,
855
- resource_group_name: str,
856
- account_name: str,
857
- share_name: str,
858
- deleted_share: _models.DeletedShare,
859
- *,
860
- content_type: str = "application/json",
861
- **kwargs: Any
862
- ) -> None:
863
- """Restore a file share within a valid retention days if share soft delete is enabled.
864
-
865
- :param resource_group_name: The name of the resource group within the user's subscription. The
866
- name is case insensitive. Required.
867
- :type resource_group_name: str
868
- :param account_name: The name of the storage account within the specified resource group.
869
- Storage account names must be between 3 and 24 characters in length and use numbers and
870
- lower-case letters only. Required.
871
- :type account_name: str
872
- :param share_name: The name of the file share within the specified storage account. File share
873
- names must be between 3 and 63 characters in length and use numbers, lower-case letters and
874
- dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter
875
- or number. Required.
876
- :type share_name: str
877
- :param deleted_share: Required.
878
- :type deleted_share: ~azure.mgmt.storage.v2019_06_01.models.DeletedShare
879
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
880
- Default value is "application/json".
881
- :paramtype content_type: str
882
- :return: None or the result of cls(response)
883
- :rtype: None
884
- :raises ~azure.core.exceptions.HttpResponseError:
885
- """
886
-
887
- @overload
888
- def restore(
889
- self,
890
- resource_group_name: str,
891
- account_name: str,
892
- share_name: str,
893
- deleted_share: IO[bytes],
894
- *,
895
- content_type: str = "application/json",
896
- **kwargs: Any
897
- ) -> None:
898
- """Restore a file share within a valid retention days if share soft delete is enabled.
899
-
900
- :param resource_group_name: The name of the resource group within the user's subscription. The
901
- name is case insensitive. Required.
902
- :type resource_group_name: str
903
- :param account_name: The name of the storage account within the specified resource group.
904
- Storage account names must be between 3 and 24 characters in length and use numbers and
905
- lower-case letters only. Required.
906
- :type account_name: str
907
- :param share_name: The name of the file share within the specified storage account. File share
908
- names must be between 3 and 63 characters in length and use numbers, lower-case letters and
909
- dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter
910
- or number. Required.
911
- :type share_name: str
912
- :param deleted_share: Required.
913
- :type deleted_share: IO[bytes]
914
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
915
- Default value is "application/json".
916
- :paramtype content_type: str
917
- :return: None or the result of cls(response)
918
- :rtype: None
919
- :raises ~azure.core.exceptions.HttpResponseError:
920
- """
921
-
922
- @distributed_trace
923
- def restore( # pylint: disable=inconsistent-return-statements
924
- self,
925
- resource_group_name: str,
926
- account_name: str,
927
- share_name: str,
928
- deleted_share: Union[_models.DeletedShare, IO[bytes]],
929
- **kwargs: Any
930
- ) -> None:
931
- """Restore a file share within a valid retention days if share soft delete is enabled.
932
-
933
- :param resource_group_name: The name of the resource group within the user's subscription. The
934
- name is case insensitive. Required.
935
- :type resource_group_name: str
936
- :param account_name: The name of the storage account within the specified resource group.
937
- Storage account names must be between 3 and 24 characters in length and use numbers and
938
- lower-case letters only. Required.
939
- :type account_name: str
940
- :param share_name: The name of the file share within the specified storage account. File share
941
- names must be between 3 and 63 characters in length and use numbers, lower-case letters and
942
- dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter
943
- or number. Required.
944
- :type share_name: str
945
- :param deleted_share: Is either a DeletedShare type or a IO[bytes] type. Required.
946
- :type deleted_share: ~azure.mgmt.storage.v2019_06_01.models.DeletedShare or IO[bytes]
947
- :return: None or the result of cls(response)
948
- :rtype: None
949
- :raises ~azure.core.exceptions.HttpResponseError:
950
- """
951
- error_map: MutableMapping = {
952
- 401: ClientAuthenticationError,
953
- 404: ResourceNotFoundError,
954
- 409: ResourceExistsError,
955
- 304: ResourceNotModifiedError,
956
- }
957
- error_map.update(kwargs.pop("error_map", {}) or {})
958
-
959
- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
960
- _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
961
-
962
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
963
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
964
- cls: ClsType[None] = kwargs.pop("cls", None)
965
-
966
- content_type = content_type or "application/json"
967
- _json = None
968
- _content = None
969
- if isinstance(deleted_share, (IOBase, bytes)):
970
- _content = deleted_share
971
- else:
972
- _json = self._serialize.body(deleted_share, "DeletedShare")
973
-
974
- _request = build_restore_request(
975
- resource_group_name=resource_group_name,
976
- account_name=account_name,
977
- share_name=share_name,
978
- subscription_id=self._config.subscription_id,
979
- api_version=api_version,
980
- content_type=content_type,
981
- json=_json,
982
- content=_content,
983
- headers=_headers,
984
- params=_params,
985
- )
986
- _request.url = self._client.format_url(_request.url)
987
-
988
- _stream = False
989
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
990
- _request, stream=_stream, **kwargs
991
- )
992
-
993
- response = pipeline_response.http_response
994
-
995
- if response.status_code not in [200]:
996
- map_error(status_code=response.status_code, response=response, error_map=error_map)
997
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
998
-
999
- if cls:
1000
- return cls(pipeline_response, None, {}) # type: ignore