Skip to content

Commit c46d548

Browse files
author
SDKAuto
committed
CodeGen from PR 13039 in Azure/azure-rest-api-specs
Merge 96b8123aab536028980b8969df64408c64109d9e into 45c7ae9
1 parent 2e8ff8c commit c46d548

18 files changed

+513
-68
lines changed

sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/_consumption_management_client.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ def __init__(
100100

101101
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
102102
self._serialize = Serializer(client_models)
103-
self._serialize.client_side_validation = False
104103
self._deserialize = Deserializer(client_models)
105104

106105
self.usage_details = UsageDetailsOperations(
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
{
2+
"chosen_version": "2019-10-01",
3+
"total_api_version_list": ["2019-10-01"],
4+
"client": {
5+
"name": "ConsumptionManagementClient",
6+
"filename": "_consumption_management_client",
7+
"description": "Consumption management client provides access to consumption resources for Azure Enterprise Subscriptions.",
8+
"base_url": "\u0027https://management.azure.com\u0027",
9+
"custom_base_url": null,
10+
"azure_arm": true,
11+
"has_lro_operations": false,
12+
"client_side_validation": true
13+
},
14+
"global_parameters": {
15+
"sync": {
16+
"credential": {
17+
"signature": "credential, # type: \"TokenCredential\"",
18+
"description": "Credential needed for the client to connect to Azure.",
19+
"docstring_type": "~azure.core.credentials.TokenCredential",
20+
"required": true
21+
},
22+
"subscription_id": {
23+
"signature": "subscription_id, # type: str",
24+
"description": "Azure Subscription ID.",
25+
"docstring_type": "str",
26+
"required": true
27+
}
28+
},
29+
"async": {
30+
"credential": {
31+
"signature": "credential, # type: \"AsyncTokenCredential\"",
32+
"description": "Credential needed for the client to connect to Azure.",
33+
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
34+
"required": true
35+
},
36+
"subscription_id": {
37+
"signature": "subscription_id, # type: str",
38+
"description": "Azure Subscription ID.",
39+
"docstring_type": "str",
40+
"required": true
41+
}
42+
},
43+
"constant": {
44+
},
45+
"call": "credential, subscription_id"
46+
},
47+
"config": {
48+
"credential": true,
49+
"credential_scopes": ["https://management.azure.com/.default"],
50+
"credential_default_policy_type": "BearerTokenCredentialPolicy",
51+
"credential_default_policy_type_has_async_version": true,
52+
"credential_key_header_name": null
53+
},
54+
"operation_groups": {
55+
"usage_details": "UsageDetailsOperations",
56+
"marketplaces": "MarketplacesOperations",
57+
"budgets": "BudgetsOperations",
58+
"tags": "TagsOperations",
59+
"charges": "ChargesOperations",
60+
"balances": "BalancesOperations",
61+
"reservations_summaries": "ReservationsSummariesOperations",
62+
"reservations_details": "ReservationsDetailsOperations",
63+
"reservation_recommendations": "ReservationRecommendationsOperations",
64+
"reservation_recommendation_details": "ReservationRecommendationDetailsOperations",
65+
"reservation_transactions": "ReservationTransactionsOperations",
66+
"price_sheet": "PriceSheetOperations",
67+
"forecasts": "ForecastsOperations",
68+
"operations": "Operations",
69+
"aggregated_cost": "AggregatedCostOperations",
70+
"events": "EventsOperations",
71+
"lots": "LotsOperations",
72+
"credits": "CreditsOperations"
73+
},
74+
"operation_mixins": {
75+
},
76+
"sync_imports": "None",
77+
"async_imports": "None"
78+
}

sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/_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 = "8.0.0"
9+
VERSION = "2.0.0"

sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/_consumption_management_client.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ def __init__(
9797

9898
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
9999
self._serialize = Serializer(client_models)
100-
self._serialize.client_side_validation = False
101100
self._deserialize = Deserializer(client_models)
102101

103102
self.usage_details = UsageDetailsOperations(

sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_aggregated_cost_operations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,4 +160,4 @@ async def get_for_billing_period_by_management_group(
160160
return cls(pipeline_response, deserialized, {})
161161

162162
return deserialized
163-
get_for_billing_period_by_management_group.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/Microsoft.Consumption/aggregatedcost'} # type: ignore
163+
get_for_billing_period_by_management_group.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/Microsoft.Consumption/aggregatedCost'} # type: ignore

sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_budgets_operations.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,9 @@ async def create_or_update(
202202
parameters: "_models.Budget",
203203
**kwargs
204204
) -> "_models.Budget":
205-
"""The operation to create or update a budget. Update operation requires latest eTag to be set in
206-
the request mandatorily. You may obtain the latest eTag by performing a get operation. Create
207-
operation does not require eTag.
205+
"""The operation to create or update a budget. You can optionally provide an eTag if desired as a
206+
form of concurrency control. To obtain the latest eTag for a given budget, perform a get
207+
operation prior to your put operation.
208208
209209
:param scope: The scope associated with budget operations. This includes
210210
'/subscriptions/{subscriptionId}/' for subscription scope,

sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_forecasts_operations.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ def list(
4646
filter: Optional[str] = None,
4747
**kwargs
4848
) -> AsyncIterable["_models.ForecastsListResult"]:
49-
"""Lists the forecast charges by subscriptionId.
49+
"""Lists the forecast charges for scope defined. Please note that this API is no longer actively
50+
under development. We recommend using our new Forecast API moving forward:
51+
https://docs.microsoft.com/en-us/rest/api/cost-management/forecast/usage.
5052
5153
:param filter: May be used to filter forecasts by properties/usageDate (Utc time),
5254
properties/chargeType or properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge',

sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_reservation_recommendation_details_operations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ async def get(
110110

111111
if response.status_code not in [200, 204]:
112112
map_error(status_code=response.status_code, response=response, error_map=error_map)
113-
error = self._deserialize(_models.ErrorResponse, response)
113+
error = self._deserialize(_models.HighCasedErrorResponse, response)
114114
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
115115

116116
deserialized = None

sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_tags_operations.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ async def get(
4444
self,
4545
scope: str,
4646
**kwargs
47-
) -> "_models.TagsResult":
47+
) -> Optional["_models.TagsResult"]:
4848
"""Get all available tag keys for the defined scope.
4949
5050
:param scope: The scope associated with tags operations. This includes
@@ -60,10 +60,10 @@ async def get(
6060
:type scope: str
6161
:keyword callable cls: A custom type or function that will be passed the direct response
6262
:return: TagsResult, or the result of cls(response)
63-
:rtype: ~azure.mgmt.consumption.models.TagsResult
63+
:rtype: ~azure.mgmt.consumption.models.TagsResult or None
6464
:raises: ~azure.core.exceptions.HttpResponseError
6565
"""
66-
cls = kwargs.pop('cls', None) # type: ClsType["_models.TagsResult"]
66+
cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.TagsResult"]]
6767
error_map = {
6868
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
6969
}
@@ -90,12 +90,14 @@ async def get(
9090
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
9191
response = pipeline_response.http_response
9292

93-
if response.status_code not in [200]:
93+
if response.status_code not in [200, 204]:
9494
map_error(status_code=response.status_code, response=response, error_map=error_map)
9595
error = self._deserialize(_models.ErrorResponse, response)
9696
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
9797

98-
deserialized = self._deserialize('TagsResult', pipeline_response)
98+
deserialized = None
99+
if response.status_code == 200:
100+
deserialized = self._deserialize('TagsResult', pipeline_response)
99101

100102
if cls:
101103
return cls(pipeline_response, deserialized, {})

sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
from ._models_py3 import Forecast
3030
from ._models_py3 import ForecastPropertiesConfidenceLevelsItem
3131
from ._models_py3 import ForecastsListResult
32+
from ._models_py3 import HighCasedErrorDetails
33+
from ._models_py3 import HighCasedErrorResponse
3234
from ._models_py3 import LegacyChargeSummary
3335
from ._models_py3 import LegacyReservationRecommendation
3436
from ._models_py3 import LegacyReservationTransaction
@@ -96,6 +98,8 @@
9698
from ._models import Forecast # type: ignore
9799
from ._models import ForecastPropertiesConfidenceLevelsItem # type: ignore
98100
from ._models import ForecastsListResult # type: ignore
101+
from ._models import HighCasedErrorDetails # type: ignore
102+
from ._models import HighCasedErrorResponse # type: ignore
99103
from ._models import LegacyChargeSummary # type: ignore
100104
from ._models import LegacyReservationRecommendation # type: ignore
101105
from ._models import LegacyReservationTransaction # type: ignore
@@ -186,6 +190,8 @@
186190
'Forecast',
187191
'ForecastPropertiesConfidenceLevelsItem',
188192
'ForecastsListResult',
193+
'HighCasedErrorDetails',
194+
'HighCasedErrorResponse',
189195
'LegacyChargeSummary',
190196
'LegacyReservationRecommendation',
191197
'LegacyReservationTransaction',

0 commit comments

Comments
 (0)