Skip to content

Commit 96f9fd0

Browse files
author
SDKAuto
committed
CodeGen from PR 21195 in Azure/azure-rest-api-specs
Merge 2ae788a497bf8bfc263505b4a032803545a77c06 into 21826324d0c76ef0309fe7761eaa34d4da174359
1 parent 1735d85 commit 96f9fd0

39 files changed

+10800
-6267
lines changed
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"autorest": "3.7.2",
2+
"commit": "ba016d497dcd3b6fa568bb318f19da16303adb4e",
3+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4+
"autorest": "3.9.2",
35
"use": [
4-
"@autorest/python@5.13.0",
5-
"@autorest/modelerfour@4.19.3"
6+
"@autorest/python@6.1.11",
7+
"@autorest/modelerfour@4.24.3"
68
],
7-
"commit": "5ee062ac3cc2df298ff47bdfc7792d257fd85bb8",
8-
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
9-
"autorest_command": "autorest specification/batch/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/modelerfour@4.19.3 --version=3.7.2",
9+
"autorest_command": "autorest specification/batch/resource-manager/readme.md --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.1.11 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
1010
"readme": "specification/batch/resource-manager/readme.md"
1111
}

sdk/batch/azure-mgmt-batch/azure/mgmt/batch/__init__.py

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

1212
__version__ = VERSION
13-
__all__ = ['BatchManagementClient']
1413

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()
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
20+
21+
__all__ = ["BatchManagementClient"]
22+
__all__.extend([p for p in _patch_all if p not in __all__])
23+
24+
_patch_sdk()

sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_batch_management_client.py

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,30 @@
99
from copy import deepcopy
1010
from typing import Any, TYPE_CHECKING
1111

12-
from msrest import Deserializer, Serializer
13-
1412
from azure.core.rest import HttpRequest, HttpResponse
1513
from azure.mgmt.core import ARMPipelineClient
1614

1715
from . import models
1816
from ._configuration import BatchManagementClientConfiguration
19-
from .operations import ApplicationOperations, ApplicationPackageOperations, BatchAccountOperations, CertificateOperations, LocationOperations, Operations, PoolOperations, PrivateEndpointConnectionOperations, PrivateLinkResourceOperations
17+
from ._serialization import Deserializer, Serializer
18+
from .operations import (
19+
ApplicationOperations,
20+
ApplicationPackageOperations,
21+
BatchAccountOperations,
22+
CertificateOperations,
23+
LocationOperations,
24+
Operations,
25+
PoolOperations,
26+
PrivateEndpointConnectionOperations,
27+
PrivateLinkResourceOperations,
28+
)
2029

2130
if TYPE_CHECKING:
2231
# pylint: disable=unused-import,ungrouped-imports
2332
from azure.core.credentials import TokenCredential
2433

25-
class BatchManagementClient: # pylint: disable=too-many-instance-attributes
34+
35+
class BatchManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
2636
"""Batch Client.
2737
2838
:ivar batch_account: BatchAccountOperations operations
@@ -44,14 +54,14 @@ class BatchManagementClient: # pylint: disable=too-many-instance-attributes
4454
azure.mgmt.batch.operations.PrivateEndpointConnectionOperations
4555
:ivar pool: PoolOperations operations
4656
:vartype pool: azure.mgmt.batch.operations.PoolOperations
47-
:param credential: Credential needed for the client to connect to Azure.
57+
:param credential: Credential needed for the client to connect to Azure. Required.
4858
:type credential: ~azure.core.credentials.TokenCredential
4959
:param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g.
50-
00000000-0000-0000-0000-000000000000).
60+
00000000-0000-0000-0000-000000000000). Required.
5161
:type subscription_id: str
5262
:param base_url: Service URL. Default value is "https://management.azure.com".
5363
:type base_url: str
54-
:keyword api_version: Api Version. Default value is "2022-06-01". Note that overriding this
64+
:keyword api_version: Api Version. Default value is "2022-10-01". Note that overriding this
5565
default value may result in unsupported behavior.
5666
:paramtype api_version: str
5767
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
@@ -65,29 +75,32 @@ def __init__(
6575
base_url: str = "https://management.azure.com",
6676
**kwargs: Any
6777
) -> None:
68-
self._config = BatchManagementClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs)
78+
self._config = BatchManagementClientConfiguration(
79+
credential=credential, subscription_id=subscription_id, **kwargs
80+
)
6981
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
7082

7183
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
7284
self._serialize = Serializer(client_models)
7385
self._deserialize = Deserializer(client_models)
7486
self._serialize.client_side_validation = False
7587
self.batch_account = BatchAccountOperations(self._client, self._config, self._serialize, self._deserialize)
76-
self.application_package = ApplicationPackageOperations(self._client, self._config, self._serialize, self._deserialize)
88+
self.application_package = ApplicationPackageOperations(
89+
self._client, self._config, self._serialize, self._deserialize
90+
)
7791
self.application = ApplicationOperations(self._client, self._config, self._serialize, self._deserialize)
7892
self.location = LocationOperations(self._client, self._config, self._serialize, self._deserialize)
7993
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
8094
self.certificate = CertificateOperations(self._client, self._config, self._serialize, self._deserialize)
81-
self.private_link_resource = PrivateLinkResourceOperations(self._client, self._config, self._serialize, self._deserialize)
82-
self.private_endpoint_connection = PrivateEndpointConnectionOperations(self._client, self._config, self._serialize, self._deserialize)
95+
self.private_link_resource = PrivateLinkResourceOperations(
96+
self._client, self._config, self._serialize, self._deserialize
97+
)
98+
self.private_endpoint_connection = PrivateEndpointConnectionOperations(
99+
self._client, self._config, self._serialize, self._deserialize
100+
)
83101
self.pool = PoolOperations(self._client, self._config, self._serialize, self._deserialize)
84102

85-
86-
def _send_request(
87-
self,
88-
request: HttpRequest,
89-
**kwargs: Any
90-
) -> HttpResponse:
103+
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
91104
"""Runs the network request through the client's chained policies.
92105
93106
>>> from azure.core.rest import HttpRequest
@@ -96,7 +109,7 @@ def _send_request(
96109
>>> response = client._send_request(request)
97110
<HttpResponse: 200 OK>
98111
99-
For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
112+
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
100113
101114
:param request: The network request you want to make. Required.
102115
:type request: ~azure.core.rest.HttpRequest

sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_configuration.py

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,19 @@ class BatchManagementClientConfiguration(Configuration): # pylint: disable=too-
2525
Note that all parameters used to create this instance are saved as instance
2626
attributes.
2727
28-
:param credential: Credential needed for the client to connect to Azure.
28+
:param credential: Credential needed for the client to connect to Azure. Required.
2929
:type credential: ~azure.core.credentials.TokenCredential
3030
:param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g.
31-
00000000-0000-0000-0000-000000000000).
31+
00000000-0000-0000-0000-000000000000). Required.
3232
:type subscription_id: str
33-
:keyword api_version: Api Version. Default value is "2022-06-01". Note that overriding this
33+
:keyword api_version: Api Version. Default value is "2022-10-01". Note that overriding this
3434
default value may result in unsupported behavior.
3535
:paramtype api_version: str
3636
"""
3737

38-
def __init__(
39-
self,
40-
credential: "TokenCredential",
41-
subscription_id: str,
42-
**kwargs: Any
43-
) -> None:
38+
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
4439
super(BatchManagementClientConfiguration, self).__init__(**kwargs)
45-
api_version = kwargs.pop('api_version', "2022-06-01") # type: str
40+
api_version = kwargs.pop("api_version", "2022-10-01") # type: str
4641

4742
if credential is None:
4843
raise ValueError("Parameter 'credential' must not be None.")
@@ -52,23 +47,24 @@ def __init__(
5247
self.credential = credential
5348
self.subscription_id = subscription_id
5449
self.api_version = api_version
55-
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
56-
kwargs.setdefault('sdk_moniker', 'mgmt-batch/{}'.format(VERSION))
50+
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
51+
kwargs.setdefault("sdk_moniker", "mgmt-batch/{}".format(VERSION))
5752
self._configure(**kwargs)
5853

5954
def _configure(
60-
self,
61-
**kwargs # type: Any
55+
self, **kwargs # type: Any
6256
):
6357
# type: (...) -> None
64-
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
65-
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
66-
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
67-
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
68-
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
69-
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
70-
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
71-
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
72-
self.authentication_policy = kwargs.get('authentication_policy')
58+
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
59+
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
60+
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
61+
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
62+
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
63+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
64+
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
65+
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
66+
self.authentication_policy = kwargs.get("authentication_policy")
7367
if self.credential and not self.authentication_policy:
74-
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
68+
self.authentication_policy = ARMChallengeAuthenticationPolicy(
69+
self.credential, *self.credential_scopes, **kwargs
70+
)

sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_metadata.json

Lines changed: 0 additions & 110 deletions
This file was deleted.

sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_patch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@
2828
# This file is used for handwritten extensions to the generated code. Example:
2929
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
3030
def patch_sdk():
31-
pass
31+
pass

0 commit comments

Comments
 (0)