Skip to content

Commit b5d5bf6

Browse files
author
SDKAuto
committed
CodeGen from PR 16431 in Azure/azure-rest-api-specs
Merge 55237cfe8ea393799b30c95c029cfee68aa09574 into 62ec790
1 parent 14496e7 commit b5d5bf6

Some content is hidden

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

50 files changed

+1896
-838
lines changed

sdk/consumption/azure-mgmt-consumption/MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
include _meta.json
12
recursive-include tests *.py *.yaml
23
include *.md
34
include azure/__init__.py
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"autorest": "3.4.5",
3+
"use": [
4+
"@autorest/[email protected]",
5+
"@autorest/[email protected]"
6+
],
7+
"commit": "0418ecbffbf97c145408c915d741d7c73ab2295c",
8+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
9+
"autorest_command": "autorest specification/consumption/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.4.5",
10+
"readme": "specification/consumption/resource-manager/readme.md"
11+
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def __init__(
4848

4949
self.credential = credential
5050
self.subscription_id = subscription_id
51-
self.api_version = "2019-10-01"
51+
self.api_version = "2021-10-01"
5252
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
5353
kwargs.setdefault('sdk_moniker', 'mgmt-consumption/{}'.format(VERSION))
5454
self._configure(**kwargs)

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

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from typing import Any, Optional
1717

1818
from azure.core.credentials import TokenCredential
19+
from azure.core.pipeline.transport import HttpRequest, HttpResponse
1920

2021
from ._configuration import ConsumptionManagementClientConfiguration
2122
from .operations import UsageDetailsOperations
@@ -30,7 +31,6 @@
3031
from .operations import ReservationRecommendationDetailsOperations
3132
from .operations import ReservationTransactionsOperations
3233
from .operations import PriceSheetOperations
33-
from .operations import ForecastsOperations
3434
from .operations import Operations
3535
from .operations import AggregatedCostOperations
3636
from .operations import EventsOperations
@@ -66,8 +66,6 @@ class ConsumptionManagementClient(object):
6666
:vartype reservation_transactions: azure.mgmt.consumption.operations.ReservationTransactionsOperations
6767
:ivar price_sheet: PriceSheetOperations operations
6868
:vartype price_sheet: azure.mgmt.consumption.operations.PriceSheetOperations
69-
:ivar forecasts: ForecastsOperations operations
70-
:vartype forecasts: azure.mgmt.consumption.operations.ForecastsOperations
7169
:ivar operations: Operations operations
7270
:vartype operations: azure.mgmt.consumption.operations.Operations
7371
:ivar aggregated_cost: AggregatedCostOperations operations
@@ -127,8 +125,6 @@ def __init__(
127125
self._client, self._config, self._serialize, self._deserialize)
128126
self.price_sheet = PriceSheetOperations(
129127
self._client, self._config, self._serialize, self._deserialize)
130-
self.forecasts = ForecastsOperations(
131-
self._client, self._config, self._serialize, self._deserialize)
132128
self.operations = Operations(
133129
self._client, self._config, self._serialize, self._deserialize)
134130
self.aggregated_cost = AggregatedCostOperations(
@@ -140,6 +136,24 @@ def __init__(
140136
self.credits = CreditsOperations(
141137
self._client, self._config, self._serialize, self._deserialize)
142138

139+
def _send_request(self, http_request, **kwargs):
140+
# type: (HttpRequest, Any) -> HttpResponse
141+
"""Runs the network request through the client's chained policies.
142+
143+
:param http_request: The network request you want to make. Required.
144+
:type http_request: ~azure.core.pipeline.transport.HttpRequest
145+
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
146+
:return: The response of your network call. Does not do error handling on your response.
147+
:rtype: ~azure.core.pipeline.transport.HttpResponse
148+
"""
149+
path_format_arguments = {
150+
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
151+
}
152+
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
153+
stream = kwargs.pop("stream", True)
154+
pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs)
155+
return pipeline_response.http_response
156+
143157
def close(self):
144158
# type: () -> None
145159
self._client.close()
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
{
2+
"chosen_version": "2021-10-01",
3+
"total_api_version_list": ["2021-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": false,
13+
"sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ConsumptionManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}",
14+
"async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ConsumptionManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}"
15+
},
16+
"global_parameters": {
17+
"sync": {
18+
"credential": {
19+
"signature": "credential, # type: \"TokenCredential\"",
20+
"description": "Credential needed for the client to connect to Azure.",
21+
"docstring_type": "~azure.core.credentials.TokenCredential",
22+
"required": true
23+
},
24+
"subscription_id": {
25+
"signature": "subscription_id, # type: str",
26+
"description": "Azure Subscription ID.",
27+
"docstring_type": "str",
28+
"required": true
29+
}
30+
},
31+
"async": {
32+
"credential": {
33+
"signature": "credential: \"AsyncTokenCredential\",",
34+
"description": "Credential needed for the client to connect to Azure.",
35+
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
36+
"required": true
37+
},
38+
"subscription_id": {
39+
"signature": "subscription_id: str,",
40+
"description": "Azure Subscription ID.",
41+
"docstring_type": "str",
42+
"required": true
43+
}
44+
},
45+
"constant": {
46+
},
47+
"call": "credential, subscription_id",
48+
"service_client_specific": {
49+
"sync": {
50+
"api_version": {
51+
"signature": "api_version=None, # type: Optional[str]",
52+
"description": "API version to use if no profile is provided, or if missing in profile.",
53+
"docstring_type": "str",
54+
"required": false
55+
},
56+
"base_url": {
57+
"signature": "base_url=None, # type: Optional[str]",
58+
"description": "Service URL",
59+
"docstring_type": "str",
60+
"required": false
61+
},
62+
"profile": {
63+
"signature": "profile=KnownProfiles.default, # type: KnownProfiles",
64+
"description": "A profile definition, from KnownProfiles to dict.",
65+
"docstring_type": "azure.profiles.KnownProfiles",
66+
"required": false
67+
}
68+
},
69+
"async": {
70+
"api_version": {
71+
"signature": "api_version: Optional[str] = None,",
72+
"description": "API version to use if no profile is provided, or if missing in profile.",
73+
"docstring_type": "str",
74+
"required": false
75+
},
76+
"base_url": {
77+
"signature": "base_url: Optional[str] = None,",
78+
"description": "Service URL",
79+
"docstring_type": "str",
80+
"required": false
81+
},
82+
"profile": {
83+
"signature": "profile: KnownProfiles = KnownProfiles.default,",
84+
"description": "A profile definition, from KnownProfiles to dict.",
85+
"docstring_type": "azure.profiles.KnownProfiles",
86+
"required": false
87+
}
88+
}
89+
}
90+
},
91+
"config": {
92+
"credential": true,
93+
"credential_scopes": ["https://management.azure.com/.default"],
94+
"credential_default_policy_type": "BearerTokenCredentialPolicy",
95+
"credential_default_policy_type_has_async_version": true,
96+
"credential_key_header_name": null,
97+
"sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
98+
"async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
99+
},
100+
"operation_groups": {
101+
"usage_details": "UsageDetailsOperations",
102+
"marketplaces": "MarketplacesOperations",
103+
"budgets": "BudgetsOperations",
104+
"tags": "TagsOperations",
105+
"charges": "ChargesOperations",
106+
"balances": "BalancesOperations",
107+
"reservations_summaries": "ReservationsSummariesOperations",
108+
"reservations_details": "ReservationsDetailsOperations",
109+
"reservation_recommendations": "ReservationRecommendationsOperations",
110+
"reservation_recommendation_details": "ReservationRecommendationDetailsOperations",
111+
"reservation_transactions": "ReservationTransactionsOperations",
112+
"price_sheet": "PriceSheetOperations",
113+
"operations": "Operations",
114+
"aggregated_cost": "AggregatedCostOperations",
115+
"events": "EventsOperations",
116+
"lots": "LotsOperations",
117+
"credits": "CreditsOperations"
118+
}
119+
}

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 = "1.0.0b1"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def __init__(
4545

4646
self.credential = credential
4747
self.subscription_id = subscription_id
48-
self.api_version = "2019-10-01"
48+
self.api_version = "2021-10-01"
4949
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
5050
kwargs.setdefault('sdk_moniker', 'mgmt-consumption/{}'.format(VERSION))
5151
self._configure(**kwargs)

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

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

99
from typing import Any, Optional, TYPE_CHECKING
1010

11+
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
1112
from azure.mgmt.core import AsyncARMPipelineClient
1213
from msrest import Deserializer, Serializer
1314

@@ -28,7 +29,6 @@
2829
from .operations import ReservationRecommendationDetailsOperations
2930
from .operations import ReservationTransactionsOperations
3031
from .operations import PriceSheetOperations
31-
from .operations import ForecastsOperations
3232
from .operations import Operations
3333
from .operations import AggregatedCostOperations
3434
from .operations import EventsOperations
@@ -64,8 +64,6 @@ class ConsumptionManagementClient(object):
6464
:vartype reservation_transactions: azure.mgmt.consumption.aio.operations.ReservationTransactionsOperations
6565
:ivar price_sheet: PriceSheetOperations operations
6666
:vartype price_sheet: azure.mgmt.consumption.aio.operations.PriceSheetOperations
67-
:ivar forecasts: ForecastsOperations operations
68-
:vartype forecasts: azure.mgmt.consumption.aio.operations.ForecastsOperations
6967
:ivar operations: Operations operations
7068
:vartype operations: azure.mgmt.consumption.aio.operations.Operations
7169
:ivar aggregated_cost: AggregatedCostOperations operations
@@ -124,8 +122,6 @@ def __init__(
124122
self._client, self._config, self._serialize, self._deserialize)
125123
self.price_sheet = PriceSheetOperations(
126124
self._client, self._config, self._serialize, self._deserialize)
127-
self.forecasts = ForecastsOperations(
128-
self._client, self._config, self._serialize, self._deserialize)
129125
self.operations = Operations(
130126
self._client, self._config, self._serialize, self._deserialize)
131127
self.aggregated_cost = AggregatedCostOperations(
@@ -137,6 +133,23 @@ def __init__(
137133
self.credits = CreditsOperations(
138134
self._client, self._config, self._serialize, self._deserialize)
139135

136+
async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse:
137+
"""Runs the network request through the client's chained policies.
138+
139+
:param http_request: The network request you want to make. Required.
140+
:type http_request: ~azure.core.pipeline.transport.HttpRequest
141+
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
142+
:return: The response of your network call. Does not do error handling on your response.
143+
:rtype: ~azure.core.pipeline.transport.AsyncHttpResponse
144+
"""
145+
path_format_arguments = {
146+
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
147+
}
148+
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
149+
stream = kwargs.pop("stream", True)
150+
pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs)
151+
return pipeline_response.http_response
152+
140153
async def close(self) -> None:
141154
await self._client.close()
142155

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
from ._reservation_recommendation_details_operations import ReservationRecommendationDetailsOperations
1919
from ._reservation_transactions_operations import ReservationTransactionsOperations
2020
from ._price_sheet_operations import PriceSheetOperations
21-
from ._forecasts_operations import ForecastsOperations
2221
from ._operations import Operations
2322
from ._aggregated_cost_operations import AggregatedCostOperations
2423
from ._events_operations import EventsOperations
@@ -38,7 +37,6 @@
3837
'ReservationRecommendationDetailsOperations',
3938
'ReservationTransactionsOperations',
4039
'PriceSheetOperations',
41-
'ForecastsOperations',
4240
'Operations',
4341
'AggregatedCostOperations',
4442
'EventsOperations',

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ async def get_by_management_group(
4444
self,
4545
management_group_id: str,
4646
filter: Optional[str] = None,
47-
**kwargs
47+
**kwargs: Any
4848
) -> "_models.ManagementGroupAggregatedCostResult":
4949
"""Provides the aggregate cost of a management group and all child management groups by current
5050
billing period.
@@ -66,7 +66,7 @@ async def get_by_management_group(
6666
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
6767
}
6868
error_map.update(kwargs.pop('error_map', {}))
69-
api_version = "2019-10-01"
69+
api_version = "2021-10-01"
7070
accept = "application/json"
7171

7272
# Construct URL
@@ -92,7 +92,7 @@ async def get_by_management_group(
9292

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

9898
deserialized = self._deserialize('ManagementGroupAggregatedCostResult', pipeline_response)
@@ -107,7 +107,7 @@ async def get_for_billing_period_by_management_group(
107107
self,
108108
management_group_id: str,
109109
billing_period_name: str,
110-
**kwargs
110+
**kwargs: Any
111111
) -> "_models.ManagementGroupAggregatedCostResult":
112112
"""Provides the aggregate cost of a management group and all child management groups by specified
113113
billing period.
@@ -126,7 +126,7 @@ async def get_for_billing_period_by_management_group(
126126
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
127127
}
128128
error_map.update(kwargs.pop('error_map', {}))
129-
api_version = "2019-10-01"
129+
api_version = "2021-10-01"
130130
accept = "application/json"
131131

132132
# Construct URL
@@ -151,7 +151,7 @@ async def get_for_billing_period_by_management_group(
151151

152152
if response.status_code not in [200]:
153153
map_error(status_code=response.status_code, response=response, error_map=error_map)
154-
error = self._deserialize(_models.ErrorResponse, response)
154+
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response)
155155
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
156156

157157
deserialized = self._deserialize('ManagementGroupAggregatedCostResult', pipeline_response)
@@ -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}/providers/Microsoft.Consumption/aggregatedCost'} # type: ignore

0 commit comments

Comments
 (0)