Skip to content

Commit 39a5f34

Browse files
author
SDKAuto
committed
CodeGen from PR 19767 in Azure/azure-rest-api-specs
Merge 59771d3124ba508e680667ac179274ebe89adcd0 into a9e895ccfe29d0646795f7ff1cb78e185bd09529
1 parent 0492dc7 commit 39a5f34

File tree

178 files changed

+11283
-7407
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

178 files changed

+11283
-7407
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"autorest": "3.7.2",
33
"use": [
4-
"@autorest/python@5.13.0",
4+
"@autorest/python@5.16.0",
55
"@autorest/[email protected]"
66
],
7-
"commit": "61001b68a8aa743f0dd890224c6b5cb130ef006e",
7+
"commit": "1c08462d46805748b66366252aff0ffc589b7d5f",
88
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
9-
"autorest_command": "autorest specification/keyvault/resource-manager/readme.md --multiapi --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --python3-only --use=@autorest/python@5.13.0 --use=@autorest/[email protected] --version=3.7.2",
9+
"autorest_command": "autorest specification/keyvault/resource-manager/readme.md --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --python3-only --use=@autorest/python@5.16.0 --use=@autorest/[email protected] --version=3.7.2",
1010
"readme": "specification/keyvault/resource-manager/readme.md"
1111
}

sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2016_10_01/__init__.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,14 @@
1010
from ._version import VERSION
1111

1212
__version__ = VERSION
13+
14+
try:
15+
from ._patch import __all__ as _patch_all
16+
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
17+
except ImportError:
18+
_patch_all = []
19+
from ._patch import patch_sdk as _patch_sdk
1320
__all__ = ['KeyVaultManagementClient']
21+
__all__.extend([p for p in _patch_all if p not in __all__])
1422

15-
# `._patch.py` is used for handwritten extensions to the generated code
16-
# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
17-
from ._patch import patch_sdk
18-
patch_sdk()
23+
_patch_sdk()

sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2016_10_01/_key_vault_management_client.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,12 @@ def __init__(
5858
self._serialize = Serializer(client_models)
5959
self._deserialize = Deserializer(client_models)
6060
self._serialize.client_side_validation = False
61-
self.vaults = VaultsOperations(self._client, self._config, self._serialize, self._deserialize)
62-
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
61+
self.vaults = VaultsOperations(
62+
self._client, self._config, self._serialize, self._deserialize
63+
)
64+
self.operations = Operations(
65+
self._client, self._config, self._serialize, self._deserialize
66+
)
6367

6468

6569
def _send_request(

sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2016_10_01/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
VERSION = "10.0.0"
9+
VERSION = "1.0.0b1"

sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2016_10_01/aio/__init__.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,14 @@
77
# --------------------------------------------------------------------------
88

99
from ._key_vault_management_client import KeyVaultManagementClient
10+
11+
try:
12+
from ._patch import __all__ as _patch_all
13+
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
14+
except ImportError:
15+
_patch_all = []
16+
from ._patch import patch_sdk as _patch_sdk
1017
__all__ = ['KeyVaultManagementClient']
18+
__all__.extend([p for p in _patch_all if p not in __all__])
1119

12-
# `._patch.py` is used for handwritten extensions to the generated code
13-
# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
14-
from ._patch import patch_sdk
15-
patch_sdk()
20+
_patch_sdk()

sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2016_10_01/aio/_key_vault_management_client.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,12 @@ def __init__(
5858
self._serialize = Serializer(client_models)
5959
self._deserialize = Deserializer(client_models)
6060
self._serialize.client_side_validation = False
61-
self.vaults = VaultsOperations(self._client, self._config, self._serialize, self._deserialize)
62-
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
61+
self.vaults = VaultsOperations(
62+
self._client, self._config, self._serialize, self._deserialize
63+
)
64+
self.operations = Operations(
65+
self._client, self._config, self._serialize, self._deserialize
66+
)
6367

6468

6569
def _send_request(

sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2016_10_01/aio/operations/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@
99
from ._vaults_operations import VaultsOperations
1010
from ._operations import Operations
1111

12+
from ._patch import __all__ as _patch_all
13+
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
14+
from ._patch import patch_sdk as _patch_sdk
1215
__all__ = [
1316
'VaultsOperations',
1417
'Operations',
1518
]
19+
__all__.extend([p for p in _patch_all if p not in __all__])
20+
_patch_sdk()

sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2016_10_01/aio/operations/_operations.py

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from azure.core.pipeline.transport import AsyncHttpResponse
1515
from azure.core.rest import HttpRequest
1616
from azure.core.tracing.decorator import distributed_trace
17+
from azure.core.utils import case_insensitive_dict
1718
from azure.mgmt.core.exceptions import ARMErrorFormat
1819

1920
from ... import models as _models
@@ -23,32 +24,30 @@
2324
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
2425

2526
class Operations:
26-
"""Operations async operations.
27-
28-
You should not instantiate this class directly. Instead, you should create a Client instance that
29-
instantiates it for you and attaches it as an attribute.
27+
"""
28+
.. warning::
29+
**DO NOT** instantiate this class directly.
3030
31-
:ivar models: Alias to model classes used in this operation group.
32-
:type models: ~azure.mgmt.keyvault.v2016_10_01.models
33-
:param client: Client for service requests.
34-
:param config: Configuration of service client.
35-
:param serializer: An object model serializer.
36-
:param deserializer: An object model deserializer.
31+
Instead, you should access the following operations through
32+
:class:`~azure.mgmt.keyvault.v2016_10_01.aio.KeyVaultManagementClient`'s
33+
:attr:`operations` attribute.
3734
"""
3835

3936
models = _models
4037

41-
def __init__(self, client, config, serializer, deserializer) -> None:
42-
self._client = client
43-
self._serialize = serializer
44-
self._deserialize = deserializer
45-
self._config = config
38+
def __init__(self, *args, **kwargs) -> None:
39+
input_args = list(args)
40+
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
41+
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
42+
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
43+
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
44+
4645

4746
@distributed_trace
4847
def list(
4948
self,
5049
**kwargs: Any
51-
) -> AsyncIterable["_models.OperationListResult"]:
50+
) -> AsyncIterable[_models.OperationListResult]:
5251
"""Lists all of the available Key Vault Rest API operations.
5352
5453
:keyword callable cls: A custom type or function that will be passed the direct response
@@ -57,31 +56,38 @@ def list(
5756
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.keyvault.v2016_10_01.models.OperationListResult]
5857
:raises: ~azure.core.exceptions.HttpResponseError
5958
"""
60-
api_version = kwargs.pop('api_version', "2016-10-01") # type: str
59+
_headers = kwargs.pop("headers", {}) or {}
60+
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
61+
62+
api_version = kwargs.pop('api_version', _params.pop('api-version', "2016-10-01")) # type: str
63+
cls = kwargs.pop('cls', None) # type: ClsType[_models.OperationListResult]
6164

62-
cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"]
6365
error_map = {
6466
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
6567
}
66-
error_map.update(kwargs.pop('error_map', {}))
68+
error_map.update(kwargs.pop('error_map', {}) or {})
6769
def prepare_request(next_link=None):
6870
if not next_link:
6971

7072
request = build_list_request(
7173
api_version=api_version,
7274
template_url=self.list.metadata['url'],
75+
headers=_headers,
76+
params=_params,
7377
)
7478
request = _convert_request(request)
75-
request.url = self._client.format_url(request.url)
79+
request.url = self._client.format_url(request.url) # type: ignore
7680

7781
else:
7882

7983
request = build_list_request(
8084
api_version=api_version,
8185
template_url=next_link,
86+
headers=_headers,
87+
params=_params,
8288
)
8389
request = _convert_request(request)
84-
request.url = self._client.format_url(request.url)
90+
request.url = self._client.format_url(request.url) # type: ignore
8591
request.method = "GET"
8692
return request
8793

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# ------------------------------------
2+
# Copyright (c) Microsoft Corporation.
3+
# Licensed under the MIT License.
4+
# ------------------------------------
5+
"""Customize generated code here.
6+
7+
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
8+
"""
9+
from typing import List
10+
11+
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
12+
13+
def patch_sdk():
14+
"""Do not remove from this file.
15+
16+
`patch_sdk` is a last resort escape hatch that allows you to do customizations
17+
you can't accomplish using the techniques described in
18+
https://aka.ms/azsdk/python/dpcodegen/python/customize
19+
"""

0 commit comments

Comments
 (0)