Skip to content

Commit bac0af0

Browse files
author
SDKAuto
committed
CodeGen from PR 33888 in Azure/azure-rest-api-specs
Merge 44a26a16074593a00f8ba2db62e1bb2e66e0a155 into f11631f1c1057d8363f9e3f9597c73b90f8924c8
1 parent 610a33b commit bac0af0

File tree

131 files changed

+1266
-1166
lines changed

Some content is hidden

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

131 files changed

+1266
-1166
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "1040c6b9bd69bf414c895f7bef87bfd470e90127",
2+
"commit": "dab0c1311176bc9ed796872fe182411ad4d94e3e",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"autorest": "3.10.2",
55
"use": [
6-
"@autorest/python@6.19.0",
6+
"@autorest/python@6.34.1",
77
"@autorest/[email protected]"
88
],
9-
"autorest_command": "autorest specification/batch/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.19.0 --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
9+
"autorest_command": "autorest specification/batch/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.34.1 --use=@autorest/[email protected] --version=3.10.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: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,28 @@
55
# Code generated by Microsoft (R) AutoRest Code Generator.
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
8+
# pylint: disable=wrong-import-position
89

9-
from ._batch_management_client import BatchManagementClient
10+
from typing import TYPE_CHECKING
11+
12+
if TYPE_CHECKING:
13+
from ._patch import * # pylint: disable=unused-wildcard-import
14+
15+
from ._batch_management_client import BatchManagementClient # type: ignore
1016
from ._version import VERSION
1117

1218
__version__ = VERSION
1319

1420
try:
1521
from ._patch import __all__ as _patch_all
16-
from ._patch import * # pylint: disable=unused-wildcard-import
22+
from ._patch import *
1723
except ImportError:
1824
_patch_all = []
1925
from ._patch import patch_sdk as _patch_sdk
2026

2127
__all__ = [
2228
"BatchManagementClient",
2329
]
24-
__all__.extend([p for p in _patch_all if p not in __all__])
30+
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
2531

2632
_patch_sdk()

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

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,19 @@
77
# --------------------------------------------------------------------------
88

99
from copy import deepcopy
10-
from typing import Any, TYPE_CHECKING
10+
from typing import Any, Optional, TYPE_CHECKING, cast
1111
from typing_extensions import Self
1212

1313
from azure.core.pipeline import policies
1414
from azure.core.rest import HttpRequest, HttpResponse
15+
from azure.core.settings import settings
1516
from azure.mgmt.core import ARMPipelineClient
1617
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
18+
from azure.mgmt.core.tools import get_arm_endpoints
1719

1820
from . import models as _models
1921
from ._configuration import BatchManagementClientConfiguration
20-
from ._serialization import Deserializer, Serializer
22+
from ._utils.serialization import Deserializer, Serializer
2123
from .operations import (
2224
ApplicationOperations,
2325
ApplicationPackageOperations,
@@ -32,11 +34,10 @@
3234
)
3335

3436
if TYPE_CHECKING:
35-
# pylint: disable=unused-import,ungrouped-imports
3637
from azure.core.credentials import TokenCredential
3738

3839

39-
class BatchManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
40+
class BatchManagementClient: # pylint: disable=too-many-instance-attributes
4041
"""Batch Client.
4142
4243
:ivar batch_account: BatchAccountOperations operations
@@ -66,7 +67,7 @@ class BatchManagementClient: # pylint: disable=client-accepts-api-version-keywo
6667
:param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g.
6768
00000000-0000-0000-0000-000000000000). Required.
6869
:type subscription_id: str
69-
:param base_url: Service URL. Default value is "https://management.azure.com".
70+
:param base_url: Service URL. Default value is None.
7071
:type base_url: str
7172
:keyword api_version: Api Version. Default value is "2024-07-01". Note that overriding this
7273
default value may result in unsupported behavior.
@@ -76,15 +77,17 @@ class BatchManagementClient: # pylint: disable=client-accepts-api-version-keywo
7677
"""
7778

7879
def __init__(
79-
self,
80-
credential: "TokenCredential",
81-
subscription_id: str,
82-
base_url: str = "https://management.azure.com",
83-
**kwargs: Any
80+
self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any
8481
) -> None:
82+
_cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore
83+
_endpoints = get_arm_endpoints(_cloud)
84+
if not base_url:
85+
base_url = _endpoints["resource_manager"]
86+
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
8587
self._config = BatchManagementClientConfiguration(
86-
credential=credential, subscription_id=subscription_id, **kwargs
88+
credential=credential, subscription_id=subscription_id, credential_scopes=credential_scopes, **kwargs
8789
)
90+
8891
_policies = kwargs.pop("policies", None)
8992
if _policies is None:
9093
_policies = [
@@ -103,7 +106,7 @@ def __init__(
103106
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
104107
self._config.http_logging_policy,
105108
]
106-
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
109+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, base_url), policies=_policies, **kwargs)
107110

108111
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
109112
self._serialize = Serializer(client_models)

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@
1414
from ._version import VERSION
1515

1616
if TYPE_CHECKING:
17-
# pylint: disable=unused-import,ungrouped-imports
1817
from azure.core.credentials import TokenCredential
1918

2019

21-
class BatchManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
20+
class BatchManagementClientConfiguration: # pylint: disable=too-many-instance-attributes
2221
"""Configuration for BatchManagementClient.
2322
2423
Note that all parameters used to create this instance are saved as instance
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# --------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for license information.
4+
# Code generated by Microsoft (R) AutoRest Code Generator.
5+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
6+
# --------------------------------------------------------------------------

0 commit comments

Comments
 (0)