azure-mgmt-storage 22.2.0__py3-none-any.whl → 23.0.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 (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 +68 -84
  14. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_blob_inventory_policies_operations.py +28 -36
  15. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_blob_services_operations.py +22 -24
  16. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_deleted_accounts_operations.py +16 -19
  17. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_encryption_scopes_operations.py +29 -32
  18. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_file_services_operations.py +26 -29
  19. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_file_shares_operations.py +38 -41
  20. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_local_users_operations.py +28 -31
  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 +18 -21
  23. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_object_replication_policies_operations.py +23 -25
  24. azure/mgmt/storage/{v2017_10_01/aio → aio}/operations/_operations.py +14 -17
  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 +23 -25
  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 +29 -32
  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 +14 -17
  31. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_storage_accounts_operations.py +83 -111
  32. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_storage_task_assignment_instances_report_operations.py +15 -17
  33. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_storage_task_assignments_instances_report_operations.py +15 -17
  34. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_storage_task_assignments_operations.py +38 -44
  35. azure/mgmt/storage/{v2024_01_01/aio → aio}/operations/_table_operations.py +29 -31
  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 +14 -16
  38. azure/mgmt/storage/{v2024_01_01/models → models}/_models_py3.py +857 -912
  39. azure/mgmt/storage/{v2016_01_01/operations → models}/_patch.py +5 -4
  40. azure/mgmt/storage/{v2024_01_01/operations → operations}/__init__.py +1 -0
  41. azure/mgmt/storage/{v2024_01_01/operations → operations}/_blob_containers_operations.py +84 -87
  42. azure/mgmt/storage/{v2024_01_01/operations → operations}/_blob_inventory_policies_operations.py +34 -42
  43. azure/mgmt/storage/{v2024_01_01/operations → operations}/_blob_services_operations.py +27 -30
  44. azure/mgmt/storage/{v2024_01_01/operations → operations}/_deleted_accounts_operations.py +19 -21
  45. azure/mgmt/storage/{v2024_01_01/operations → operations}/_encryption_scopes_operations.py +35 -37
  46. azure/mgmt/storage/{v2024_01_01/operations → operations}/_file_services_operations.py +33 -35
  47. azure/mgmt/storage/{v2024_01_01/operations → operations}/_file_shares_operations.py +47 -50
  48. azure/mgmt/storage/{v2024_01_01/operations → operations}/_local_users_operations.py +36 -38
  49. azure/mgmt/storage/{v2024_01_01/operations → operations}/_management_policies_operations.py +28 -35
  50. azure/mgmt/storage/{v2024_01_01/operations → operations}/_network_security_perimeter_configurations_operations.py +23 -25
  51. azure/mgmt/storage/{v2024_01_01/operations → operations}/_object_replication_policies_operations.py +29 -32
  52. azure/mgmt/storage/{v2024_01_01/operations → operations}/_operations.py +15 -18
  53. azure/mgmt/storage/operations/_patch.py +21 -0
  54. azure/mgmt/storage/{v2024_01_01/operations → operations}/_private_endpoint_connections_operations.py +29 -32
  55. azure/mgmt/storage/{v2024_01_01/operations → operations}/_private_link_resources_operations.py +14 -16
  56. azure/mgmt/storage/{v2024_01_01/operations → operations}/_queue_operations.py +36 -38
  57. azure/mgmt/storage/{v2024_01_01/operations → operations}/_queue_services_operations.py +24 -26
  58. azure/mgmt/storage/{v2024_01_01/operations → operations}/_skus_operations.py +15 -18
  59. azure/mgmt/storage/{v2024_01_01/operations → operations}/_storage_accounts_operations.py +101 -109
  60. azure/mgmt/storage/{v2024_01_01/operations → operations}/_storage_task_assignment_instances_report_operations.py +17 -21
  61. azure/mgmt/storage/{v2024_01_01/operations → operations}/_storage_task_assignments_instances_report_operations.py +17 -21
  62. azure/mgmt/storage/{v2024_01_01/operations → operations}/_storage_task_assignments_operations.py +42 -53
  63. azure/mgmt/storage/{v2024_01_01/operations → operations}/_table_operations.py +36 -38
  64. azure/mgmt/storage/{v2024_01_01/operations → operations}/_table_services_operations.py +24 -26
  65. azure/mgmt/storage/{v2024_01_01/operations → operations}/_usages_operations.py +16 -19
  66. {azure_mgmt_storage-22.2.0.dist-info → azure_mgmt_storage-23.0.1.dist-info}/METADATA +17 -6
  67. azure_mgmt_storage-23.0.1.dist-info/RECORD +73 -0
  68. azure/mgmt/storage/models.py +0 -8
  69. azure/mgmt/storage/v2016_01_01/__init__.py +0 -32
  70. azure/mgmt/storage/v2016_01_01/_configuration.py +0 -65
  71. azure/mgmt/storage/v2016_01_01/_patch.py +0 -32
  72. azure/mgmt/storage/v2016_01_01/_storage_management_client.py +0 -117
  73. azure/mgmt/storage/v2016_01_01/aio/__init__.py +0 -29
  74. azure/mgmt/storage/v2016_01_01/aio/_configuration.py +0 -65
  75. azure/mgmt/storage/v2016_01_01/aio/_patch.py +0 -32
  76. azure/mgmt/storage/v2016_01_01/aio/_storage_management_client.py +0 -120
  77. azure/mgmt/storage/v2016_01_01/aio/operations/__init__.py +0 -27
  78. azure/mgmt/storage/v2016_01_01/aio/operations/_storage_accounts_operations.py +0 -1023
  79. azure/mgmt/storage/v2016_01_01/aio/operations/_usage_operations.py +0 -130
  80. azure/mgmt/storage/v2016_01_01/models/__init__.py +0 -88
  81. azure/mgmt/storage/v2016_01_01/models/_models_py3.py +0 -829
  82. azure/mgmt/storage/v2016_01_01/models/_storage_management_client_enums.py +0 -99
  83. azure/mgmt/storage/v2016_01_01/operations/__init__.py +0 -27
  84. azure/mgmt/storage/v2016_01_01/operations/_storage_accounts_operations.py +0 -1278
  85. azure/mgmt/storage/v2016_01_01/operations/_usage_operations.py +0 -157
  86. azure/mgmt/storage/v2016_01_01/py.typed +0 -1
  87. azure/mgmt/storage/v2017_10_01/__init__.py +0 -32
  88. azure/mgmt/storage/v2017_10_01/_configuration.py +0 -65
  89. azure/mgmt/storage/v2017_10_01/_patch.py +0 -32
  90. azure/mgmt/storage/v2017_10_01/_storage_management.py +0 -121
  91. azure/mgmt/storage/v2017_10_01/_version.py +0 -9
  92. azure/mgmt/storage/v2017_10_01/aio/__init__.py +0 -29
  93. azure/mgmt/storage/v2017_10_01/aio/_configuration.py +0 -65
  94. azure/mgmt/storage/v2017_10_01/aio/_patch.py +0 -32
  95. azure/mgmt/storage/v2017_10_01/aio/_storage_management.py +0 -124
  96. azure/mgmt/storage/v2017_10_01/aio/operations/__init__.py +0 -31
  97. azure/mgmt/storage/v2017_10_01/aio/operations/_skus_operations.py +0 -130
  98. azure/mgmt/storage/v2017_10_01/aio/operations/_storage_accounts_operations.py +0 -1299
  99. azure/mgmt/storage/v2017_10_01/aio/operations/_usage_operations.py +0 -130
  100. azure/mgmt/storage/v2017_10_01/models/__init__.py +0 -140
  101. azure/mgmt/storage/v2017_10_01/models/_models_py3.py +0 -1851
  102. azure/mgmt/storage/v2017_10_01/models/_patch.py +0 -20
  103. azure/mgmt/storage/v2017_10_01/models/_storage_management_enums.py +0 -192
  104. azure/mgmt/storage/v2017_10_01/operations/__init__.py +0 -31
  105. azure/mgmt/storage/v2017_10_01/operations/_operations.py +0 -151
  106. azure/mgmt/storage/v2017_10_01/operations/_patch.py +0 -20
  107. azure/mgmt/storage/v2017_10_01/operations/_skus_operations.py +0 -157
  108. azure/mgmt/storage/v2017_10_01/operations/_storage_accounts_operations.py +0 -1638
  109. azure/mgmt/storage/v2017_10_01/operations/_usage_operations.py +0 -157
  110. azure/mgmt/storage/v2017_10_01/py.typed +0 -1
  111. azure/mgmt/storage/v2019_06_01/__init__.py +0 -32
  112. azure/mgmt/storage/v2019_06_01/_configuration.py +0 -64
  113. azure/mgmt/storage/v2019_06_01/_patch.py +0 -32
  114. azure/mgmt/storage/v2019_06_01/_storage_management_client.py +0 -213
  115. azure/mgmt/storage/v2019_06_01/_version.py +0 -9
  116. azure/mgmt/storage/v2019_06_01/aio/__init__.py +0 -29
  117. azure/mgmt/storage/v2019_06_01/aio/_configuration.py +0 -64
  118. azure/mgmt/storage/v2019_06_01/aio/_patch.py +0 -32
  119. azure/mgmt/storage/v2019_06_01/aio/_storage_management_client.py +0 -217
  120. azure/mgmt/storage/v2019_06_01/aio/operations/__init__.py +0 -59
  121. azure/mgmt/storage/v2019_06_01/aio/operations/_blob_containers_operations.py +0 -1725
  122. azure/mgmt/storage/v2019_06_01/aio/operations/_blob_inventory_policies_operations.py +0 -437
  123. azure/mgmt/storage/v2019_06_01/aio/operations/_blob_services_operations.py +0 -368
  124. azure/mgmt/storage/v2019_06_01/aio/operations/_encryption_scopes_operations.py +0 -538
  125. azure/mgmt/storage/v2019_06_01/aio/operations/_file_services_operations.py +0 -335
  126. azure/mgmt/storage/v2019_06_01/aio/operations/_file_shares_operations.py +0 -771
  127. azure/mgmt/storage/v2019_06_01/aio/operations/_object_replication_policies_operations.py +0 -428
  128. azure/mgmt/storage/v2019_06_01/aio/operations/_operations.py +0 -130
  129. azure/mgmt/storage/v2019_06_01/aio/operations/_patch.py +0 -20
  130. azure/mgmt/storage/v2019_06_01/aio/operations/_private_endpoint_connections_operations.py +0 -424
  131. azure/mgmt/storage/v2019_06_01/aio/operations/_private_link_resources_operations.py +0 -113
  132. azure/mgmt/storage/v2019_06_01/aio/operations/_queue_operations.py +0 -597
  133. azure/mgmt/storage/v2019_06_01/aio/operations/_queue_services_operations.py +0 -335
  134. azure/mgmt/storage/v2019_06_01/aio/operations/_skus_operations.py +0 -131
  135. azure/mgmt/storage/v2019_06_01/aio/operations/_storage_accounts_operations.py +0 -1696
  136. azure/mgmt/storage/v2019_06_01/aio/operations/_table_operations.py +0 -394
  137. azure/mgmt/storage/v2019_06_01/aio/operations/_table_services_operations.py +0 -335
  138. azure/mgmt/storage/v2019_06_01/aio/operations/_usages_operations.py +0 -134
  139. azure/mgmt/storage/v2019_06_01/models/__init__.py +0 -364
  140. azure/mgmt/storage/v2019_06_01/models/_models_py3.py +0 -6038
  141. azure/mgmt/storage/v2019_06_01/models/_patch.py +0 -20
  142. azure/mgmt/storage/v2019_06_01/models/_storage_management_client_enums.py +0 -456
  143. azure/mgmt/storage/v2019_06_01/operations/__init__.py +0 -59
  144. azure/mgmt/storage/v2019_06_01/operations/_blob_containers_operations.py +0 -2226
  145. azure/mgmt/storage/v2019_06_01/operations/_blob_inventory_policies_operations.py +0 -582
  146. azure/mgmt/storage/v2019_06_01/operations/_blob_services_operations.py +0 -476
  147. azure/mgmt/storage/v2019_06_01/operations/_encryption_scopes_operations.py +0 -677
  148. azure/mgmt/storage/v2019_06_01/operations/_file_services_operations.py +0 -444
  149. azure/mgmt/storage/v2019_06_01/operations/_file_shares_operations.py +0 -1000
  150. azure/mgmt/storage/v2019_06_01/operations/_management_policies_operations.py +0 -453
  151. azure/mgmt/storage/v2019_06_01/operations/_object_replication_policies_operations.py +0 -567
  152. azure/mgmt/storage/v2019_06_01/operations/_operations.py +0 -151
  153. azure/mgmt/storage/v2019_06_01/operations/_patch.py +0 -20
  154. azure/mgmt/storage/v2019_06_01/operations/_private_endpoint_connections_operations.py +0 -575
  155. azure/mgmt/storage/v2019_06_01/operations/_private_link_resources_operations.py +0 -149
  156. azure/mgmt/storage/v2019_06_01/operations/_queue_operations.py +0 -805
  157. azure/mgmt/storage/v2019_06_01/operations/_queue_services_operations.py +0 -444
  158. azure/mgmt/storage/v2019_06_01/operations/_skus_operations.py +0 -157
  159. azure/mgmt/storage/v2019_06_01/operations/_storage_accounts_operations.py +0 -2122
  160. azure/mgmt/storage/v2019_06_01/operations/_table_operations.py +0 -563
  161. azure/mgmt/storage/v2019_06_01/operations/_table_services_operations.py +0 -444
  162. azure/mgmt/storage/v2019_06_01/operations/_usages_operations.py +0 -164
  163. azure/mgmt/storage/v2019_06_01/py.typed +0 -1
  164. azure/mgmt/storage/v2024_01_01/__init__.py +0 -32
  165. azure/mgmt/storage/v2024_01_01/_configuration.py +0 -64
  166. azure/mgmt/storage/v2024_01_01/_patch.py +0 -20
  167. azure/mgmt/storage/v2024_01_01/_storage_management_client.py +0 -256
  168. azure/mgmt/storage/v2024_01_01/_version.py +0 -9
  169. azure/mgmt/storage/v2024_01_01/aio/__init__.py +0 -29
  170. azure/mgmt/storage/v2024_01_01/aio/_configuration.py +0 -64
  171. azure/mgmt/storage/v2024_01_01/aio/_patch.py +0 -20
  172. azure/mgmt/storage/v2024_01_01/aio/_storage_management_client.py +0 -261
  173. azure/mgmt/storage/v2024_01_01/aio/operations/_management_policies_operations.py +0 -343
  174. azure/mgmt/storage/v2024_01_01/aio/operations/_operations.py +0 -130
  175. azure/mgmt/storage/v2024_01_01/aio/operations/_patch.py +0 -20
  176. azure/mgmt/storage/v2024_01_01/models/_patch.py +0 -20
  177. azure/mgmt/storage/v2024_01_01/operations/_patch.py +0 -20
  178. azure/mgmt/storage/v2024_01_01/py.typed +0 -1
  179. azure_mgmt_storage-22.2.0.dist-info/RECORD +0 -183
  180. /azure/mgmt/storage/{v2024_01_01/models → models}/__init__.py +0 -0
  181. /azure/mgmt/storage/{v2024_01_01/models → models}/_storage_management_client_enums.py +0 -0
  182. {azure_mgmt_storage-22.2.0.dist-info → azure_mgmt_storage-23.0.1.dist-info}/LICENSE +0 -0
  183. {azure_mgmt_storage-22.2.0.dist-info → azure_mgmt_storage-23.0.1.dist-info}/WHEEL +0 -0
  184. {azure_mgmt_storage-22.2.0.dist-info → azure_mgmt_storage-23.0.1.dist-info}/top_level.txt +0 -0
@@ -5,11 +5,12 @@
5
5
  # Code generated by Microsoft (R) AutoRest Code Generator.
6
6
  # Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  # --------------------------------------------------------------------------
8
+ from collections.abc import MutableMapping
8
9
  from io import IOBase
9
- import sys
10
- from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
10
+ from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
11
11
  import urllib.parse
12
12
 
13
+ from azure.core import AsyncPipelineClient
13
14
  from azure.core.async_paging import AsyncItemPaged, AsyncList
14
15
  from azure.core.exceptions import (
15
16
  ClientAuthenticationError,
@@ -27,6 +28,7 @@ from azure.core.utils import case_insensitive_dict
27
28
  from azure.mgmt.core.exceptions import ARMErrorFormat
28
29
 
29
30
  from ... import models as _models
31
+ from ..._utils.serialization import Deserializer, Serializer
30
32
  from ...operations._local_users_operations import (
31
33
  build_create_or_update_request,
32
34
  build_delete_request,
@@ -35,11 +37,8 @@ from ...operations._local_users_operations import (
35
37
  build_list_request,
36
38
  build_regenerate_password_request,
37
39
  )
40
+ from .._configuration import StorageManagementClientConfiguration
38
41
 
39
- if sys.version_info >= (3, 9):
40
- from collections.abc import MutableMapping
41
- else:
42
- from typing import MutableMapping # type: ignore
43
42
  T = TypeVar("T")
44
43
  ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
45
44
 
@@ -50,7 +49,7 @@ class LocalUsersOperations:
50
49
  **DO NOT** instantiate this class directly.
51
50
 
52
51
  Instead, you should access the following operations through
53
- :class:`~azure.mgmt.storage.v2024_01_01.aio.StorageManagementClient`'s
52
+ :class:`~azure.mgmt.storage.aio.StorageManagementClient`'s
54
53
  :attr:`local_users` attribute.
55
54
  """
56
55
 
@@ -58,11 +57,10 @@ class LocalUsersOperations:
58
57
 
59
58
  def __init__(self, *args, **kwargs) -> None:
60
59
  input_args = list(args)
61
- self._client = input_args.pop(0) if input_args else kwargs.pop("client")
62
- self._config = input_args.pop(0) if input_args else kwargs.pop("config")
63
- self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
64
- self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
65
- self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
60
+ self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client")
61
+ self._config: StorageManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config")
62
+ self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer")
63
+ self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer")
66
64
 
67
65
  @distributed_trace
68
66
  def list(
@@ -73,7 +71,7 @@ class LocalUsersOperations:
73
71
  filter: Optional[str] = None,
74
72
  include: Optional[Union[str, _models.ListLocalUserIncludeParam]] = None,
75
73
  **kwargs: Any
76
- ) -> AsyncIterable["_models.LocalUser"]:
74
+ ) -> AsyncItemPaged["_models.LocalUser"]:
77
75
  """List the local users associated with the storage account.
78
76
 
79
77
  :param resource_group_name: The name of the resource group within the user's subscription. The
@@ -91,16 +89,15 @@ class LocalUsersOperations:
91
89
  :type filter: str
92
90
  :param include: Optional, when specified, will list local users enabled for the specific
93
91
  protocol. Lists all users by default. "nfsv3" Default value is None.
94
- :type include: str or ~azure.mgmt.storage.v2024_01_01.models.ListLocalUserIncludeParam
92
+ :type include: str or ~azure.mgmt.storage.models.ListLocalUserIncludeParam
95
93
  :return: An iterator like instance of either LocalUser or the result of cls(response)
96
- :rtype:
97
- ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2024_01_01.models.LocalUser]
94
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.models.LocalUser]
98
95
  :raises ~azure.core.exceptions.HttpResponseError:
99
96
  """
100
97
  _headers = kwargs.pop("headers", {}) or {}
101
98
  _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
102
99
 
103
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-01-01"))
100
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
104
101
  cls: ClsType[_models.LocalUsers] = kwargs.pop("cls", None)
105
102
 
106
103
  error_map: MutableMapping = {
@@ -136,7 +133,7 @@ class LocalUsersOperations:
136
133
  for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
137
134
  }
138
135
  )
139
- _next_request_params["api-version"] = self._api_version
136
+ _next_request_params["api-version"] = self._config.api_version
140
137
  _request = HttpRequest(
141
138
  "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
142
139
  )
@@ -184,7 +181,7 @@ class LocalUsersOperations:
184
181
  numbers only. It must be unique only within the storage account. Required.
185
182
  :type username: str
186
183
  :return: LocalUser or the result of cls(response)
187
- :rtype: ~azure.mgmt.storage.v2024_01_01.models.LocalUser
184
+ :rtype: ~azure.mgmt.storage.models.LocalUser
188
185
  :raises ~azure.core.exceptions.HttpResponseError:
189
186
  """
190
187
  error_map: MutableMapping = {
@@ -198,7 +195,7 @@ class LocalUsersOperations:
198
195
  _headers = kwargs.pop("headers", {}) or {}
199
196
  _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
200
197
 
201
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-01-01"))
198
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
202
199
  cls: ClsType[_models.LocalUser] = kwargs.pop("cls", None)
203
200
 
204
201
  _request = build_get_request(
@@ -256,12 +253,12 @@ class LocalUsersOperations:
256
253
  numbers only. It must be unique only within the storage account. Required.
257
254
  :type username: str
258
255
  :param properties: The local user associated with a storage account. Required.
259
- :type properties: ~azure.mgmt.storage.v2024_01_01.models.LocalUser
256
+ :type properties: ~azure.mgmt.storage.models.LocalUser
260
257
  :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
261
258
  Default value is "application/json".
262
259
  :paramtype content_type: str
263
260
  :return: LocalUser or the result of cls(response)
264
- :rtype: ~azure.mgmt.storage.v2024_01_01.models.LocalUser
261
+ :rtype: ~azure.mgmt.storage.models.LocalUser
265
262
  :raises ~azure.core.exceptions.HttpResponseError:
266
263
  """
267
264
 
@@ -295,7 +292,7 @@ class LocalUsersOperations:
295
292
  Default value is "application/json".
296
293
  :paramtype content_type: str
297
294
  :return: LocalUser or the result of cls(response)
298
- :rtype: ~azure.mgmt.storage.v2024_01_01.models.LocalUser
295
+ :rtype: ~azure.mgmt.storage.models.LocalUser
299
296
  :raises ~azure.core.exceptions.HttpResponseError:
300
297
  """
301
298
 
@@ -323,9 +320,9 @@ class LocalUsersOperations:
323
320
  :type username: str
324
321
  :param properties: The local user associated with a storage account. Is either a LocalUser type
325
322
  or a IO[bytes] type. Required.
326
- :type properties: ~azure.mgmt.storage.v2024_01_01.models.LocalUser or IO[bytes]
323
+ :type properties: ~azure.mgmt.storage.models.LocalUser or IO[bytes]
327
324
  :return: LocalUser or the result of cls(response)
328
- :rtype: ~azure.mgmt.storage.v2024_01_01.models.LocalUser
325
+ :rtype: ~azure.mgmt.storage.models.LocalUser
329
326
  :raises ~azure.core.exceptions.HttpResponseError:
330
327
  """
331
328
  error_map: MutableMapping = {
@@ -339,7 +336,7 @@ class LocalUsersOperations:
339
336
  _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
340
337
  _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
341
338
 
342
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-01-01"))
339
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
343
340
  content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
344
341
  cls: ClsType[_models.LocalUser] = kwargs.pop("cls", None)
345
342
 
@@ -413,7 +410,7 @@ class LocalUsersOperations:
413
410
  _headers = kwargs.pop("headers", {}) or {}
414
411
  _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
415
412
 
416
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-01-01"))
413
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
417
414
  cls: ClsType[None] = kwargs.pop("cls", None)
418
415
 
419
416
  _request = build_delete_request(
@@ -459,7 +456,7 @@ class LocalUsersOperations:
459
456
  numbers only. It must be unique only within the storage account. Required.
460
457
  :type username: str
461
458
  :return: LocalUserKeys or the result of cls(response)
462
- :rtype: ~azure.mgmt.storage.v2024_01_01.models.LocalUserKeys
459
+ :rtype: ~azure.mgmt.storage.models.LocalUserKeys
463
460
  :raises ~azure.core.exceptions.HttpResponseError:
464
461
  """
465
462
  error_map: MutableMapping = {
@@ -473,7 +470,7 @@ class LocalUsersOperations:
473
470
  _headers = kwargs.pop("headers", {}) or {}
474
471
  _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
475
472
 
476
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-01-01"))
473
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
477
474
  cls: ClsType[_models.LocalUserKeys] = kwargs.pop("cls", None)
478
475
 
479
476
  _request = build_list_keys_request(
@@ -523,7 +520,7 @@ class LocalUsersOperations:
523
520
  numbers only. It must be unique only within the storage account. Required.
524
521
  :type username: str
525
522
  :return: LocalUserRegeneratePasswordResult or the result of cls(response)
526
- :rtype: ~azure.mgmt.storage.v2024_01_01.models.LocalUserRegeneratePasswordResult
523
+ :rtype: ~azure.mgmt.storage.models.LocalUserRegeneratePasswordResult
527
524
  :raises ~azure.core.exceptions.HttpResponseError:
528
525
  """
529
526
  error_map: MutableMapping = {
@@ -537,7 +534,7 @@ class LocalUsersOperations:
537
534
  _headers = kwargs.pop("headers", {}) or {}
538
535
  _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
539
536
 
540
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-01-01"))
537
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
541
538
  cls: ClsType[_models.LocalUserRegeneratePasswordResult] = kwargs.pop("cls", None)
542
539
 
543
540
  _request = build_regenerate_password_request(
@@ -5,10 +5,11 @@
5
5
  # Code generated by Microsoft (R) AutoRest Code Generator.
6
6
  # Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  # --------------------------------------------------------------------------
8
+ from collections.abc import MutableMapping
8
9
  from io import IOBase
9
- import sys
10
10
  from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
11
11
 
12
+ from azure.core import AsyncPipelineClient
12
13
  from azure.core.exceptions import (
13
14
  ClientAuthenticationError,
14
15
  HttpResponseError,
@@ -24,16 +25,14 @@ from azure.core.utils import case_insensitive_dict
24
25
  from azure.mgmt.core.exceptions import ARMErrorFormat
25
26
 
26
27
  from ... import models as _models
28
+ from ..._utils.serialization import Deserializer, Serializer
27
29
  from ...operations._management_policies_operations import (
28
30
  build_create_or_update_request,
29
31
  build_delete_request,
30
32
  build_get_request,
31
33
  )
34
+ from .._configuration import StorageManagementClientConfiguration
32
35
 
33
- if sys.version_info >= (3, 9):
34
- from collections.abc import MutableMapping
35
- else:
36
- from typing import MutableMapping # type: ignore
37
36
  T = TypeVar("T")
38
37
  ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
39
38
 
@@ -44,7 +43,7 @@ class ManagementPoliciesOperations:
44
43
  **DO NOT** instantiate this class directly.
45
44
 
46
45
  Instead, you should access the following operations through
47
- :class:`~azure.mgmt.storage.v2019_06_01.aio.StorageManagementClient`'s
46
+ :class:`~azure.mgmt.storage.aio.StorageManagementClient`'s
48
47
  :attr:`management_policies` attribute.
49
48
  """
50
49
 
@@ -52,11 +51,10 @@ class ManagementPoliciesOperations:
52
51
 
53
52
  def __init__(self, *args, **kwargs) -> None:
54
53
  input_args = list(args)
55
- self._client = input_args.pop(0) if input_args else kwargs.pop("client")
56
- self._config = input_args.pop(0) if input_args else kwargs.pop("config")
57
- self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
58
- self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
59
- self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
54
+ self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client")
55
+ self._config: StorageManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config")
56
+ self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer")
57
+ self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer")
60
58
 
61
59
  @distributed_trace_async
62
60
  async def get(
@@ -77,10 +75,9 @@ class ManagementPoliciesOperations:
77
75
  :type account_name: str
78
76
  :param management_policy_name: The name of the Storage Account Management Policy. It should
79
77
  always be 'default'. "default" Required.
80
- :type management_policy_name: str or
81
- ~azure.mgmt.storage.v2019_06_01.models.ManagementPolicyName
78
+ :type management_policy_name: str or ~azure.mgmt.storage.models.ManagementPolicyName
82
79
  :return: ManagementPolicy or the result of cls(response)
83
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.ManagementPolicy
80
+ :rtype: ~azure.mgmt.storage.models.ManagementPolicy
84
81
  :raises ~azure.core.exceptions.HttpResponseError:
85
82
  """
86
83
  error_map: MutableMapping = {
@@ -94,7 +91,7 @@ class ManagementPoliciesOperations:
94
91
  _headers = kwargs.pop("headers", {}) or {}
95
92
  _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
96
93
 
97
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
94
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
98
95
  cls: ClsType[_models.ManagementPolicy] = kwargs.pop("cls", None)
99
96
 
100
97
  _request = build_get_request(
@@ -148,15 +145,14 @@ class ManagementPoliciesOperations:
148
145
  :type account_name: str
149
146
  :param management_policy_name: The name of the Storage Account Management Policy. It should
150
147
  always be 'default'. "default" Required.
151
- :type management_policy_name: str or
152
- ~azure.mgmt.storage.v2019_06_01.models.ManagementPolicyName
148
+ :type management_policy_name: str or ~azure.mgmt.storage.models.ManagementPolicyName
153
149
  :param properties: The ManagementPolicy set to a storage account. Required.
154
- :type properties: ~azure.mgmt.storage.v2019_06_01.models.ManagementPolicy
150
+ :type properties: ~azure.mgmt.storage.models.ManagementPolicy
155
151
  :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
156
152
  Default value is "application/json".
157
153
  :paramtype content_type: str
158
154
  :return: ManagementPolicy or the result of cls(response)
159
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.ManagementPolicy
155
+ :rtype: ~azure.mgmt.storage.models.ManagementPolicy
160
156
  :raises ~azure.core.exceptions.HttpResponseError:
161
157
  """
162
158
 
@@ -182,15 +178,14 @@ class ManagementPoliciesOperations:
182
178
  :type account_name: str
183
179
  :param management_policy_name: The name of the Storage Account Management Policy. It should
184
180
  always be 'default'. "default" Required.
185
- :type management_policy_name: str or
186
- ~azure.mgmt.storage.v2019_06_01.models.ManagementPolicyName
181
+ :type management_policy_name: str or ~azure.mgmt.storage.models.ManagementPolicyName
187
182
  :param properties: The ManagementPolicy set to a storage account. Required.
188
183
  :type properties: IO[bytes]
189
184
  :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
190
185
  Default value is "application/json".
191
186
  :paramtype content_type: str
192
187
  :return: ManagementPolicy or the result of cls(response)
193
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.ManagementPolicy
188
+ :rtype: ~azure.mgmt.storage.models.ManagementPolicy
194
189
  :raises ~azure.core.exceptions.HttpResponseError:
195
190
  """
196
191
 
@@ -214,13 +209,12 @@ class ManagementPoliciesOperations:
214
209
  :type account_name: str
215
210
  :param management_policy_name: The name of the Storage Account Management Policy. It should
216
211
  always be 'default'. "default" Required.
217
- :type management_policy_name: str or
218
- ~azure.mgmt.storage.v2019_06_01.models.ManagementPolicyName
212
+ :type management_policy_name: str or ~azure.mgmt.storage.models.ManagementPolicyName
219
213
  :param properties: The ManagementPolicy set to a storage account. Is either a ManagementPolicy
220
214
  type or a IO[bytes] type. Required.
221
- :type properties: ~azure.mgmt.storage.v2019_06_01.models.ManagementPolicy or IO[bytes]
215
+ :type properties: ~azure.mgmt.storage.models.ManagementPolicy or IO[bytes]
222
216
  :return: ManagementPolicy or the result of cls(response)
223
- :rtype: ~azure.mgmt.storage.v2019_06_01.models.ManagementPolicy
217
+ :rtype: ~azure.mgmt.storage.models.ManagementPolicy
224
218
  :raises ~azure.core.exceptions.HttpResponseError:
225
219
  """
226
220
  error_map: MutableMapping = {
@@ -234,7 +228,7 @@ class ManagementPoliciesOperations:
234
228
  _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
235
229
  _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
236
230
 
237
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
231
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
238
232
  content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
239
233
  cls: ClsType[_models.ManagementPolicy] = kwargs.pop("cls", None)
240
234
 
@@ -297,8 +291,7 @@ class ManagementPoliciesOperations:
297
291
  :type account_name: str
298
292
  :param management_policy_name: The name of the Storage Account Management Policy. It should
299
293
  always be 'default'. "default" Required.
300
- :type management_policy_name: str or
301
- ~azure.mgmt.storage.v2019_06_01.models.ManagementPolicyName
294
+ :type management_policy_name: str or ~azure.mgmt.storage.models.ManagementPolicyName
302
295
  :return: None or the result of cls(response)
303
296
  :rtype: None
304
297
  :raises ~azure.core.exceptions.HttpResponseError:
@@ -314,7 +307,7 @@ class ManagementPoliciesOperations:
314
307
  _headers = kwargs.pop("headers", {}) or {}
315
308
  _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
316
309
 
317
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
310
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
318
311
  cls: ClsType[None] = kwargs.pop("cls", None)
319
312
 
320
313
  _request = build_delete_request(
@@ -5,10 +5,11 @@
5
5
  # Code generated by Microsoft (R) AutoRest Code Generator.
6
6
  # Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  # --------------------------------------------------------------------------
8
- import sys
9
- from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, Optional, TypeVar, Union, cast
8
+ from collections.abc import MutableMapping
9
+ from typing import Any, AsyncIterator, Callable, Dict, Optional, TypeVar, Union, cast
10
10
  import urllib.parse
11
11
 
12
+ from azure.core import AsyncPipelineClient
12
13
  from azure.core.async_paging import AsyncItemPaged, AsyncList
13
14
  from azure.core.exceptions import (
14
15
  ClientAuthenticationError,
@@ -30,16 +31,14 @@ from azure.mgmt.core.exceptions import ARMErrorFormat
30
31
  from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling
31
32
 
32
33
  from ... import models as _models
34
+ from ..._utils.serialization import Deserializer, Serializer
33
35
  from ...operations._network_security_perimeter_configurations_operations import (
34
36
  build_get_request,
35
37
  build_list_request,
36
38
  build_reconcile_request,
37
39
  )
40
+ from .._configuration import StorageManagementClientConfiguration
38
41
 
39
- if sys.version_info >= (3, 9):
40
- from collections.abc import MutableMapping
41
- else:
42
- from typing import MutableMapping # type: ignore
43
42
  T = TypeVar("T")
44
43
  ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
45
44
 
@@ -50,7 +49,7 @@ class NetworkSecurityPerimeterConfigurationsOperations: # pylint: disable=name-
50
49
  **DO NOT** instantiate this class directly.
51
50
 
52
51
  Instead, you should access the following operations through
53
- :class:`~azure.mgmt.storage.v2024_01_01.aio.StorageManagementClient`'s
52
+ :class:`~azure.mgmt.storage.aio.StorageManagementClient`'s
54
53
  :attr:`network_security_perimeter_configurations` attribute.
55
54
  """
56
55
 
@@ -58,17 +57,15 @@ class NetworkSecurityPerimeterConfigurationsOperations: # pylint: disable=name-
58
57
 
59
58
  def __init__(self, *args, **kwargs) -> None:
60
59
  input_args = list(args)
61
- self._client = input_args.pop(0) if input_args else kwargs.pop("client")
62
- self._config = input_args.pop(0) if input_args else kwargs.pop("config")
63
- self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
64
- self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
65
- self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
60
+ self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client")
61
+ self._config: StorageManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config")
62
+ self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer")
63
+ self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer")
66
64
 
67
65
  @distributed_trace
68
66
  def list(
69
67
  self, resource_group_name: str, account_name: str, **kwargs: Any
70
- ) -> AsyncIterable["_models.NetworkSecurityPerimeterConfiguration"]:
71
- # pylint: disable=line-too-long
68
+ ) -> AsyncItemPaged["_models.NetworkSecurityPerimeterConfiguration"]:
72
69
  """Gets list of effective NetworkSecurityPerimeterConfiguration for storage account.
73
70
 
74
71
  :param resource_group_name: The name of the resource group within the user's subscription. The
@@ -81,13 +78,13 @@ class NetworkSecurityPerimeterConfigurationsOperations: # pylint: disable=name-
81
78
  :return: An iterator like instance of either NetworkSecurityPerimeterConfiguration or the
82
79
  result of cls(response)
83
80
  :rtype:
84
- ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2024_01_01.models.NetworkSecurityPerimeterConfiguration]
81
+ ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.models.NetworkSecurityPerimeterConfiguration]
85
82
  :raises ~azure.core.exceptions.HttpResponseError:
86
83
  """
87
84
  _headers = kwargs.pop("headers", {}) or {}
88
85
  _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
89
86
 
90
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-01-01"))
87
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
91
88
  cls: ClsType[_models.NetworkSecurityPerimeterConfigurationList] = kwargs.pop("cls", None)
92
89
 
93
90
  error_map: MutableMapping = {
@@ -120,7 +117,7 @@ class NetworkSecurityPerimeterConfigurationsOperations: # pylint: disable=name-
120
117
  for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
121
118
  }
122
119
  )
123
- _next_request_params["api-version"] = self._api_version
120
+ _next_request_params["api-version"] = self._config.api_version
124
121
  _request = HttpRequest(
125
122
  "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
126
123
  )
@@ -174,7 +171,7 @@ class NetworkSecurityPerimeterConfigurationsOperations: # pylint: disable=name-
174
171
  configuration. Required.
175
172
  :type network_security_perimeter_configuration_name: str
176
173
  :return: NetworkSecurityPerimeterConfiguration or the result of cls(response)
177
- :rtype: ~azure.mgmt.storage.v2024_01_01.models.NetworkSecurityPerimeterConfiguration
174
+ :rtype: ~azure.mgmt.storage.models.NetworkSecurityPerimeterConfiguration
178
175
  :raises ~azure.core.exceptions.HttpResponseError:
179
176
  """
180
177
  error_map: MutableMapping = {
@@ -188,7 +185,7 @@ class NetworkSecurityPerimeterConfigurationsOperations: # pylint: disable=name-
188
185
  _headers = kwargs.pop("headers", {}) or {}
189
186
  _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
190
187
 
191
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-01-01"))
188
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
192
189
  cls: ClsType[_models.NetworkSecurityPerimeterConfiguration] = kwargs.pop("cls", None)
193
190
 
194
191
  _request = build_get_request(
@@ -239,7 +236,7 @@ class NetworkSecurityPerimeterConfigurationsOperations: # pylint: disable=name-
239
236
  _headers = kwargs.pop("headers", {}) or {}
240
237
  _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
241
238
 
242
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-01-01"))
239
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
243
240
  cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
244
241
 
245
242
  _request = build_reconcile_request(
@@ -307,7 +304,7 @@ class NetworkSecurityPerimeterConfigurationsOperations: # pylint: disable=name-
307
304
  _headers = kwargs.pop("headers", {}) or {}
308
305
  _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
309
306
 
310
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-01-01"))
307
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
311
308
  cls: ClsType[None] = kwargs.pop("cls", None)
312
309
  polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
313
310
  lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
@@ -5,11 +5,12 @@
5
5
  # Code generated by Microsoft (R) AutoRest Code Generator.
6
6
  # Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  # --------------------------------------------------------------------------
8
+ from collections.abc import MutableMapping
8
9
  from io import IOBase
9
- import sys
10
- from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
10
+ from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
11
11
  import urllib.parse
12
12
 
13
+ from azure.core import AsyncPipelineClient
13
14
  from azure.core.async_paging import AsyncItemPaged, AsyncList
14
15
  from azure.core.exceptions import (
15
16
  ClientAuthenticationError,
@@ -27,17 +28,15 @@ from azure.core.utils import case_insensitive_dict
27
28
  from azure.mgmt.core.exceptions import ARMErrorFormat
28
29
 
29
30
  from ... import models as _models
31
+ from ..._utils.serialization import Deserializer, Serializer
30
32
  from ...operations._object_replication_policies_operations import (
31
33
  build_create_or_update_request,
32
34
  build_delete_request,
33
35
  build_get_request,
34
36
  build_list_request,
35
37
  )
38
+ from .._configuration import StorageManagementClientConfiguration
36
39
 
37
- if sys.version_info >= (3, 9):
38
- from collections.abc import MutableMapping
39
- else:
40
- from typing import MutableMapping # type: ignore
41
40
  T = TypeVar("T")
42
41
  ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
43
42
 
@@ -48,7 +47,7 @@ class ObjectReplicationPoliciesOperations:
48
47
  **DO NOT** instantiate this class directly.
49
48
 
50
49
  Instead, you should access the following operations through
51
- :class:`~azure.mgmt.storage.v2024_01_01.aio.StorageManagementClient`'s
50
+ :class:`~azure.mgmt.storage.aio.StorageManagementClient`'s
52
51
  :attr:`object_replication_policies` attribute.
53
52
  """
54
53
 
@@ -56,16 +55,15 @@ class ObjectReplicationPoliciesOperations:
56
55
 
57
56
  def __init__(self, *args, **kwargs) -> None:
58
57
  input_args = list(args)
59
- self._client = input_args.pop(0) if input_args else kwargs.pop("client")
60
- self._config = input_args.pop(0) if input_args else kwargs.pop("config")
61
- self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
62
- self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
63
- self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
58
+ self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client")
59
+ self._config: StorageManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config")
60
+ self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer")
61
+ self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer")
64
62
 
65
63
  @distributed_trace
66
64
  def list(
67
65
  self, resource_group_name: str, account_name: str, **kwargs: Any
68
- ) -> AsyncIterable["_models.ObjectReplicationPolicy"]:
66
+ ) -> AsyncItemPaged["_models.ObjectReplicationPolicy"]:
69
67
  """List the object replication policies associated with the storage account.
70
68
 
71
69
  :param resource_group_name: The name of the resource group within the user's subscription. The
@@ -78,13 +76,13 @@ class ObjectReplicationPoliciesOperations:
78
76
  :return: An iterator like instance of either ObjectReplicationPolicy or the result of
79
77
  cls(response)
80
78
  :rtype:
81
- ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2024_01_01.models.ObjectReplicationPolicy]
79
+ ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.models.ObjectReplicationPolicy]
82
80
  :raises ~azure.core.exceptions.HttpResponseError:
83
81
  """
84
82
  _headers = kwargs.pop("headers", {}) or {}
85
83
  _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
86
84
 
87
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-01-01"))
85
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
88
86
  cls: ClsType[_models.ObjectReplicationPolicies] = kwargs.pop("cls", None)
89
87
 
90
88
  error_map: MutableMapping = {
@@ -117,7 +115,7 @@ class ObjectReplicationPoliciesOperations:
117
115
  for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
118
116
  }
119
117
  )
120
- _next_request_params["api-version"] = self._api_version
118
+ _next_request_params["api-version"] = self._config.api_version
121
119
  _request = HttpRequest(
122
120
  "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
123
121
  )
@@ -169,7 +167,7 @@ class ObjectReplicationPoliciesOperations:
169
167
  destination account. The policy is downloaded as a JSON file. Required.
170
168
  :type object_replication_policy_id: str
171
169
  :return: ObjectReplicationPolicy or the result of cls(response)
172
- :rtype: ~azure.mgmt.storage.v2024_01_01.models.ObjectReplicationPolicy
170
+ :rtype: ~azure.mgmt.storage.models.ObjectReplicationPolicy
173
171
  :raises ~azure.core.exceptions.HttpResponseError:
174
172
  """
175
173
  error_map: MutableMapping = {
@@ -183,7 +181,7 @@ class ObjectReplicationPoliciesOperations:
183
181
  _headers = kwargs.pop("headers", {}) or {}
184
182
  _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
185
183
 
186
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-01-01"))
184
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
187
185
  cls: ClsType[_models.ObjectReplicationPolicy] = kwargs.pop("cls", None)
188
186
 
189
187
  _request = build_get_request(
@@ -243,12 +241,12 @@ class ObjectReplicationPoliciesOperations:
243
241
  :type object_replication_policy_id: str
244
242
  :param properties: The object replication policy set to a storage account. A unique policy ID
245
243
  will be created if absent. Required.
246
- :type properties: ~azure.mgmt.storage.v2024_01_01.models.ObjectReplicationPolicy
244
+ :type properties: ~azure.mgmt.storage.models.ObjectReplicationPolicy
247
245
  :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
248
246
  Default value is "application/json".
249
247
  :paramtype content_type: str
250
248
  :return: ObjectReplicationPolicy or the result of cls(response)
251
- :rtype: ~azure.mgmt.storage.v2024_01_01.models.ObjectReplicationPolicy
249
+ :rtype: ~azure.mgmt.storage.models.ObjectReplicationPolicy
252
250
  :raises ~azure.core.exceptions.HttpResponseError:
253
251
  """
254
252
 
@@ -284,7 +282,7 @@ class ObjectReplicationPoliciesOperations:
284
282
  Default value is "application/json".
285
283
  :paramtype content_type: str
286
284
  :return: ObjectReplicationPolicy or the result of cls(response)
287
- :rtype: ~azure.mgmt.storage.v2024_01_01.models.ObjectReplicationPolicy
285
+ :rtype: ~azure.mgmt.storage.models.ObjectReplicationPolicy
288
286
  :raises ~azure.core.exceptions.HttpResponseError:
289
287
  """
290
288
 
@@ -314,9 +312,9 @@ class ObjectReplicationPoliciesOperations:
314
312
  :param properties: The object replication policy set to a storage account. A unique policy ID
315
313
  will be created if absent. Is either a ObjectReplicationPolicy type or a IO[bytes] type.
316
314
  Required.
317
- :type properties: ~azure.mgmt.storage.v2024_01_01.models.ObjectReplicationPolicy or IO[bytes]
315
+ :type properties: ~azure.mgmt.storage.models.ObjectReplicationPolicy or IO[bytes]
318
316
  :return: ObjectReplicationPolicy or the result of cls(response)
319
- :rtype: ~azure.mgmt.storage.v2024_01_01.models.ObjectReplicationPolicy
317
+ :rtype: ~azure.mgmt.storage.models.ObjectReplicationPolicy
320
318
  :raises ~azure.core.exceptions.HttpResponseError:
321
319
  """
322
320
  error_map: MutableMapping = {
@@ -330,7 +328,7 @@ class ObjectReplicationPoliciesOperations:
330
328
  _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
331
329
  _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
332
330
 
333
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-01-01"))
331
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
334
332
  content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
335
333
  cls: ClsType[_models.ObjectReplicationPolicy] = kwargs.pop("cls", None)
336
334
 
@@ -408,7 +406,7 @@ class ObjectReplicationPoliciesOperations:
408
406
  _headers = kwargs.pop("headers", {}) or {}
409
407
  _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
410
408
 
411
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-01-01"))
409
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
412
410
  cls: ClsType[None] = kwargs.pop("cls", None)
413
411
 
414
412
  _request = build_delete_request(