From 51bbce03cbf06c010a5255246a5c4402ab286e1d Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 28 Dec 2020 18:49:05 +0000 Subject: [PATCH] CodeGen from PR 12194 in Azure/azure-rest-api-specs Merge 589590398be2356992f0715cd2ec1953e3126426 into bcd417920ddc33d1e89d0ecfcb2b405025418b3c --- .../_consumption_management_client.py | 1 - .../azure/mgmt/consumption/_metadata.json | 78 ++++++++++++++++ .../azure/mgmt/consumption/_version.py | 2 +- .../aio/_consumption_management_client.py | 1 - .../operations/_aggregated_cost_operations.py | 16 ++-- .../aio/operations/_balances_operations.py | 16 ++-- .../aio/operations/_budgets_operations.py | 26 +++--- .../aio/operations/_charges_operations.py | 10 +- .../aio/operations/_credits_operations.py | 10 +- .../aio/operations/_events_operations.py | 10 +- .../aio/operations/_forecasts_operations.py | 10 +- .../aio/operations/_lots_operations.py | 10 +- .../operations/_marketplaces_operations.py | 10 +- .../consumption/aio/operations/_operations.py | 10 +- .../aio/operations/_price_sheet_operations.py | 16 ++-- ...ation_recommendation_details_operations.py | 16 ++-- ..._reservation_recommendations_operations.py | 14 +-- .../_reservation_transactions_operations.py | 16 ++-- .../_reservations_details_operations.py | 22 ++--- .../_reservations_summaries_operations.py | 28 +++--- .../aio/operations/_tags_operations.py | 10 +- .../operations/_usage_details_operations.py | 12 +-- .../azure/mgmt/consumption/models/__init__.py | 3 + .../azure/mgmt/consumption/models/_models.py | 87 +++++++++++++++--- .../mgmt/consumption/models/_models_py3.py | 92 ++++++++++++++++--- .../operations/_aggregated_cost_operations.py | 16 ++-- .../operations/_balances_operations.py | 16 ++-- .../operations/_budgets_operations.py | 28 +++--- .../operations/_charges_operations.py | 10 +- .../operations/_credits_operations.py | 10 +- .../operations/_events_operations.py | 10 +- .../operations/_forecasts_operations.py | 10 +- .../operations/_lots_operations.py | 10 +- .../operations/_marketplaces_operations.py | 10 +- .../consumption/operations/_operations.py | 10 +- .../operations/_price_sheet_operations.py | 16 ++-- ...ation_recommendation_details_operations.py | 16 ++-- ..._reservation_recommendations_operations.py | 14 +-- .../_reservation_transactions_operations.py | 16 ++-- .../_reservations_details_operations.py | 22 ++--- .../_reservations_summaries_operations.py | 28 +++--- .../operations/_tags_operations.py | 10 +- .../operations/_usage_details_operations.py | 12 +-- 43 files changed, 500 insertions(+), 290 deletions(-) create mode 100644 sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/_metadata.json diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/_consumption_management_client.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/_consumption_management_client.py index bd8acadb67e7..a1c112340183 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/_consumption_management_client.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/_consumption_management_client.py @@ -100,7 +100,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.usage_details = UsageDetailsOperations( diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/_metadata.json b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/_metadata.json new file mode 100644 index 000000000000..bc5fe34a48b3 --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/_metadata.json @@ -0,0 +1,78 @@ +{ + "chosen_version": "2019-10-01", + "total_api_version_list": ["2019-10-01"], + "client": { + "name": "ConsumptionManagementClient", + "filename": "_consumption_management_client", + "description": "Consumption management client provides access to consumption resources for Azure Enterprise Subscriptions.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": false, + "client_side_validation": true + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "Azure Subscription ID.", + "docstring_type": "str", + "required": true + } + }, + "async": { + "credential": { + "signature": "credential, # type: \"AsyncTokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "Azure Subscription ID.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id" + }, + "config": { + "credential": true, + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null + }, + "operation_groups": { + "usage_details": "UsageDetailsOperations", + "marketplaces": "MarketplacesOperations", + "budgets": "BudgetsOperations", + "tags": "TagsOperations", + "charges": "ChargesOperations", + "balances": "BalancesOperations", + "reservations_summaries": "ReservationsSummariesOperations", + "reservations_details": "ReservationsDetailsOperations", + "reservation_recommendations": "ReservationRecommendationsOperations", + "reservation_recommendation_details": "ReservationRecommendationDetailsOperations", + "reservation_transactions": "ReservationTransactionsOperations", + "price_sheet": "PriceSheetOperations", + "forecasts": "ForecastsOperations", + "operations": "Operations", + "aggregated_cost": "AggregatedCostOperations", + "events": "EventsOperations", + "lots": "LotsOperations", + "credits": "CreditsOperations" + }, + "operation_mixins": { + }, + "sync_imports": "None", + "async_imports": "None" +} \ No newline at end of file diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/_version.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/_version.py index 0d5779dc14de..48944bf3938a 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/_version.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "8.0.0b1" +VERSION = "2.0.0" diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/_consumption_management_client.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/_consumption_management_client.py index c709a3e4f1e9..939f029e5d9e 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/_consumption_management_client.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/_consumption_management_client.py @@ -97,7 +97,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.usage_details = UsageDetailsOperations( diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_aggregated_cost_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_aggregated_cost_operations.py index 8b009d96f666..b601898dfeea 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_aggregated_cost_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_aggregated_cost_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class AggregatedCostOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ async def get_by_management_group( management_group_id: str, filter: Optional[str] = None, **kwargs - ) -> "models.ManagementGroupAggregatedCostResult": + ) -> "_models.ManagementGroupAggregatedCostResult": """Provides the aggregate cost of a management group and all child management groups by current billing period. @@ -61,7 +61,7 @@ async def get_by_management_group( :rtype: ~azure.mgmt.consumption.models.ManagementGroupAggregatedCostResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ManagementGroupAggregatedCostResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagementGroupAggregatedCostResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -92,7 +92,7 @@ async def get_by_management_group( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ManagementGroupAggregatedCostResult', pipeline_response) @@ -108,7 +108,7 @@ async def get_for_billing_period_by_management_group( management_group_id: str, billing_period_name: str, **kwargs - ) -> "models.ManagementGroupAggregatedCostResult": + ) -> "_models.ManagementGroupAggregatedCostResult": """Provides the aggregate cost of a management group and all child management groups by specified billing period. @@ -121,7 +121,7 @@ async def get_for_billing_period_by_management_group( :rtype: ~azure.mgmt.consumption.models.ManagementGroupAggregatedCostResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ManagementGroupAggregatedCostResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagementGroupAggregatedCostResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ async def get_for_billing_period_by_management_group( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ManagementGroupAggregatedCostResult', pipeline_response) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_balances_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_balances_operations.py index be5dd721ac7d..1183848b2622 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_balances_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_balances_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class BalancesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ async def get_by_billing_account( self, billing_account_id: str, **kwargs - ) -> "models.Balance": + ) -> "_models.Balance": """Gets the balances for a scope by billingAccountId. Balances are available via this API only for May 1, 2014 or later. @@ -55,7 +55,7 @@ async def get_by_billing_account( :rtype: ~azure.mgmt.consumption.models.Balance :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Balance"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Balance"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -84,7 +84,7 @@ async def get_by_billing_account( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Balance', pipeline_response) @@ -100,7 +100,7 @@ async def get_for_billing_period_by_billing_account( billing_account_id: str, billing_period_name: str, **kwargs - ) -> "models.Balance": + ) -> "_models.Balance": """Gets the balances for a scope by billing period and billingAccountId. Balances are available via this API only for May 1, 2014 or later. @@ -113,7 +113,7 @@ async def get_for_billing_period_by_billing_account( :rtype: ~azure.mgmt.consumption.models.Balance :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Balance"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Balance"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -143,7 +143,7 @@ async def get_for_billing_period_by_billing_account( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Balance', pipeline_response) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_budgets_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_budgets_operations.py index c15217abae40..7d802a0352a9 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_budgets_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_budgets_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class BudgetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, scope: str, **kwargs - ) -> AsyncIterable["models.BudgetsListResult"]: + ) -> AsyncIterable["_models.BudgetsListResult"]: """Lists all budgets for the defined scope. :param scope: The scope associated with budget operations. This includes @@ -68,7 +68,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.consumption.models.BudgetsListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BudgetsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BudgetsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -113,7 +113,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -129,7 +129,7 @@ async def get( scope: str, budget_name: str, **kwargs - ) -> "models.Budget": + ) -> "_models.Budget": """Gets the budget for the scope by budget name. :param scope: The scope associated with budget operations. This includes @@ -154,7 +154,7 @@ async def get( :rtype: ~azure.mgmt.consumption.models.Budget :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Budget"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Budget"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -184,7 +184,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Budget', pipeline_response) @@ -199,9 +199,9 @@ async def create_or_update( self, scope: str, budget_name: str, - parameters: "models.Budget", + parameters: "_models.Budget", **kwargs - ) -> "models.Budget": + ) -> "_models.Budget": """The operation to create or update a budget. Update operation requires latest eTag to be set in the request mandatorily. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag. @@ -230,7 +230,7 @@ async def create_or_update( :rtype: ~azure.mgmt.consumption.models.Budget :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Budget"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Budget"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -265,7 +265,7 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -340,7 +340,7 @@ async def delete( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_charges_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_charges_operations.py index 45b1776a21cf..11aedcb34bc1 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_charges_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_charges_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ChargesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def list( filter: Optional[str] = None, apply: Optional[str] = None, **kwargs - ) -> "models.ChargesListResult": + ) -> "_models.ChargesListResult": """Lists the charges based for the defined scope. :param scope: The scope associated with charges operations. This includes @@ -86,7 +86,7 @@ async def list( :rtype: ~azure.mgmt.consumption.models.ChargesListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ChargesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ChargesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -123,7 +123,7 @@ async def list( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ChargesListResult', pipeline_response) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_credits_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_credits_operations.py index 9b27049ece45..a02204f3ecfa 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_credits_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_credits_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class CreditsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ async def get( billing_account_id: str, billing_profile_id: str, **kwargs - ) -> "models.CreditSummary": + ) -> "_models.CreditSummary": """The credit summary by billingAccountId and billingProfileId. :param billing_account_id: BillingAccount ID. @@ -57,7 +57,7 @@ async def get( :rtype: ~azure.mgmt.consumption.models.CreditSummary :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CreditSummary"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CreditSummary"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -87,7 +87,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('CreditSummary', pipeline_response) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_events_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_events_operations.py index 31006fbf05dd..e77643642dbd 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_events_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_events_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class EventsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( start_date: str, end_date: str, **kwargs - ) -> AsyncIterable["models.Events"]: + ) -> AsyncIterable["_models.Events"]: """Lists the events by billingAccountId and billingProfileId for given start and end date. :param billing_account_id: BillingAccount ID. @@ -64,7 +64,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.consumption.models.Events] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Events"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Events"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,7 +112,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_forecasts_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_forecasts_operations.py index c511f791fd20..3e0e3c744c1d 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_forecasts_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_forecasts_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ForecastsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, filter: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.ForecastsListResult"]: + ) -> AsyncIterable["_models.ForecastsListResult"]: """Lists the forecast charges by subscriptionId. :param filter: May be used to filter forecasts by properties/usageDate (Utc time), @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.consumption.models.ForecastsListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ForecastsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ForecastsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,7 +104,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_lots_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_lots_operations.py index e854e7763c86..67a4242e7980 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_lots_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_lots_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LotsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( billing_account_id: str, billing_profile_id: str, **kwargs - ) -> AsyncIterable["models.Lots"]: + ) -> AsyncIterable["_models.Lots"]: """Lists the lots by billingAccountId and billingProfileId. :param billing_account_id: BillingAccount ID. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.consumption.models.Lots] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Lots"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Lots"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,7 +104,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_marketplaces_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_marketplaces_operations.py index d0e2921c70e5..ecee0de3e21c 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_marketplaces_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_marketplaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class MarketplacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( top: Optional[int] = None, skiptoken: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.MarketplacesListResult"]: + ) -> AsyncIterable["_models.MarketplacesListResult"]: """Lists the marketplaces for a scope at the defined scope. Marketplaces are available via this API only for May 1, 2014 or later. @@ -80,7 +80,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.consumption.models.MarketplacesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MarketplacesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MarketplacesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -131,7 +131,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_operations.py index 1c34ff459644..f00db289824f 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class Operations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.OperationListResult"]: + ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available consumption REST API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.consumption.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_price_sheet_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_price_sheet_operations.py index d00a9af531fd..5401fa5f599f 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_price_sheet_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_price_sheet_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class PriceSheetOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ async def get( skiptoken: Optional[str] = None, top: Optional[int] = None, **kwargs - ) -> "models.PriceSheetResult": + ) -> "_models.PriceSheetResult": """Gets the price sheet for a scope by subscriptionId. Price sheet is available via this API only for May 1, 2014 or later. @@ -64,7 +64,7 @@ async def get( :rtype: ~azure.mgmt.consumption.models.PriceSheetResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PriceSheetResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PriceSheetResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -99,7 +99,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PriceSheetResult', pipeline_response) @@ -117,7 +117,7 @@ async def get_by_billing_period( skiptoken: Optional[str] = None, top: Optional[int] = None, **kwargs - ) -> "models.PriceSheetResult": + ) -> "_models.PriceSheetResult": """Get the price sheet for a scope by subscriptionId and billing period. Price sheet is available via this API only for May 1, 2014 or later. @@ -137,7 +137,7 @@ async def get_by_billing_period( :rtype: ~azure.mgmt.consumption.models.PriceSheetResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PriceSheetResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PriceSheetResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -173,7 +173,7 @@ async def get_by_billing_period( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PriceSheetResult', pipeline_response) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_reservation_recommendation_details_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_reservation_recommendation_details_operations.py index d54ff352e1ad..549bdc224285 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_reservation_recommendation_details_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_reservation_recommendation_details_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ReservationRecommendationDetailsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -43,13 +43,13 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def get( self, billing_scope: str, - scope: Union[str, "models.Scope"], + scope: Union[str, "_models.Scope"], region: str, - term: Union[str, "models.Term"], - look_back_period: Union[str, "models.LookBackPeriod"], + term: Union[str, "_models.Term"], + look_back_period: Union[str, "_models.LookBackPeriod"], product: str, **kwargs - ) -> Optional["models.ReservationRecommendationDetailsModel"]: + ) -> Optional["_models.ReservationRecommendationDetailsModel"]: """Details of a reservation recommendation for what-if analysis of reserved instances. :param billing_scope: The scope associated with reservation recommendation details operations. @@ -76,7 +76,7 @@ async def get( :rtype: ~azure.mgmt.consumption.models.ReservationRecommendationDetailsModel or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ReservationRecommendationDetailsModel"]] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ReservationRecommendationDetailsModel"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,7 +110,7 @@ async def get( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_reservation_recommendations_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_reservation_recommendations_operations.py index 0668185974e6..09d049fac676 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_reservation_recommendations_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_reservation_recommendations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ReservationRecommendationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( scope: str, filter: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.ReservationRecommendationsListResult"]: + ) -> AsyncIterable["_models.ReservationRecommendationsListResult"]: """List of recommendations for purchasing reserved instances. :param scope: The scope associated with reservation recommendations operations. This includes @@ -66,10 +66,10 @@ def list( :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ReservationRecommendationsListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.consumption.models.ReservationRecommendationsListResult] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.consumption.models.ReservationRecommendationsListResultor None] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ReservationRecommendationsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ReservationRecommendationsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -115,8 +115,8 @@ async def get_next(next_link=None): pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + if response.status_code not in [200, 204]: + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_reservation_transactions_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_reservation_transactions_operations.py index 5f902f3cccd8..c6f5f7abcb98 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_reservation_transactions_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_reservation_transactions_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ReservationTransactionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( billing_account_id: str, filter: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.ReservationTransactionsListResult"]: + ) -> AsyncIterable["_models.ReservationTransactionsListResult"]: """List of transactions for reserved instances on billing account scope. :param billing_account_id: BillingAccount ID. @@ -59,7 +59,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.consumption.models.ReservationTransactionsListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ReservationTransactionsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ReservationTransactionsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -106,7 +106,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -123,7 +123,7 @@ def list_by_billing_profile( billing_profile_id: str, filter: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.ModernReservationTransactionsListResult"]: + ) -> AsyncIterable["_models.ModernReservationTransactionsListResult"]: """List of transactions for reserved instances on billing account scope. :param billing_account_id: BillingAccount ID. @@ -138,7 +138,7 @@ def list_by_billing_profile( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.consumption.models.ModernReservationTransactionsListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ModernReservationTransactionsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ModernReservationTransactionsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -186,7 +186,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_reservations_details_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_reservations_details_operations.py index 894235ade0de..caa00e154eb2 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_reservations_details_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_reservations_details_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ReservationsDetailsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list_by_reservation_order( reservation_order_id: str, filter: str, **kwargs - ) -> AsyncIterable["models.ReservationDetailsListResult"]: + ) -> AsyncIterable["_models.ReservationDetailsListResult"]: """Lists the reservations details for provided date range. :param reservation_order_id: Order Id of the reservation. @@ -59,7 +59,7 @@ def list_by_reservation_order( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.consumption.models.ReservationDetailsListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ReservationDetailsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ReservationDetailsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,7 +105,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -122,7 +122,7 @@ def list_by_reservation_order_and_reservation( reservation_id: str, filter: str, **kwargs - ) -> AsyncIterable["models.ReservationDetailsListResult"]: + ) -> AsyncIterable["_models.ReservationDetailsListResult"]: """Lists the reservations details for provided date range. :param reservation_order_id: Order Id of the reservation. @@ -137,7 +137,7 @@ def list_by_reservation_order_and_reservation( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.consumption.models.ReservationDetailsListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ReservationDetailsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ReservationDetailsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -184,7 +184,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -204,7 +204,7 @@ def list( reservation_id: Optional[str] = None, reservation_order_id: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.ReservationDetailsListResult"]: + ) -> AsyncIterable["_models.ReservationDetailsListResult"]: """Lists the reservations details for the defined scope and provided date range. :param scope: The scope associated with reservations details operations. This includes @@ -232,7 +232,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.consumption.models.ReservationDetailsListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ReservationDetailsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ReservationDetailsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -287,7 +287,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_reservations_summaries_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_reservations_summaries_operations.py index 89ee6810680d..29209bda5139 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_reservations_summaries_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_reservations_summaries_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ReservationsSummariesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,10 +44,10 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list_by_reservation_order( self, reservation_order_id: str, - grain: Union[str, "models.Datagrain"], + grain: Union[str, "_models.Datagrain"], filter: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.ReservationSummariesListResult"]: + ) -> AsyncIterable["_models.ReservationSummariesListResult"]: """Lists the reservations summaries for daily or monthly grain. :param reservation_order_id: Order Id of the reservation. @@ -62,7 +62,7 @@ def list_by_reservation_order( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.consumption.models.ReservationSummariesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ReservationSummariesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ReservationSummariesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,7 +110,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -125,10 +125,10 @@ def list_by_reservation_order_and_reservation( self, reservation_order_id: str, reservation_id: str, - grain: Union[str, "models.Datagrain"], + grain: Union[str, "_models.Datagrain"], filter: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.ReservationSummariesListResult"]: + ) -> AsyncIterable["_models.ReservationSummariesListResult"]: """Lists the reservations summaries for daily or monthly grain. :param reservation_order_id: Order Id of the reservation. @@ -145,7 +145,7 @@ def list_by_reservation_order_and_reservation( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.consumption.models.ReservationSummariesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ReservationSummariesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ReservationSummariesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -194,7 +194,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -208,14 +208,14 @@ async def get_next(next_link=None): def list( self, scope: str, - grain: Union[str, "models.Datagrain"], + grain: Union[str, "_models.Datagrain"], start_date: Optional[str] = None, end_date: Optional[str] = None, filter: Optional[str] = None, reservation_id: Optional[str] = None, reservation_order_id: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.ReservationSummariesListResult"]: + ) -> AsyncIterable["_models.ReservationSummariesListResult"]: """Lists the reservations summaries for the defined scope daily or monthly grain. :param scope: The scope associated with reservations summaries operations. This includes @@ -244,7 +244,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.consumption.models.ReservationSummariesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ReservationSummariesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ReservationSummariesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -300,7 +300,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_tags_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_tags_operations.py index c16d81f9fa32..a2f7be0f3a48 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_tags_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_tags_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class TagsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ async def get( self, scope: str, **kwargs - ) -> "models.TagsResult": + ) -> "_models.TagsResult": """Get all available tag keys for the defined scope. :param scope: The scope associated with tags operations. This includes @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.consumption.models.TagsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.TagsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TagsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -92,7 +92,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('TagsResult', pipeline_response) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_usage_details_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_usage_details_operations.py index 34dfd3527bd4..b2642f737faf 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_usage_details_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_usage_details_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsageDetailsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,9 +48,9 @@ def list( filter: Optional[str] = None, skiptoken: Optional[str] = None, top: Optional[int] = None, - metric: Optional[Union[str, "models.Metrictype"]] = None, + metric: Optional[Union[str, "_models.Metrictype"]] = None, **kwargs - ) -> AsyncIterable["models.UsageDetailsListResult"]: + ) -> AsyncIterable["_models.UsageDetailsListResult"]: """Lists the usage details for the defined scope. Usage details are available via this API only for May 1, 2014 or later. @@ -99,7 +99,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.consumption.models.UsageDetailsListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsageDetailsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageDetailsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -154,7 +154,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/__init__.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/__init__.py index f39f10f8d3a3..5683bcba3659 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/__init__.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/__init__.py @@ -64,6 +64,7 @@ from ._models_py3 import ReservationSummariesListResult from ._models_py3 import ReservationSummary from ._models_py3 import ReservationTransaction + from ._models_py3 import ReservationTransactionResource from ._models_py3 import ReservationTransactionsListResult from ._models_py3 import Resource from ._models_py3 import ResourceAttributes @@ -130,6 +131,7 @@ from ._models import ReservationSummariesListResult # type: ignore from ._models import ReservationSummary # type: ignore from ._models import ReservationTransaction # type: ignore + from ._models import ReservationTransactionResource # type: ignore from ._models import ReservationTransactionsListResult # type: ignore from ._models import Resource # type: ignore from ._models import ResourceAttributes # type: ignore @@ -219,6 +221,7 @@ 'ReservationSummariesListResult', 'ReservationSummary', 'ReservationTransaction', + 'ReservationTransactionResource', 'ReservationTransactionsListResult', 'Resource', 'ResourceAttributes', diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/_models.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/_models.py index 7fbf9d534234..825c013f7a90 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/_models.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/_models.py @@ -1210,7 +1210,7 @@ class LegacyReservationRecommendation(ReservationRecommendation): :ivar look_back_period: The number of days of usage to look back for recommendation. :vartype look_back_period: str :ivar instance_flexibility_ratio: The instance Flexibility Ratio. - :vartype instance_flexibility_ratio: int + :vartype instance_flexibility_ratio: float :ivar instance_flexibility_group: The instance Flexibility Group. :vartype instance_flexibility_group: str :ivar normalized_size: The normalized Size. @@ -1270,7 +1270,7 @@ class LegacyReservationRecommendation(ReservationRecommendation): 'tags': {'key': 'tags', 'type': '{str}'}, 'kind': {'key': 'kind', 'type': 'str'}, 'look_back_period': {'key': 'properties.lookBackPeriod', 'type': 'str'}, - 'instance_flexibility_ratio': {'key': 'properties.instanceFlexibilityRatio', 'type': 'int'}, + 'instance_flexibility_ratio': {'key': 'properties.instanceFlexibilityRatio', 'type': 'float'}, 'instance_flexibility_group': {'key': 'properties.instanceFlexibilityGroup', 'type': 'str'}, 'normalized_size': {'key': 'properties.normalizedSize', 'type': 'str'}, 'recommended_quantity_normalized': {'key': 'properties.recommendedQuantityNormalized', 'type': 'float'}, @@ -1307,7 +1307,47 @@ def __init__( self.sku_properties = None -class ReservationTransaction(Resource): +class ReservationTransactionResource(msrest.serialization.Model): + """The Resource model definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(ReservationTransactionResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.tags = None + + +class ReservationTransaction(ReservationTransactionResource): """Reservation transaction resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -1319,7 +1359,7 @@ class ReservationTransaction(Resource): :ivar type: Resource type. :vartype type: str :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] + :vartype tags: list[str] :ivar event_date: The date of the transaction. :vartype event_date: ~datetime.datetime :ivar reservation_order_id: The reservation order ID is the identifier for a reservation @@ -1398,7 +1438,7 @@ class ReservationTransaction(Resource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + 'tags': {'key': 'tags', 'type': '[str]'}, 'event_date': {'key': 'properties.eventDate', 'type': 'iso-8601'}, 'reservation_order_id': {'key': 'properties.reservationOrderId', 'type': 'str'}, 'description': {'key': 'properties.description', 'type': 'str'}, @@ -1460,7 +1500,7 @@ class LegacyReservationTransaction(ReservationTransaction): :ivar type: Resource type. :vartype type: str :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] + :vartype tags: list[str] :ivar event_date: The date of the transaction. :vartype event_date: ~datetime.datetime :ivar reservation_order_id: The reservation order ID is the identifier for a reservation @@ -1539,7 +1579,7 @@ class LegacyReservationTransaction(ReservationTransaction): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + 'tags': {'key': 'tags', 'type': '[str]'}, 'event_date': {'key': 'properties.eventDate', 'type': 'iso-8601'}, 'reservation_order_id': {'key': 'properties.reservationOrderId', 'type': 'str'}, 'description': {'key': 'properties.description', 'type': 'str'}, @@ -2506,7 +2546,7 @@ class ModernReservationRecommendation(ReservationRecommendation): :ivar look_back_period: The number of days of usage to look back for recommendation. :vartype look_back_period: str :ivar instance_flexibility_ratio: The instance Flexibility Ratio. - :vartype instance_flexibility_ratio: int + :vartype instance_flexibility_ratio: float :ivar instance_flexibility_group: The instance Flexibility Group. :vartype instance_flexibility_group: str :ivar normalized_size: The normalized Size. @@ -2566,7 +2606,7 @@ class ModernReservationRecommendation(ReservationRecommendation): 'tags': {'key': 'tags', 'type': '{str}'}, 'kind': {'key': 'kind', 'type': 'str'}, 'look_back_period': {'key': 'properties.lookBackPeriod', 'type': 'str'}, - 'instance_flexibility_ratio': {'key': 'properties.instanceFlexibilityRatio', 'type': 'int'}, + 'instance_flexibility_ratio': {'key': 'properties.instanceFlexibilityRatio', 'type': 'float'}, 'instance_flexibility_group': {'key': 'properties.instanceFlexibilityGroup', 'type': 'str'}, 'normalized_size': {'key': 'properties.normalizedSize', 'type': 'str'}, 'recommended_quantity_normalized': {'key': 'properties.recommendedQuantityNormalized', 'type': 'float'}, @@ -2603,7 +2643,7 @@ def __init__( self.sku_properties = None -class ModernReservationTransaction(Resource): +class ModernReservationTransaction(ReservationTransactionResource): """Modern Reservation transaction resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -2615,7 +2655,7 @@ class ModernReservationTransaction(Resource): :ivar type: Resource type. :vartype type: str :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] + :vartype tags: list[str] :ivar amount: The charge of the transaction. :vartype amount: float :ivar arm_sku_name: This is the ARM Sku name. It can be used to join with the serviceType field @@ -2693,7 +2733,7 @@ class ModernReservationTransaction(Resource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + 'tags': {'key': 'tags', 'type': '[str]'}, 'amount': {'key': 'properties.amount', 'type': 'float'}, 'arm_sku_name': {'key': 'properties.armSkuName', 'type': 'str'}, 'billing_frequency': {'key': 'properties.billingFrequency', 'type': 'str'}, @@ -3599,6 +3639,9 @@ class ReservationRecommendationDetailsCalculatedSavingsProperties(msrest.seriali :vartype reservation_cost: float :ivar total_reservation_cost: The cost of the suggested quantity. :vartype total_reservation_cost: float + :param reserved_unit_count: The number of reserved units used to calculate savings. Always 1 + for virtual machines. + :type reserved_unit_count: float :ivar savings: The amount saved by purchasing the recommended quantity of reservation. :vartype savings: float """ @@ -3618,6 +3661,7 @@ class ReservationRecommendationDetailsCalculatedSavingsProperties(msrest.seriali 'quantity': {'key': 'quantity', 'type': 'float'}, 'reservation_cost': {'key': 'reservationCost', 'type': 'float'}, 'total_reservation_cost': {'key': 'totalReservationCost', 'type': 'float'}, + 'reserved_unit_count': {'key': 'reservedUnitCount', 'type': 'float'}, 'savings': {'key': 'savings', 'type': 'float'}, } @@ -3631,6 +3675,7 @@ def __init__( self.quantity = None self.reservation_cost = None self.total_reservation_cost = None + self.reserved_unit_count = kwargs.get('reserved_unit_count', None) self.savings = None @@ -3647,6 +3692,10 @@ class ReservationRecommendationDetailsModel(Resource): :vartype type: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] + :param location: Resource Location. + :type location: str + :param sku: Resource sku. + :type sku: str :ivar currency: An ISO 4217 currency code identifier for the costs and savings. :vartype currency: str :ivar resource: Resource specific properties. @@ -3681,6 +3730,8 @@ class ReservationRecommendationDetailsModel(Resource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'str'}, 'currency': {'key': 'properties.currency', 'type': 'str'}, 'resource': {'key': 'properties.resource', 'type': 'ReservationRecommendationDetailsResourceProperties'}, 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, @@ -3694,6 +3745,8 @@ def __init__( **kwargs ): super(ReservationRecommendationDetailsModel, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.sku = kwargs.get('sku', None) self.currency = None self.resource = None self.resource_group = None @@ -4131,12 +4184,18 @@ class TagsResult(ProxyResource): :type e_tag: str :param tags: A set of tags. A list of Tag. :type tags: list[~azure.mgmt.consumption.models.Tag] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + :ivar previous_link: The link (url) to the previous page of results. + :vartype previous_link: str """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'next_link': {'readonly': True}, + 'previous_link': {'readonly': True}, } _attribute_map = { @@ -4145,6 +4204,8 @@ class TagsResult(ProxyResource): 'type': {'key': 'type', 'type': 'str'}, 'e_tag': {'key': 'eTag', 'type': 'str'}, 'tags': {'key': 'properties.tags', 'type': '[Tag]'}, + 'next_link': {'key': 'properties.nextLink', 'type': 'str'}, + 'previous_link': {'key': 'properties.previousLink', 'type': 'str'}, } def __init__( @@ -4153,6 +4214,8 @@ def __init__( ): super(TagsResult, self).__init__(**kwargs) self.tags = kwargs.get('tags', None) + self.next_link = None + self.previous_link = None class UsageDetailsListResult(msrest.serialization.Model): diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/_models_py3.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/_models_py3.py index 538e12dfb7e8..0cf28939dc72 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/_models_py3.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/_models_py3.py @@ -1251,7 +1251,7 @@ class LegacyReservationRecommendation(ReservationRecommendation): :ivar look_back_period: The number of days of usage to look back for recommendation. :vartype look_back_period: str :ivar instance_flexibility_ratio: The instance Flexibility Ratio. - :vartype instance_flexibility_ratio: int + :vartype instance_flexibility_ratio: float :ivar instance_flexibility_group: The instance Flexibility Group. :vartype instance_flexibility_group: str :ivar normalized_size: The normalized Size. @@ -1311,7 +1311,7 @@ class LegacyReservationRecommendation(ReservationRecommendation): 'tags': {'key': 'tags', 'type': '{str}'}, 'kind': {'key': 'kind', 'type': 'str'}, 'look_back_period': {'key': 'properties.lookBackPeriod', 'type': 'str'}, - 'instance_flexibility_ratio': {'key': 'properties.instanceFlexibilityRatio', 'type': 'int'}, + 'instance_flexibility_ratio': {'key': 'properties.instanceFlexibilityRatio', 'type': 'float'}, 'instance_flexibility_group': {'key': 'properties.instanceFlexibilityGroup', 'type': 'str'}, 'normalized_size': {'key': 'properties.normalizedSize', 'type': 'str'}, 'recommended_quantity_normalized': {'key': 'properties.recommendedQuantityNormalized', 'type': 'float'}, @@ -1348,7 +1348,47 @@ def __init__( self.sku_properties = None -class ReservationTransaction(Resource): +class ReservationTransactionResource(msrest.serialization.Model): + """The Resource model definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(ReservationTransactionResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.tags = None + + +class ReservationTransaction(ReservationTransactionResource): """Reservation transaction resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -1360,7 +1400,7 @@ class ReservationTransaction(Resource): :ivar type: Resource type. :vartype type: str :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] + :vartype tags: list[str] :ivar event_date: The date of the transaction. :vartype event_date: ~datetime.datetime :ivar reservation_order_id: The reservation order ID is the identifier for a reservation @@ -1439,7 +1479,7 @@ class ReservationTransaction(Resource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + 'tags': {'key': 'tags', 'type': '[str]'}, 'event_date': {'key': 'properties.eventDate', 'type': 'iso-8601'}, 'reservation_order_id': {'key': 'properties.reservationOrderId', 'type': 'str'}, 'description': {'key': 'properties.description', 'type': 'str'}, @@ -1501,7 +1541,7 @@ class LegacyReservationTransaction(ReservationTransaction): :ivar type: Resource type. :vartype type: str :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] + :vartype tags: list[str] :ivar event_date: The date of the transaction. :vartype event_date: ~datetime.datetime :ivar reservation_order_id: The reservation order ID is the identifier for a reservation @@ -1580,7 +1620,7 @@ class LegacyReservationTransaction(ReservationTransaction): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + 'tags': {'key': 'tags', 'type': '[str]'}, 'event_date': {'key': 'properties.eventDate', 'type': 'iso-8601'}, 'reservation_order_id': {'key': 'properties.reservationOrderId', 'type': 'str'}, 'description': {'key': 'properties.description', 'type': 'str'}, @@ -2551,7 +2591,7 @@ class ModernReservationRecommendation(ReservationRecommendation): :ivar look_back_period: The number of days of usage to look back for recommendation. :vartype look_back_period: str :ivar instance_flexibility_ratio: The instance Flexibility Ratio. - :vartype instance_flexibility_ratio: int + :vartype instance_flexibility_ratio: float :ivar instance_flexibility_group: The instance Flexibility Group. :vartype instance_flexibility_group: str :ivar normalized_size: The normalized Size. @@ -2611,7 +2651,7 @@ class ModernReservationRecommendation(ReservationRecommendation): 'tags': {'key': 'tags', 'type': '{str}'}, 'kind': {'key': 'kind', 'type': 'str'}, 'look_back_period': {'key': 'properties.lookBackPeriod', 'type': 'str'}, - 'instance_flexibility_ratio': {'key': 'properties.instanceFlexibilityRatio', 'type': 'int'}, + 'instance_flexibility_ratio': {'key': 'properties.instanceFlexibilityRatio', 'type': 'float'}, 'instance_flexibility_group': {'key': 'properties.instanceFlexibilityGroup', 'type': 'str'}, 'normalized_size': {'key': 'properties.normalizedSize', 'type': 'str'}, 'recommended_quantity_normalized': {'key': 'properties.recommendedQuantityNormalized', 'type': 'float'}, @@ -2648,7 +2688,7 @@ def __init__( self.sku_properties = None -class ModernReservationTransaction(Resource): +class ModernReservationTransaction(ReservationTransactionResource): """Modern Reservation transaction resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -2660,7 +2700,7 @@ class ModernReservationTransaction(Resource): :ivar type: Resource type. :vartype type: str :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] + :vartype tags: list[str] :ivar amount: The charge of the transaction. :vartype amount: float :ivar arm_sku_name: This is the ARM Sku name. It can be used to join with the serviceType field @@ -2738,7 +2778,7 @@ class ModernReservationTransaction(Resource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + 'tags': {'key': 'tags', 'type': '[str]'}, 'amount': {'key': 'properties.amount', 'type': 'float'}, 'arm_sku_name': {'key': 'properties.armSkuName', 'type': 'str'}, 'billing_frequency': {'key': 'properties.billingFrequency', 'type': 'str'}, @@ -3654,6 +3694,9 @@ class ReservationRecommendationDetailsCalculatedSavingsProperties(msrest.seriali :vartype reservation_cost: float :ivar total_reservation_cost: The cost of the suggested quantity. :vartype total_reservation_cost: float + :param reserved_unit_count: The number of reserved units used to calculate savings. Always 1 + for virtual machines. + :type reserved_unit_count: float :ivar savings: The amount saved by purchasing the recommended quantity of reservation. :vartype savings: float """ @@ -3673,11 +3716,14 @@ class ReservationRecommendationDetailsCalculatedSavingsProperties(msrest.seriali 'quantity': {'key': 'quantity', 'type': 'float'}, 'reservation_cost': {'key': 'reservationCost', 'type': 'float'}, 'total_reservation_cost': {'key': 'totalReservationCost', 'type': 'float'}, + 'reserved_unit_count': {'key': 'reservedUnitCount', 'type': 'float'}, 'savings': {'key': 'savings', 'type': 'float'}, } def __init__( self, + *, + reserved_unit_count: Optional[float] = None, **kwargs ): super(ReservationRecommendationDetailsCalculatedSavingsProperties, self).__init__(**kwargs) @@ -3686,6 +3732,7 @@ def __init__( self.quantity = None self.reservation_cost = None self.total_reservation_cost = None + self.reserved_unit_count = reserved_unit_count self.savings = None @@ -3702,6 +3749,10 @@ class ReservationRecommendationDetailsModel(Resource): :vartype type: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] + :param location: Resource Location. + :type location: str + :param sku: Resource sku. + :type sku: str :ivar currency: An ISO 4217 currency code identifier for the costs and savings. :vartype currency: str :ivar resource: Resource specific properties. @@ -3736,6 +3787,8 @@ class ReservationRecommendationDetailsModel(Resource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'str'}, 'currency': {'key': 'properties.currency', 'type': 'str'}, 'resource': {'key': 'properties.resource', 'type': 'ReservationRecommendationDetailsResourceProperties'}, 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, @@ -3746,9 +3799,14 @@ class ReservationRecommendationDetailsModel(Resource): def __init__( self, + *, + location: Optional[str] = None, + sku: Optional[str] = None, **kwargs ): super(ReservationRecommendationDetailsModel, self).__init__(**kwargs) + self.location = location + self.sku = sku self.currency = None self.resource = None self.resource_group = None @@ -4190,12 +4248,18 @@ class TagsResult(ProxyResource): :type e_tag: str :param tags: A set of tags. A list of Tag. :type tags: list[~azure.mgmt.consumption.models.Tag] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + :ivar previous_link: The link (url) to the previous page of results. + :vartype previous_link: str """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'next_link': {'readonly': True}, + 'previous_link': {'readonly': True}, } _attribute_map = { @@ -4204,6 +4268,8 @@ class TagsResult(ProxyResource): 'type': {'key': 'type', 'type': 'str'}, 'e_tag': {'key': 'eTag', 'type': 'str'}, 'tags': {'key': 'properties.tags', 'type': '[Tag]'}, + 'next_link': {'key': 'properties.nextLink', 'type': 'str'}, + 'previous_link': {'key': 'properties.previousLink', 'type': 'str'}, } def __init__( @@ -4215,6 +4281,8 @@ def __init__( ): super(TagsResult, self).__init__(e_tag=e_tag, **kwargs) self.tags = tags + self.next_link = None + self.previous_link = None class UsageDetailsListResult(msrest.serialization.Model): diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_aggregated_cost_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_aggregated_cost_operations.py index 15b597bcbee7..ccf5e9b480db 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_aggregated_cost_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_aggregated_cost_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class AggregatedCostOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def get_by_management_group( filter=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ManagementGroupAggregatedCostResult" + # type: (...) -> "_models.ManagementGroupAggregatedCostResult" """Provides the aggregate cost of a management group and all child management groups by current billing period. @@ -66,7 +66,7 @@ def get_by_management_group( :rtype: ~azure.mgmt.consumption.models.ManagementGroupAggregatedCostResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ManagementGroupAggregatedCostResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagementGroupAggregatedCostResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -97,7 +97,7 @@ def get_by_management_group( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ManagementGroupAggregatedCostResult', pipeline_response) @@ -114,7 +114,7 @@ def get_for_billing_period_by_management_group( billing_period_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ManagementGroupAggregatedCostResult" + # type: (...) -> "_models.ManagementGroupAggregatedCostResult" """Provides the aggregate cost of a management group and all child management groups by specified billing period. @@ -127,7 +127,7 @@ def get_for_billing_period_by_management_group( :rtype: ~azure.mgmt.consumption.models.ManagementGroupAggregatedCostResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ManagementGroupAggregatedCostResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagementGroupAggregatedCostResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -157,7 +157,7 @@ def get_for_billing_period_by_management_group( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ManagementGroupAggregatedCostResult', pipeline_response) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_balances_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_balances_operations.py index 41ce62cee94a..5556d12d355f 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_balances_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_balances_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class BalancesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def get_by_billing_account( billing_account_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Balance" + # type: (...) -> "_models.Balance" """Gets the balances for a scope by billingAccountId. Balances are available via this API only for May 1, 2014 or later. @@ -60,7 +60,7 @@ def get_by_billing_account( :rtype: ~azure.mgmt.consumption.models.Balance :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Balance"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Balance"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -89,7 +89,7 @@ def get_by_billing_account( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Balance', pipeline_response) @@ -106,7 +106,7 @@ def get_for_billing_period_by_billing_account( billing_period_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Balance" + # type: (...) -> "_models.Balance" """Gets the balances for a scope by billing period and billingAccountId. Balances are available via this API only for May 1, 2014 or later. @@ -119,7 +119,7 @@ def get_for_billing_period_by_billing_account( :rtype: ~azure.mgmt.consumption.models.Balance :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Balance"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Balance"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -149,7 +149,7 @@ def get_for_billing_period_by_billing_account( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Balance', pipeline_response) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_budgets_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_budgets_operations.py index ebbad1714f53..c50bf7bc303c 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_budgets_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_budgets_operations.py @@ -1,4 +1,4 @@ - # coding=utf-8 +# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class BudgetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( scope, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.BudgetsListResult"] + # type: (...) -> Iterable["_models.BudgetsListResult"] """Lists all budgets for the defined scope. :param scope: The scope associated with budget operations. This includes @@ -73,7 +73,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.consumption.models.BudgetsListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BudgetsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BudgetsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -118,7 +118,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -135,7 +135,7 @@ def get( budget_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Budget" + # type: (...) -> "_models.Budget" """Gets the budget for the scope by budget name. :param scope: The scope associated with budget operations. This includes @@ -160,7 +160,7 @@ def get( :rtype: ~azure.mgmt.consumption.models.Budget :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Budget"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Budget"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -190,7 +190,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Budget', pipeline_response) @@ -205,10 +205,10 @@ def create_or_update( self, scope, # type: str budget_name, # type: str - parameters, # type: "models.Budget" + parameters, # type: "_models.Budget" **kwargs # type: Any ): - # type: (...) -> "models.Budget" + # type: (...) -> "_models.Budget" """The operation to create or update a budget. Update operation requires latest eTag to be set in the request mandatorily. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag. @@ -237,7 +237,7 @@ def create_or_update( :rtype: ~azure.mgmt.consumption.models.Budget :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Budget"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Budget"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -272,7 +272,7 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -348,7 +348,7 @@ def delete( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_charges_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_charges_operations.py index 0baf018d481a..52fcba6f0225 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_charges_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_charges_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ChargesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( apply=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ChargesListResult" + # type: (...) -> "_models.ChargesListResult" """Lists the charges based for the defined scope. :param scope: The scope associated with charges operations. This includes @@ -91,7 +91,7 @@ def list( :rtype: ~azure.mgmt.consumption.models.ChargesListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ChargesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ChargesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -128,7 +128,7 @@ def list( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ChargesListResult', pipeline_response) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_credits_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_credits_operations.py index e1524adcdb9b..4a66919ad61d 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_credits_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_credits_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class CreditsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def get( billing_profile_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.CreditSummary" + # type: (...) -> "_models.CreditSummary" """The credit summary by billingAccountId and billingProfileId. :param billing_account_id: BillingAccount ID. @@ -62,7 +62,7 @@ def get( :rtype: ~azure.mgmt.consumption.models.CreditSummary :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CreditSummary"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CreditSummary"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -92,7 +92,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('CreditSummary', pipeline_response) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_events_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_events_operations.py index e47c48f548fb..60491b1fa499 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_events_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_events_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class EventsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( end_date, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.Events"] + # type: (...) -> Iterable["_models.Events"] """Lists the events by billingAccountId and billingProfileId for given start and end date. :param billing_account_id: BillingAccount ID. @@ -69,7 +69,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.consumption.models.Events] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Events"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Events"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -117,7 +117,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_forecasts_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_forecasts_operations.py index 817430c3ac3b..507a13eb386c 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_forecasts_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_forecasts_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ForecastsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( filter=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.ForecastsListResult"] + # type: (...) -> Iterable["_models.ForecastsListResult"] """Lists the forecast charges by subscriptionId. :param filter: May be used to filter forecasts by properties/usageDate (Utc time), @@ -62,7 +62,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.consumption.models.ForecastsListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ForecastsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ForecastsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,7 +109,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_lots_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_lots_operations.py index 3e6ee7d91541..2ce4ec50c139 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_lots_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_lots_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LotsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( billing_profile_id, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.Lots"] + # type: (...) -> Iterable["_models.Lots"] """Lists the lots by billingAccountId and billingProfileId. :param billing_account_id: BillingAccount ID. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.consumption.models.Lots] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Lots"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Lots"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,7 +109,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_marketplaces_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_marketplaces_operations.py index c03b00aaced0..40e846b0e68a 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_marketplaces_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_marketplaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class MarketplacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( skiptoken=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.MarketplacesListResult"] + # type: (...) -> Iterable["_models.MarketplacesListResult"] """Lists the marketplaces for a scope at the defined scope. Marketplaces are available via this API only for May 1, 2014 or later. @@ -85,7 +85,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.consumption.models.MarketplacesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MarketplacesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MarketplacesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -136,7 +136,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_operations.py index e413fa9eb9a6..813dfd60a360 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class Operations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.OperationListResult"] + # type: (...) -> Iterable["_models.OperationListResult"] """Lists all of the available consumption REST API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.consumption.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -98,7 +98,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_price_sheet_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_price_sheet_operations.py index a4276af439dc..e9a983b25ece 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_price_sheet_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_price_sheet_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class PriceSheetOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def get( top=None, # type: Optional[int] **kwargs # type: Any ): - # type: (...) -> "models.PriceSheetResult" + # type: (...) -> "_models.PriceSheetResult" """Gets the price sheet for a scope by subscriptionId. Price sheet is available via this API only for May 1, 2014 or later. @@ -69,7 +69,7 @@ def get( :rtype: ~azure.mgmt.consumption.models.PriceSheetResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PriceSheetResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PriceSheetResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,7 +104,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PriceSheetResult', pipeline_response) @@ -123,7 +123,7 @@ def get_by_billing_period( top=None, # type: Optional[int] **kwargs # type: Any ): - # type: (...) -> "models.PriceSheetResult" + # type: (...) -> "_models.PriceSheetResult" """Get the price sheet for a scope by subscriptionId and billing period. Price sheet is available via this API only for May 1, 2014 or later. @@ -143,7 +143,7 @@ def get_by_billing_period( :rtype: ~azure.mgmt.consumption.models.PriceSheetResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PriceSheetResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PriceSheetResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -179,7 +179,7 @@ def get_by_billing_period( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PriceSheetResult', pipeline_response) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_reservation_recommendation_details_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_reservation_recommendation_details_operations.py index 948e2758abec..103b363b2977 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_reservation_recommendation_details_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_reservation_recommendation_details_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ReservationRecommendationDetailsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -47,14 +47,14 @@ def __init__(self, client, config, serializer, deserializer): def get( self, billing_scope, # type: str - scope, # type: Union[str, "models.Scope"] + scope, # type: Union[str, "_models.Scope"] region, # type: str - term, # type: Union[str, "models.Term"] - look_back_period, # type: Union[str, "models.LookBackPeriod"] + term, # type: Union[str, "_models.Term"] + look_back_period, # type: Union[str, "_models.LookBackPeriod"] product, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.ReservationRecommendationDetailsModel"] + # type: (...) -> Optional["_models.ReservationRecommendationDetailsModel"] """Details of a reservation recommendation for what-if analysis of reserved instances. :param billing_scope: The scope associated with reservation recommendation details operations. @@ -81,7 +81,7 @@ def get( :rtype: ~azure.mgmt.consumption.models.ReservationRecommendationDetailsModel or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ReservationRecommendationDetailsModel"]] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ReservationRecommendationDetailsModel"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -115,7 +115,7 @@ def get( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_reservation_recommendations_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_reservation_recommendations_operations.py index e1506a292066..4ccabe6916da 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_reservation_recommendations_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_reservation_recommendations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ReservationRecommendationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( filter=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.ReservationRecommendationsListResult"] + # type: (...) -> Iterable["_models.ReservationRecommendationsListResult"] """List of recommendations for purchasing reserved instances. :param scope: The scope associated with reservation recommendations operations. This includes @@ -71,10 +71,10 @@ def list( :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ReservationRecommendationsListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.consumption.models.ReservationRecommendationsListResult] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.consumption.models.ReservationRecommendationsListResultor None] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ReservationRecommendationsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ReservationRecommendationsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -120,8 +120,8 @@ def get_next(next_link=None): pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + if response.status_code not in [200, 204]: + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_reservation_transactions_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_reservation_transactions_operations.py index a2c5ca45f105..6a880e33d835 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_reservation_transactions_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_reservation_transactions_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ReservationTransactionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( filter=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.ReservationTransactionsListResult"] + # type: (...) -> Iterable["_models.ReservationTransactionsListResult"] """List of transactions for reserved instances on billing account scope. :param billing_account_id: BillingAccount ID. @@ -64,7 +64,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.consumption.models.ReservationTransactionsListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ReservationTransactionsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ReservationTransactionsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,7 +111,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -129,7 +129,7 @@ def list_by_billing_profile( filter=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.ModernReservationTransactionsListResult"] + # type: (...) -> Iterable["_models.ModernReservationTransactionsListResult"] """List of transactions for reserved instances on billing account scope. :param billing_account_id: BillingAccount ID. @@ -144,7 +144,7 @@ def list_by_billing_profile( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.consumption.models.ModernReservationTransactionsListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ModernReservationTransactionsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ModernReservationTransactionsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -192,7 +192,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_reservations_details_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_reservations_details_operations.py index aad043fae6c0..f36ae1dea425 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_reservations_details_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_reservations_details_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ReservationsDetailsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list_by_reservation_order( filter, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ReservationDetailsListResult"] + # type: (...) -> Iterable["_models.ReservationDetailsListResult"] """Lists the reservations details for provided date range. :param reservation_order_id: Order Id of the reservation. @@ -64,7 +64,7 @@ def list_by_reservation_order( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.consumption.models.ReservationDetailsListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ReservationDetailsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ReservationDetailsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,7 +110,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -128,7 +128,7 @@ def list_by_reservation_order_and_reservation( filter, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ReservationDetailsListResult"] + # type: (...) -> Iterable["_models.ReservationDetailsListResult"] """Lists the reservations details for provided date range. :param reservation_order_id: Order Id of the reservation. @@ -143,7 +143,7 @@ def list_by_reservation_order_and_reservation( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.consumption.models.ReservationDetailsListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ReservationDetailsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ReservationDetailsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -190,7 +190,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -211,7 +211,7 @@ def list( reservation_order_id=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.ReservationDetailsListResult"] + # type: (...) -> Iterable["_models.ReservationDetailsListResult"] """Lists the reservations details for the defined scope and provided date range. :param scope: The scope associated with reservations details operations. This includes @@ -239,7 +239,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.consumption.models.ReservationDetailsListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ReservationDetailsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ReservationDetailsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -294,7 +294,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_reservations_summaries_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_reservations_summaries_operations.py index a443bb835a6c..3a8ed1bb990b 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_reservations_summaries_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_reservations_summaries_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ReservationsSummariesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -48,11 +48,11 @@ def __init__(self, client, config, serializer, deserializer): def list_by_reservation_order( self, reservation_order_id, # type: str - grain, # type: Union[str, "models.Datagrain"] + grain, # type: Union[str, "_models.Datagrain"] filter=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.ReservationSummariesListResult"] + # type: (...) -> Iterable["_models.ReservationSummariesListResult"] """Lists the reservations summaries for daily or monthly grain. :param reservation_order_id: Order Id of the reservation. @@ -67,7 +67,7 @@ def list_by_reservation_order( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.consumption.models.ReservationSummariesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ReservationSummariesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ReservationSummariesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -115,7 +115,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -130,11 +130,11 @@ def list_by_reservation_order_and_reservation( self, reservation_order_id, # type: str reservation_id, # type: str - grain, # type: Union[str, "models.Datagrain"] + grain, # type: Union[str, "_models.Datagrain"] filter=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.ReservationSummariesListResult"] + # type: (...) -> Iterable["_models.ReservationSummariesListResult"] """Lists the reservations summaries for daily or monthly grain. :param reservation_order_id: Order Id of the reservation. @@ -151,7 +151,7 @@ def list_by_reservation_order_and_reservation( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.consumption.models.ReservationSummariesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ReservationSummariesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ReservationSummariesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -200,7 +200,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -214,7 +214,7 @@ def get_next(next_link=None): def list( self, scope, # type: str - grain, # type: Union[str, "models.Datagrain"] + grain, # type: Union[str, "_models.Datagrain"] start_date=None, # type: Optional[str] end_date=None, # type: Optional[str] filter=None, # type: Optional[str] @@ -222,7 +222,7 @@ def list( reservation_order_id=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.ReservationSummariesListResult"] + # type: (...) -> Iterable["_models.ReservationSummariesListResult"] """Lists the reservations summaries for the defined scope daily or monthly grain. :param scope: The scope associated with reservations summaries operations. This includes @@ -251,7 +251,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.consumption.models.ReservationSummariesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ReservationSummariesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ReservationSummariesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -307,7 +307,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_tags_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_tags_operations.py index 06cdb67f9bc1..e6cedfb6f459 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_tags_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_tags_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class TagsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def get( scope, # type: str **kwargs # type: Any ): - # type: (...) -> "models.TagsResult" + # type: (...) -> "_models.TagsResult" """Get all available tag keys for the defined scope. :param scope: The scope associated with tags operations. This includes @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.consumption.models.TagsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.TagsResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.TagsResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -97,7 +97,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('TagsResult', pipeline_response) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_usage_details_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_usage_details_operations.py index 9a3cef471610..ea7090e301f1 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_usage_details_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_usage_details_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsageDetailsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,10 +52,10 @@ def list( filter=None, # type: Optional[str] skiptoken=None, # type: Optional[str] top=None, # type: Optional[int] - metric=None, # type: Optional[Union[str, "models.Metrictype"]] + metric=None, # type: Optional[Union[str, "_models.Metrictype"]] **kwargs # type: Any ): - # type: (...) -> Iterable["models.UsageDetailsListResult"] + # type: (...) -> Iterable["_models.UsageDetailsListResult"] """Lists the usage details for the defined scope. Usage details are available via this API only for May 1, 2014 or later. @@ -104,7 +104,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.consumption.models.UsageDetailsListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsageDetailsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageDetailsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -159,7 +159,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)