Skip to content

Commit c1f0b60

Browse files
author
SDKAuto
committed
CodeGen from PR 33749 in Azure/azure-rest-api-specs
Merge 2588cfd0a922d578b30a2a86ccd80f6b6ede58e0 into e6f0bc6d77a1a4f7e7ababb4a7c42356551e95f0
1 parent 1d83aaf commit c1f0b60

File tree

349 files changed

+3142
-2996
lines changed

Some content is hidden

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

349 files changed

+3142
-2996
lines changed

sdk/billing/azure-mgmt-billing/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Microsoft Azure SDK for Python
22

33
This is the Microsoft Azure Billing Client Library.
4-
This package has been tested with Python 3.8+.
4+
This package has been tested with Python 3.9+.
55
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
66

77
## _Disclaimer_
@@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For
1212

1313
### Prerequisites
1414

15-
- Python 3.8+ is required to use this package.
15+
- Python 3.9+ is required to use this package.
1616
- [Azure subscription](https://azure.microsoft.com/free/)
1717

1818
### Install the package
@@ -24,7 +24,7 @@ pip install azure-identity
2424

2525
### Authentication
2626

27-
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables.
27+
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables.
2828

2929
- `AZURE_CLIENT_ID` for Azure client ID.
3030
- `AZURE_TENANT_ID` for Azure tenant ID.
+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "e79d9ef3e065f2dcb6bd1db51e29c62a99dff5cb",
2+
"commit": "0e08e4bd888f8a73ed3b45694e177031178c05ea",
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.33.0",
77
"@autorest/[email protected]"
88
],
9-
"autorest_command": "autorest specification/billing/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/billing/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.33.0 --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
1010
"readme": "specification/billing/resource-manager/readme.md"
1111
}

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

+9-3
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 ._billing_management_client import BillingManagementClient
10+
from typing import TYPE_CHECKING
11+
12+
if TYPE_CHECKING:
13+
from ._patch import * # pylint: disable=unused-wildcard-import
14+
15+
from ._billing_management_client import BillingManagementClient # 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
"BillingManagementClient",
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/billing/azure-mgmt-billing/azure/mgmt/billing/_billing_management_client.py

+14-11
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@
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 BillingManagementClientConfiguration
@@ -52,11 +54,10 @@
5254
)
5355

5456
if TYPE_CHECKING:
55-
# pylint: disable=unused-import,ungrouped-imports
5657
from azure.core.credentials import TokenCredential
5758

5859

59-
class BillingManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
60+
class BillingManagementClient: # pylint: disable=too-many-instance-attributes
6061
"""Billing Client.
6162
6263
:ivar agreements: AgreementsOperations operations
@@ -125,7 +126,7 @@ class BillingManagementClient: # pylint: disable=client-accepts-api-version-key
125126
:type credential: ~azure.core.credentials.TokenCredential
126127
:param subscription_id: The ID that uniquely identifies a billing subscription. Required.
127128
:type subscription_id: str
128-
:param base_url: Service URL. Default value is "https://management.azure.com".
129+
:param base_url: Service URL. Default value is None.
129130
:type base_url: str
130131
:keyword api_version: Api Version. Default value is "2024-04-01". Note that overriding this
131132
default value may result in unsupported behavior.
@@ -135,15 +136,17 @@ class BillingManagementClient: # pylint: disable=client-accepts-api-version-key
135136
"""
136137

137138
def __init__(
138-
self,
139-
credential: "TokenCredential",
140-
subscription_id: str,
141-
base_url: str = "https://management.azure.com",
142-
**kwargs: Any
139+
self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any
143140
) -> None:
141+
_cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore
142+
_endpoints = get_arm_endpoints(_cloud)
143+
if not base_url:
144+
base_url = _endpoints["resource_manager"]
145+
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
144146
self._config = BillingManagementClientConfiguration(
145-
credential=credential, subscription_id=subscription_id, **kwargs
147+
credential=credential, subscription_id=subscription_id, credential_scopes=credential_scopes, **kwargs
146148
)
149+
147150
_policies = kwargs.pop("policies", None)
148151
if _policies is None:
149152
_policies = [
@@ -162,7 +165,7 @@ def __init__(
162165
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
163166
self._config.http_logging_policy,
164167
]
165-
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
168+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, base_url), policies=_policies, **kwargs)
166169

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

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

+1-2
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 BillingManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
20+
class BillingManagementClientConfiguration: # pylint: disable=too-many-instance-attributes
2221
"""Configuration for BillingManagementClient.
2322
2423
Note that all parameters used to create this instance are saved as instance

0 commit comments

Comments
 (0)