Skip to content

Commit 4dff9e5

Browse files
author
SDKAuto
committed
CodeGen from PR 33189 in Azure/azure-rest-api-specs
Merge 6ce6090e16e07e0dc94ad2d5d81a59ede4f9c594 into b0098174d940a48253d511e5dad21e1b635e830a
1 parent e9cb15e commit 4dff9e5

File tree

303 files changed

+18770
-3356
lines changed

Some content is hidden

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

303 files changed

+18770
-3356
lines changed

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

Lines changed: 2 additions & 5 deletions
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 Cost Management Client Library.
4-
This package has been tested with Python 3.7+.
4+
This package has been tested with Python 3.8+.
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.7+ is required to use this package.
15+
- Python 3.8+ is required to use this package.
1616
- [Azure subscription](https://azure.microsoft.com/free/)
1717

1818
### Install the package
@@ -55,6 +55,3 @@ Code samples for this package can be found at:
5555
If you encounter any bugs or have suggestions, please file an issue in the
5656
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
5757
section of the project.
58-
59-
60-
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "493aa7224fd65fe1e5b4cff59bcae5c6cdf4525e",
2+
"commit": "2a4fd9d3de116b0f01cc7aed4d4b28aceda71dea",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4-
"autorest": "3.9.2",
4+
"autorest": "3.10.2",
55
"use": [
6-
"@autorest/python@6.6.0",
7-
"@autorest/modelerfour@4.24.3"
6+
"@autorest/python@6.27.4",
7+
"@autorest/modelerfour@4.27.0"
88
],
9-
"autorest_command": "autorest specification/cost-management/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --tag=package-2022-10 --use=@autorest/python@6.6.0 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
9+
"autorest_command": "autorest specification/cost-management/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.27.4 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False",
1010
"readme": "specification/cost-management/resource-manager/readme.md"
1111
}

sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/__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 ._cost_management_client import CostManagementClient
10+
from typing import TYPE_CHECKING
11+
12+
if TYPE_CHECKING:
13+
from ._patch import * # pylint: disable=unused-wildcard-import
14+
15+
from ._cost_management_client import CostManagementClient # 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
"CostManagementClient",
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/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_configuration.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,30 @@
88

99
from typing import Any, TYPE_CHECKING
1010

11-
from azure.core.configuration import Configuration
1211
from azure.core.pipeline import policies
1312
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
1413

1514
from ._version import VERSION
1615

1716
if TYPE_CHECKING:
18-
# pylint: disable=unused-import,ungrouped-imports
1917
from azure.core.credentials import TokenCredential
2018

2119

22-
class CostManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
20+
class CostManagementClientConfiguration: # pylint: disable=too-many-instance-attributes
2321
"""Configuration for CostManagementClient.
2422
2523
Note that all parameters used to create this instance are saved as instance
2624
attributes.
2725
2826
:param credential: Credential needed for the client to connect to Azure. Required.
2927
:type credential: ~azure.core.credentials.TokenCredential
30-
:keyword api_version: Api Version. Default value is "2022-10-01". Note that overriding this
28+
:keyword api_version: Api Version. Default value is "2025-03-01". Note that overriding this
3129
default value may result in unsupported behavior.
3230
:paramtype api_version: str
3331
"""
3432

3533
def __init__(self, credential: "TokenCredential", **kwargs: Any) -> None:
36-
super(CostManagementClientConfiguration, self).__init__(**kwargs)
37-
api_version: str = kwargs.pop("api_version", "2022-10-01")
34+
api_version: str = kwargs.pop("api_version", "2025-03-01")
3835

3936
if credential is None:
4037
raise ValueError("Parameter 'credential' must not be None.")
@@ -43,6 +40,7 @@ def __init__(self, credential: "TokenCredential", **kwargs: Any) -> None:
4340
self.api_version = api_version
4441
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
4542
kwargs.setdefault("sdk_moniker", "mgmt-costmanagement/{}".format(VERSION))
43+
self.polling_interval = kwargs.get("polling_interval", 30)
4644
self._configure(**kwargs)
4745

4846
def _configure(self, **kwargs: Any) -> None:
@@ -51,9 +49,9 @@ def _configure(self, **kwargs: Any) -> None:
5149
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
5250
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
5351
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
54-
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
5552
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
5653
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
54+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
5755
self.authentication_policy = kwargs.get("authentication_policy")
5856
if self.credential and not self.authentication_policy:
5957
self.authentication_policy = ARMChallengeAuthenticationPolicy(

sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_cost_management_client.py

Lines changed: 82 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@
88

99
from copy import deepcopy
1010
from typing import Any, TYPE_CHECKING
11+
from typing_extensions import Self
1112

13+
from azure.core.pipeline import policies
1214
from azure.core.rest import HttpRequest, HttpResponse
1315
from azure.mgmt.core import ARMPipelineClient
16+
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
1417

1518
from . import models as _models
1619
from ._configuration import CostManagementClientConfiguration
@@ -19,9 +22,12 @@
1922
AlertsOperations,
2023
BenefitRecommendationsOperations,
2124
BenefitUtilizationSummariesOperations,
25+
BudgetsOperations,
26+
CostAllocationRulesOperations,
2227
DimensionsOperations,
2328
ExportsOperations,
2429
ForecastOperations,
30+
GenerateBenefitUtilizationSummariesReportOperations,
2531
GenerateCostDetailsReportOperations,
2632
GenerateDetailedCostReportOperationResultsOperations,
2733
GenerateDetailedCostReportOperationStatusOperations,
@@ -31,34 +37,35 @@
3137
PriceSheetOperations,
3238
QueryOperations,
3339
ScheduledActionsOperations,
40+
SettingsOperations,
3441
ViewsOperations,
3542
)
3643

3744
if TYPE_CHECKING:
38-
# pylint: disable=unused-import,ungrouped-imports
3945
from azure.core.credentials import TokenCredential
4046

4147

42-
class CostManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
48+
class CostManagementClient: # pylint: disable=too-many-instance-attributes
4349
"""CostManagement management client provides access to CostManagement resources for Azure
4450
Enterprise Subscriptions.
4551
4652
:ivar operations: Operations operations
4753
:vartype operations: azure.mgmt.costmanagement.operations.Operations
48-
:ivar views: ViewsOperations operations
49-
:vartype views: azure.mgmt.costmanagement.operations.ViewsOperations
50-
:ivar alerts: AlertsOperations operations
51-
:vartype alerts: azure.mgmt.costmanagement.operations.AlertsOperations
52-
:ivar forecast: ForecastOperations operations
53-
:vartype forecast: azure.mgmt.costmanagement.operations.ForecastOperations
54-
:ivar dimensions: DimensionsOperations operations
55-
:vartype dimensions: azure.mgmt.costmanagement.operations.DimensionsOperations
56-
:ivar query: QueryOperations operations
57-
:vartype query: azure.mgmt.costmanagement.operations.QueryOperations
58-
:ivar generate_reservation_details_report: GenerateReservationDetailsReportOperations
59-
operations
60-
:vartype generate_reservation_details_report:
61-
azure.mgmt.costmanagement.operations.GenerateReservationDetailsReportOperations
54+
:ivar cost_allocation_rules: CostAllocationRulesOperations operations
55+
:vartype cost_allocation_rules:
56+
azure.mgmt.costmanagement.operations.CostAllocationRulesOperations
57+
:ivar benefit_recommendations: BenefitRecommendationsOperations operations
58+
:vartype benefit_recommendations:
59+
azure.mgmt.costmanagement.operations.BenefitRecommendationsOperations
60+
:ivar benefit_utilization_summaries: BenefitUtilizationSummariesOperations operations
61+
:vartype benefit_utilization_summaries:
62+
azure.mgmt.costmanagement.operations.BenefitUtilizationSummariesOperations
63+
:ivar generate_benefit_utilization_summaries_report:
64+
GenerateBenefitUtilizationSummariesReportOperations operations
65+
:vartype generate_benefit_utilization_summaries_report:
66+
azure.mgmt.costmanagement.operations.GenerateBenefitUtilizationSummariesReportOperations
67+
:ivar budgets: BudgetsOperations operations
68+
:vartype budgets: azure.mgmt.costmanagement.operations.BudgetsOperations
6269
:ivar exports: ExportsOperations operations
6370
:vartype exports: azure.mgmt.costmanagement.operations.ExportsOperations
6471
:ivar generate_cost_details_report: GenerateCostDetailsReportOperations operations
@@ -75,21 +82,31 @@ class CostManagementClient: # pylint: disable=client-accepts-api-version-keywor
7582
GenerateDetailedCostReportOperationStatusOperations operations
7683
:vartype generate_detailed_cost_report_operation_status:
7784
azure.mgmt.costmanagement.operations.GenerateDetailedCostReportOperationStatusOperations
85+
:ivar views: ViewsOperations operations
86+
:vartype views: azure.mgmt.costmanagement.operations.ViewsOperations
87+
:ivar alerts: AlertsOperations operations
88+
:vartype alerts: azure.mgmt.costmanagement.operations.AlertsOperations
89+
:ivar forecast: ForecastOperations operations
90+
:vartype forecast: azure.mgmt.costmanagement.operations.ForecastOperations
91+
:ivar dimensions: DimensionsOperations operations
92+
:vartype dimensions: azure.mgmt.costmanagement.operations.DimensionsOperations
93+
:ivar query: QueryOperations operations
94+
:vartype query: azure.mgmt.costmanagement.operations.QueryOperations
95+
:ivar generate_reservation_details_report: GenerateReservationDetailsReportOperations
96+
operations
97+
:vartype generate_reservation_details_report:
98+
azure.mgmt.costmanagement.operations.GenerateReservationDetailsReportOperations
7899
:ivar price_sheet: PriceSheetOperations operations
79100
:vartype price_sheet: azure.mgmt.costmanagement.operations.PriceSheetOperations
80101
:ivar scheduled_actions: ScheduledActionsOperations operations
81102
:vartype scheduled_actions: azure.mgmt.costmanagement.operations.ScheduledActionsOperations
82-
:ivar benefit_recommendations: BenefitRecommendationsOperations operations
83-
:vartype benefit_recommendations:
84-
azure.mgmt.costmanagement.operations.BenefitRecommendationsOperations
85-
:ivar benefit_utilization_summaries: BenefitUtilizationSummariesOperations operations
86-
:vartype benefit_utilization_summaries:
87-
azure.mgmt.costmanagement.operations.BenefitUtilizationSummariesOperations
103+
:ivar settings: SettingsOperations operations
104+
:vartype settings: azure.mgmt.costmanagement.operations.SettingsOperations
88105
:param credential: Credential needed for the client to connect to Azure. Required.
89106
:type credential: ~azure.core.credentials.TokenCredential
90107
:param base_url: Service URL. Default value is "https://management.azure.com".
91108
:type base_url: str
92-
:keyword api_version: Api Version. Default value is "2022-10-01". Note that overriding this
109+
:keyword api_version: Api Version. Default value is "2025-03-01". Note that overriding this
93110
default value may result in unsupported behavior.
94111
:paramtype api_version: str
95112
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
@@ -100,21 +117,44 @@ def __init__(
100117
self, credential: "TokenCredential", base_url: str = "https://management.azure.com", **kwargs: Any
101118
) -> None:
102119
self._config = CostManagementClientConfiguration(credential=credential, **kwargs)
103-
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
120+
_policies = kwargs.pop("policies", None)
121+
if _policies is None:
122+
_policies = [
123+
policies.RequestIdPolicy(**kwargs),
124+
self._config.headers_policy,
125+
self._config.user_agent_policy,
126+
self._config.proxy_policy,
127+
policies.ContentDecodePolicy(**kwargs),
128+
ARMAutoResourceProviderRegistrationPolicy(),
129+
self._config.redirect_policy,
130+
self._config.retry_policy,
131+
self._config.authentication_policy,
132+
self._config.custom_hook_policy,
133+
self._config.logging_policy,
134+
policies.DistributedTracingPolicy(**kwargs),
135+
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
136+
self._config.http_logging_policy,
137+
]
138+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
104139

105140
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
106141
self._serialize = Serializer(client_models)
107142
self._deserialize = Deserializer(client_models)
108143
self._serialize.client_side_validation = False
109144
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
110-
self.views = ViewsOperations(self._client, self._config, self._serialize, self._deserialize)
111-
self.alerts = AlertsOperations(self._client, self._config, self._serialize, self._deserialize)
112-
self.forecast = ForecastOperations(self._client, self._config, self._serialize, self._deserialize)
113-
self.dimensions = DimensionsOperations(self._client, self._config, self._serialize, self._deserialize)
114-
self.query = QueryOperations(self._client, self._config, self._serialize, self._deserialize)
115-
self.generate_reservation_details_report = GenerateReservationDetailsReportOperations(
145+
self.cost_allocation_rules = CostAllocationRulesOperations(
146+
self._client, self._config, self._serialize, self._deserialize
147+
)
148+
self.benefit_recommendations = BenefitRecommendationsOperations(
149+
self._client, self._config, self._serialize, self._deserialize
150+
)
151+
self.benefit_utilization_summaries = BenefitUtilizationSummariesOperations(
152+
self._client, self._config, self._serialize, self._deserialize
153+
)
154+
self.generate_benefit_utilization_summaries_report = GenerateBenefitUtilizationSummariesReportOperations(
116155
self._client, self._config, self._serialize, self._deserialize
117156
)
157+
self.budgets = BudgetsOperations(self._client, self._config, self._serialize, self._deserialize)
118158
self.exports = ExportsOperations(self._client, self._config, self._serialize, self._deserialize)
119159
self.generate_cost_details_report = GenerateCostDetailsReportOperations(
120160
self._client, self._config, self._serialize, self._deserialize
@@ -128,18 +168,21 @@ def __init__(
128168
self.generate_detailed_cost_report_operation_status = GenerateDetailedCostReportOperationStatusOperations(
129169
self._client, self._config, self._serialize, self._deserialize
130170
)
131-
self.price_sheet = PriceSheetOperations(self._client, self._config, self._serialize, self._deserialize)
132-
self.scheduled_actions = ScheduledActionsOperations(
133-
self._client, self._config, self._serialize, self._deserialize
134-
)
135-
self.benefit_recommendations = BenefitRecommendationsOperations(
171+
self.views = ViewsOperations(self._client, self._config, self._serialize, self._deserialize)
172+
self.alerts = AlertsOperations(self._client, self._config, self._serialize, self._deserialize)
173+
self.forecast = ForecastOperations(self._client, self._config, self._serialize, self._deserialize)
174+
self.dimensions = DimensionsOperations(self._client, self._config, self._serialize, self._deserialize)
175+
self.query = QueryOperations(self._client, self._config, self._serialize, self._deserialize)
176+
self.generate_reservation_details_report = GenerateReservationDetailsReportOperations(
136177
self._client, self._config, self._serialize, self._deserialize
137178
)
138-
self.benefit_utilization_summaries = BenefitUtilizationSummariesOperations(
179+
self.price_sheet = PriceSheetOperations(self._client, self._config, self._serialize, self._deserialize)
180+
self.scheduled_actions = ScheduledActionsOperations(
139181
self._client, self._config, self._serialize, self._deserialize
140182
)
183+
self.settings = SettingsOperations(self._client, self._config, self._serialize, self._deserialize)
141184

142-
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
185+
def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
143186
"""Runs the network request through the client's chained policies.
144187
145188
>>> from azure.core.rest import HttpRequest
@@ -159,12 +202,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
159202

160203
request_copy = deepcopy(request)
161204
request_copy.url = self._client.format_url(request_copy.url)
162-
return self._client.send_request(request_copy, **kwargs)
205+
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
163206

164207
def close(self) -> None:
165208
self._client.close()
166209

167-
def __enter__(self) -> "CostManagementClient":
210+
def __enter__(self) -> Self:
168211
self._client.__enter__()
169212
return self
170213

0 commit comments

Comments
 (0)