From 250c82eddfc9b86e6b17e095087ae982ee99f558 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 7 Jun 2021 17:26:42 +0000 Subject: [PATCH] CodeGen from PR 14453 in Azure/azure-rest-api-specs Merge 2caa8f85942d71cde1aec87ffa731f45b5ce988d into 10c93ad91d3f44f62f2568a5b480c538a7c15daf --- .../azure-mgmt-consumption/MANIFEST.in | 1 + .../azure-mgmt-consumption/_meta.json | 11 + .../azure/mgmt/consumption/_configuration.py | 2 +- .../_consumption_management_client.py | 19 + .../azure/mgmt/consumption/_metadata.json | 120 ++++ .../azure/mgmt/consumption/_version.py | 2 +- .../mgmt/consumption/aio/_configuration.py | 2 +- .../aio/_consumption_management_client.py | 18 + .../operations/_aggregated_cost_operations.py | 14 +- .../aio/operations/_balances_operations.py | 12 +- .../aio/operations/_budgets_operations.py | 30 +- .../aio/operations/_charges_operations.py | 6 +- .../aio/operations/_credits_operations.py | 6 +- .../aio/operations/_events_operations.py | 93 ++- .../aio/operations/_forecasts_operations.py | 10 +- .../aio/operations/_lots_operations.py | 95 ++- .../operations/_marketplaces_operations.py | 6 +- .../consumption/aio/operations/_operations.py | 6 +- .../aio/operations/_price_sheet_operations.py | 16 +- ...ation_recommendation_details_operations.py | 26 +- ..._reservation_recommendations_operations.py | 6 +- .../_reservation_transactions_operations.py | 12 +- .../_reservations_details_operations.py | 18 +- .../_reservations_summaries_operations.py | 18 +- .../aio/operations/_tags_operations.py | 18 +- .../operations/_usage_details_operations.py | 6 +- .../azure/mgmt/consumption/models/__init__.py | 20 + .../_consumption_management_client_enums.py | 50 +- .../azure/mgmt/consumption/models/_models.py | 639 ++++++++++++++--- .../mgmt/consumption/models/_models_py3.py | 642 +++++++++++++++--- .../operations/_aggregated_cost_operations.py | 10 +- .../operations/_balances_operations.py | 8 +- .../operations/_budgets_operations.py | 22 +- .../operations/_charges_operations.py | 4 +- .../operations/_credits_operations.py | 4 +- .../operations/_events_operations.py | 92 ++- .../operations/_forecasts_operations.py | 8 +- .../operations/_lots_operations.py | 94 ++- .../operations/_marketplaces_operations.py | 4 +- .../consumption/operations/_operations.py | 4 +- .../operations/_price_sheet_operations.py | 12 +- ...ation_recommendation_details_operations.py | 24 +- ..._reservation_recommendations_operations.py | 4 +- .../_reservation_transactions_operations.py | 8 +- .../_reservations_details_operations.py | 12 +- .../_reservations_summaries_operations.py | 12 +- .../operations/_tags_operations.py | 16 +- .../operations/_usage_details_operations.py | 4 +- 48 files changed, 1877 insertions(+), 389 deletions(-) create mode 100644 sdk/consumption/azure-mgmt-consumption/_meta.json create mode 100644 sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/_metadata.json diff --git a/sdk/consumption/azure-mgmt-consumption/MANIFEST.in b/sdk/consumption/azure-mgmt-consumption/MANIFEST.in index a3cb07df8765..3a9b6517412b 100644 --- a/sdk/consumption/azure-mgmt-consumption/MANIFEST.in +++ b/sdk/consumption/azure-mgmt-consumption/MANIFEST.in @@ -1,3 +1,4 @@ +include _meta.json recursive-include tests *.py *.yaml include *.md include azure/__init__.py diff --git a/sdk/consumption/azure-mgmt-consumption/_meta.json b/sdk/consumption/azure-mgmt-consumption/_meta.json new file mode 100644 index 000000000000..384f665c8676 --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/_meta.json @@ -0,0 +1,11 @@ +{ + "autorest": "3.4.2", + "use": [ + "@autorest/python@5.8.0", + "@autorest/modelerfour@4.19.2" + ], + "commit": "716a3885a85217d98b3ac1b4b8a0be146ebd8cc4", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/consumption/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.0 --use=@autorest/modelerfour@4.19.2 --version=3.4.2", + "readme": "specification/consumption/resource-manager/readme.md" +} \ No newline at end of file diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/_configuration.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/_configuration.py index 23d380af7ac4..f6197c163e7f 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/_configuration.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/_configuration.py @@ -48,7 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2019-10-01" + self.api_version = "2021-05-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-consumption/{}'.format(VERSION)) self._configure(**kwargs) 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..3d5cb2329a51 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 @@ -16,6 +16,7 @@ from typing import Any, Optional from azure.core.credentials import TokenCredential + from azure.core.pipeline.transport import HttpRequest, HttpResponse from ._configuration import ConsumptionManagementClientConfiguration from .operations import UsageDetailsOperations @@ -140,6 +141,24 @@ def __init__( self.credits = CreditsOperations( self._client, self._config, self._serialize, self._deserialize) + def _send_request(self, http_request, **kwargs): + # type: (HttpRequest, Any) -> HttpResponse + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.HttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + def close(self): # type: () -> None self._client.close() 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..52a27381b512 --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/_metadata.json @@ -0,0 +1,120 @@ +{ + "chosen_version": "2021-05-01", + "total_api_version_list": ["2021-05-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": false, + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ConsumptionManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ConsumptionManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + }, + "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: \"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: str,", + "description": "Azure Subscription ID.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=None, # type: Optional[str]", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: Optional[str] = None,", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } + }, + "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, + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + }, + "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" + } +} \ 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 142a0420b39b..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.0" +VERSION = "2.0.0" diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/_configuration.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/_configuration.py index 35ea926982d4..719a3e99bb4a 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/_configuration.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/_configuration.py @@ -45,7 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2019-10-01" + self.api_version = "2021-05-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-consumption/{}'.format(VERSION)) self._configure(**kwargs) 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..4616d581d2bc 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 @@ -8,6 +8,7 @@ from typing import Any, Optional, TYPE_CHECKING +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer @@ -137,6 +138,23 @@ def __init__( self.credits = CreditsOperations( self._client, self._config, self._serialize, self._deserialize) + async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + async def close(self) -> None: await self._client.close() 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 b601898dfeea..1c608ec6eb67 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 @@ -44,7 +44,7 @@ async def get_by_management_group( self, management_group_id: str, filter: Optional[str] = None, - **kwargs + **kwargs: Any ) -> "_models.ManagementGroupAggregatedCostResult": """Provides the aggregate cost of a management group and all child management groups by current billing period. @@ -66,7 +66,7 @@ async def get_by_management_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" # Construct URL @@ -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.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ManagementGroupAggregatedCostResult', pipeline_response) @@ -107,7 +107,7 @@ async def get_for_billing_period_by_management_group( self, management_group_id: str, billing_period_name: str, - **kwargs + **kwargs: Any ) -> "_models.ManagementGroupAggregatedCostResult": """Provides the aggregate cost of a management group and all child management groups by specified billing period. @@ -126,7 +126,7 @@ async def get_for_billing_period_by_management_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" # Construct URL @@ -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.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ManagementGroupAggregatedCostResult', pipeline_response) @@ -160,4 +160,4 @@ async def get_for_billing_period_by_management_group( return cls(pipeline_response, deserialized, {}) return deserialized - get_for_billing_period_by_management_group.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/Microsoft.Consumption/aggregatedcost'} # type: ignore + get_for_billing_period_by_management_group.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/Microsoft.Consumption/aggregatedCost'} # type: ignore 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 1183848b2622..0003f869167d 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 @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def get_by_billing_account( self, billing_account_id: str, - **kwargs + **kwargs: Any ) -> "_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 @@ async def get_by_billing_account( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" # Construct URL @@ -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.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Balance', pipeline_response) @@ -99,7 +99,7 @@ async def get_for_billing_period_by_billing_account( self, billing_account_id: str, billing_period_name: str, - **kwargs + **kwargs: Any ) -> "_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. @@ -118,7 +118,7 @@ async def get_for_billing_period_by_billing_account( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" # Construct URL @@ -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.failsafe_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 7d802a0352a9..1ed2a23a5222 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 @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, scope: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.BudgetsListResult"]: """Lists all budgets for the defined scope. @@ -73,7 +73,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" def prepare_request(next_link=None): @@ -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.failsafe_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 @@ async def get( self, scope: str, budget_name: str, - **kwargs + **kwargs: Any ) -> "_models.Budget": """Gets the budget for the scope by budget name. @@ -159,7 +159,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" # Construct URL @@ -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.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Budget', pipeline_response) @@ -200,11 +200,11 @@ async def create_or_update( scope: str, budget_name: str, parameters: "_models.Budget", - **kwargs + **kwargs: Any ) -> "_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. + """The operation to create or update a budget. You can optionally provide an eTag if desired as a + form of concurrency control. To obtain the latest eTag for a given budget, perform a get + operation prior to your put operation. :param scope: The scope associated with budget operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, @@ -235,7 +235,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -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.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -284,7 +284,7 @@ async def delete( self, scope: str, budget_name: str, - **kwargs + **kwargs: Any ) -> None: """The operation to delete a budget. @@ -315,7 +315,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" # Construct URL @@ -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.failsafe_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 11aedcb34bc1..dc5daf186ede 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 @@ -47,7 +47,7 @@ async def list( end_date: Optional[str] = None, filter: Optional[str] = None, apply: Optional[str] = None, - **kwargs + **kwargs: Any ) -> "_models.ChargesListResult": """Lists the charges based for the defined scope. @@ -91,7 +91,7 @@ async def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" # Construct URL @@ -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.failsafe_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 a02204f3ecfa..1046c86edd79 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 @@ -44,7 +44,7 @@ async def get( self, billing_account_id: str, billing_profile_id: str, - **kwargs + **kwargs: Any ) -> "_models.CreditSummary": """The credit summary by billingAccountId and billingProfileId. @@ -62,7 +62,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" # Construct URL @@ -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.failsafe_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 e77643642dbd..2637ab4bcfb6 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 @@ -41,15 +41,16 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config - def list( + def list_by_billing_profile( self, billing_account_id: str, billing_profile_id: str, start_date: str, end_date: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.Events"]: - """Lists the events by billingAccountId and billingProfileId for given start and end date. + """Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a + billing account or a billing profile for a given start and end date. :param billing_account_id: BillingAccount ID. :type billing_account_id: str @@ -69,7 +70,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" def prepare_request(next_link=None): @@ -79,7 +80,7 @@ def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list.metadata['url'] # type: ignore + url = self.list_by_billing_profile.metadata['url'] # type: ignore path_format_arguments = { 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), 'billingProfileId': self._serialize.url("billing_profile_id", billing_profile_id, 'str'), @@ -112,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.failsafe_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) @@ -121,4 +122,82 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.Consumption/events'} # type: ignore + list_by_billing_profile.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.Consumption/events'} # type: ignore + + def list_by_billing_account( + self, + billing_account_id: str, + filter: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.Events"]: + """Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a + billing account or a billing profile for a given start and end date. + + :param billing_account_id: BillingAccount ID. + :type billing_account_id: str + :param filter: May be used to filter the events by lotId, lotSource etc. The filter supports + 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. + Tag filter is a key value pair string where key and value is separated by a colon (:). + :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 Events or the result of cls(response) + :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"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_billing_account.metadata['url'] # type: ignore + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('Events', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + 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.failsafe_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) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/events'} # type: ignore 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 3e0e3c744c1d..022eaf9b7588 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 @@ -44,9 +44,11 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, filter: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ForecastsListResult"]: - """Lists the forecast charges by subscriptionId. + """Lists the forecast charges for scope defined. Please note that this API is no longer actively + under development. We recommend using our new Forecast API moving forward: + https://docs.microsoft.com/en-us/rest/api/cost-management/forecast/usage. :param filter: May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', @@ -62,7 +64,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" def prepare_request(next_link=None): @@ -104,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.failsafe_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 67a4242e7980..e7bb61963f48 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 @@ -41,13 +41,15 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config - def list( + def list_by_billing_profile( self, billing_account_id: str, billing_profile_id: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.Lots"]: - """Lists the lots by billingAccountId and billingProfileId. + """Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a + billing profile. Microsoft Azure consumption commitments are only supported for the billing + account scope. :param billing_account_id: BillingAccount ID. :type billing_account_id: str @@ -63,7 +65,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" def prepare_request(next_link=None): @@ -73,7 +75,7 @@ def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list.metadata['url'] # type: ignore + url = self.list_by_billing_profile.metadata['url'] # type: ignore path_format_arguments = { 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), 'billingProfileId': self._serialize.url("billing_profile_id", billing_profile_id, 'str'), @@ -104,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.failsafe_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) @@ -113,4 +115,83 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.Consumption/lots'} # type: ignore + list_by_billing_profile.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.Consumption/lots'} # type: ignore + + def list_by_billing_account( + self, + billing_account_id: str, + filter: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.Lots"]: + """Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a + billing profile. Microsoft Azure consumption commitments are only supported for the billing + account scope. + + :param billing_account_id: BillingAccount ID. + :type billing_account_id: str + :param filter: May be used to filter the lots by Status, Source etc. The filter supports 'eq', + 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag + filter is a key value pair string where key and value is separated by a colon (:). + :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 Lots or the result of cls(response) + :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"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_billing_account.metadata['url'] # type: ignore + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('Lots', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + 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.failsafe_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) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/lots'} # type: ignore 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 ecee0de3e21c..028aaf148739 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 @@ -47,7 +47,7 @@ def list( filter: Optional[str] = None, top: Optional[int] = None, skiptoken: Optional[str] = None, - **kwargs + **kwargs: Any ) -> 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. @@ -85,7 +85,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" def prepare_request(next_link=None): @@ -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.failsafe_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 f00db289824f..5fc692bd45c8 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 @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available consumption REST API operations. @@ -57,7 +57,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" def prepare_request(next_link=None): @@ -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.failsafe_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 5401fa5f599f..88d00607f516 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 @@ -45,10 +45,10 @@ async def get( expand: Optional[str] = None, skiptoken: Optional[str] = None, top: Optional[int] = None, - **kwargs + **kwargs: Any ) -> "_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. + """Gets the price sheet for a subscription. Price sheet is available via this API only for May 1, + 2014 or later. :param expand: May be used to expand the properties/meterDetails within a price sheet. By default, these fields are not included when returning price sheet. @@ -69,7 +69,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" # Construct URL @@ -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.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PriceSheetResult', pipeline_response) @@ -116,7 +116,7 @@ async def get_by_billing_period( expand: Optional[str] = None, skiptoken: Optional[str] = None, top: Optional[int] = None, - **kwargs + **kwargs: Any ) -> "_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. @@ -142,7 +142,7 @@ async def get_by_billing_period( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" # Construct URL @@ -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.failsafe_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 549bdc224285..4389c7af9811 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 @@ -42,25 +42,25 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def get( self, - billing_scope: str, - scope: Union[str, "_models.Scope"], + scope: str, + scope1: Union[str, "_models.Scope"], region: str, term: Union[str, "_models.Term"], look_back_period: Union[str, "_models.LookBackPeriod"], product: str, - **kwargs + **kwargs: Any ) -> 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. - This includes '/subscriptions/{subscriptionId}/' for subscription scope, + :param scope: The scope associated with reservation recommendation details operations. This + includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope. - :type billing_scope: str - :param scope: Scope of the reservation. - :type scope: str or ~azure.mgmt.consumption.models.Scope + :type scope: str + :param scope1: Scope of the reservation. + :type scope1: str or ~azure.mgmt.consumption.models.Scope :param region: Used to select the region the recommendation should be generated for. :type region: str :param term: Specify length of reservation recommendation term. @@ -81,20 +81,20 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'billingScope': self._serialize.url("billing_scope", billing_scope, 'str', skip_quote=True), + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - query_parameters['scope'] = self._serialize.query("scope", scope, 'str') + query_parameters['scope'] = self._serialize.query("scope1", scope1, 'str') query_parameters['region'] = self._serialize.query("region", region, 'str') query_parameters['term'] = self._serialize.query("term", term, 'str') query_parameters['lookBackPeriod'] = self._serialize.query("look_back_period", look_back_period, 'str') @@ -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.failsafe_deserialize(_models.HighCasedErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -121,4 +121,4 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/{billingScope}/providers/Microsoft.Consumption/reservationRecommendationDetails'} # type: ignore + get.metadata = {'url': '/{scope}/providers/Microsoft.Consumption/reservationRecommendationDetails'} # type: ignore 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 09d049fac676..c7c7fc01b8c2 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 @@ -45,7 +45,7 @@ def list( self, scope: str, filter: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ReservationRecommendationsListResult"]: """List of recommendations for purchasing reserved instances. @@ -74,7 +74,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" def prepare_request(next_link=None): @@ -116,7 +116,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200, 204]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_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 c6f5f7abcb98..46253fa20a2f 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 @@ -45,7 +45,7 @@ def list( self, billing_account_id: str, filter: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ReservationTransactionsListResult"]: """List of transactions for reserved instances on billing account scope. @@ -64,7 +64,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" def prepare_request(next_link=None): @@ -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.failsafe_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_billing_profile( billing_account_id: str, billing_profile_id: str, filter: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ModernReservationTransactionsListResult"]: """List of transactions for reserved instances on billing account scope. @@ -143,7 +143,7 @@ def list_by_billing_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" def prepare_request(next_link=None): @@ -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.failsafe_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 caa00e154eb2..b8fa982d270a 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 @@ -45,7 +45,7 @@ def list_by_reservation_order( self, reservation_order_id: str, filter: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ReservationDetailsListResult"]: """Lists the reservations details for provided date range. @@ -64,7 +64,7 @@ def list_by_reservation_order( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" def prepare_request(next_link=None): @@ -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.failsafe_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) @@ -121,7 +121,7 @@ def list_by_reservation_order_and_reservation( reservation_order_id: str, reservation_id: str, filter: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ReservationDetailsListResult"]: """Lists the reservations details for provided date range. @@ -142,7 +142,7 @@ def list_by_reservation_order_and_reservation( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" def prepare_request(next_link=None): @@ -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.failsafe_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) @@ -203,7 +203,7 @@ def list( filter: Optional[str] = None, reservation_id: Optional[str] = None, reservation_order_id: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ReservationDetailsListResult"]: """Lists the reservations details for the defined scope and provided date range. @@ -237,7 +237,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" def prepare_request(next_link=None): @@ -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.failsafe_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 29209bda5139..737c02d5eb98 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 @@ -46,7 +46,7 @@ def list_by_reservation_order( reservation_order_id: str, grain: Union[str, "_models.Datagrain"], filter: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ReservationSummariesListResult"]: """Lists the reservations summaries for daily or monthly grain. @@ -67,7 +67,7 @@ def list_by_reservation_order( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" def prepare_request(next_link=None): @@ -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.failsafe_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) @@ -127,7 +127,7 @@ def list_by_reservation_order_and_reservation( reservation_id: str, grain: Union[str, "_models.Datagrain"], filter: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ReservationSummariesListResult"]: """Lists the reservations summaries for daily or monthly grain. @@ -150,7 +150,7 @@ def list_by_reservation_order_and_reservation( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" def prepare_request(next_link=None): @@ -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.failsafe_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 list( filter: Optional[str] = None, reservation_id: Optional[str] = None, reservation_order_id: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ReservationSummariesListResult"]: """Lists the reservations summaries for the defined scope daily or monthly grain. @@ -249,7 +249,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" def prepare_request(next_link=None): @@ -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.failsafe_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 a2f7be0f3a48..645c8e3e5b23 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 @@ -43,8 +43,8 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def get( self, scope: str, - **kwargs - ) -> "_models.TagsResult": + **kwargs: Any + ) -> Optional["_models.TagsResult"]: """Get all available tag keys for the defined scope. :param scope: The scope associated with tags operations. This includes @@ -60,15 +60,15 @@ async def get( :type scope: str :keyword callable cls: A custom type or function that will be passed the direct response :return: TagsResult, or the result of cls(response) - :rtype: ~azure.mgmt.consumption.models.TagsResult + :rtype: ~azure.mgmt.consumption.models.TagsResult or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.TagsResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.TagsResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" # Construct URL @@ -90,12 +90,14 @@ async def get( pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + 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.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('TagsResult', pipeline_response) + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TagsResult', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) 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 b2642f737faf..292772d0a0ff 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 @@ -49,7 +49,7 @@ def list( skiptoken: Optional[str] = None, top: Optional[int] = None, metric: Optional[Union[str, "_models.Metrictype"]] = None, - **kwargs + **kwargs: Any ) -> 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. @@ -104,7 +104,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" def prepare_request(next_link=None): @@ -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.failsafe_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 5683bcba3659..ee059780d0f9 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 @@ -8,6 +8,7 @@ try: from ._models_py3 import Amount + from ._models_py3 import AmountWithExchangeRate from ._models_py3 import Balance from ._models_py3 import BalancePropertiesAdjustmentDetailsItem from ._models_py3 import BalancePropertiesNewPurchasesDetailsItem @@ -22,13 +23,17 @@ from ._models_py3 import CreditBalanceSummary from ._models_py3 import CreditSummary from ._models_py3 import CurrentSpend + from ._models_py3 import DownloadProperties from ._models_py3 import ErrorDetails from ._models_py3 import ErrorResponse from ._models_py3 import EventSummary from ._models_py3 import Events from ._models_py3 import Forecast from ._models_py3 import ForecastPropertiesConfidenceLevelsItem + from ._models_py3 import ForecastSpend from ._models_py3 import ForecastsListResult + from ._models_py3 import HighCasedErrorDetails + from ._models_py3 import HighCasedErrorResponse from ._models_py3 import LegacyChargeSummary from ._models_py3 import LegacyReservationRecommendation from ._models_py3 import LegacyReservationTransaction @@ -52,6 +57,7 @@ from ._models_py3 import PriceSheetProperties from ._models_py3 import PriceSheetResult from ._models_py3 import ProxyResource + from ._models_py3 import Reseller from ._models_py3 import ReservationDetail from ._models_py3 import ReservationDetailsListResult from ._models_py3 import ReservationRecommendation @@ -75,6 +81,7 @@ from ._models_py3 import UsageDetailsListResult except (SyntaxError, ImportError): from ._models import Amount # type: ignore + from ._models import AmountWithExchangeRate # type: ignore from ._models import Balance # type: ignore from ._models import BalancePropertiesAdjustmentDetailsItem # type: ignore from ._models import BalancePropertiesNewPurchasesDetailsItem # type: ignore @@ -89,13 +96,17 @@ from ._models import CreditBalanceSummary # type: ignore from ._models import CreditSummary # type: ignore from ._models import CurrentSpend # type: ignore + from ._models import DownloadProperties # type: ignore from ._models import ErrorDetails # type: ignore from ._models import ErrorResponse # type: ignore from ._models import EventSummary # type: ignore from ._models import Events # type: ignore from ._models import Forecast # type: ignore from ._models import ForecastPropertiesConfidenceLevelsItem # type: ignore + from ._models import ForecastSpend # type: ignore from ._models import ForecastsListResult # type: ignore + from ._models import HighCasedErrorDetails # type: ignore + from ._models import HighCasedErrorResponse # type: ignore from ._models import LegacyChargeSummary # type: ignore from ._models import LegacyReservationRecommendation # type: ignore from ._models import LegacyReservationTransaction # type: ignore @@ -119,6 +130,7 @@ from ._models import PriceSheetProperties # type: ignore from ._models import PriceSheetResult # type: ignore from ._models import ProxyResource # type: ignore + from ._models import Reseller # type: ignore from ._models import ReservationDetail # type: ignore from ._models import ReservationDetailsListResult # type: ignore from ._models import ReservationRecommendation # type: ignore @@ -157,6 +169,7 @@ OperatorType, ReservationRecommendationKind, Scope, + Status, Term, ThresholdType, TimeGrainType, @@ -165,6 +178,7 @@ __all__ = [ 'Amount', + 'AmountWithExchangeRate', 'Balance', 'BalancePropertiesAdjustmentDetailsItem', 'BalancePropertiesNewPurchasesDetailsItem', @@ -179,13 +193,17 @@ 'CreditBalanceSummary', 'CreditSummary', 'CurrentSpend', + 'DownloadProperties', 'ErrorDetails', 'ErrorResponse', 'EventSummary', 'Events', 'Forecast', 'ForecastPropertiesConfidenceLevelsItem', + 'ForecastSpend', 'ForecastsListResult', + 'HighCasedErrorDetails', + 'HighCasedErrorResponse', 'LegacyChargeSummary', 'LegacyReservationRecommendation', 'LegacyReservationTransaction', @@ -209,6 +227,7 @@ 'PriceSheetProperties', 'PriceSheetResult', 'ProxyResource', + 'Reseller', 'ReservationDetail', 'ReservationDetailsListResult', 'ReservationRecommendation', @@ -245,6 +264,7 @@ 'OperatorType', 'ReservationRecommendationKind', 'Scope', + 'Status', 'Term', 'ThresholdType', 'TimeGrainType', diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/_consumption_management_client_enums.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/_consumption_management_client_enums.py index cd7ad1ca77c1..11b4ce5720c5 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/_consumption_management_client_enums.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/_consumption_management_client_enums.py @@ -69,11 +69,13 @@ class ChargeType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): class Datagrain(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - DAILY_GRAIN = "daily" #: Daily grain of data. - MONTHLY_GRAIN = "monthly" #: Monthly grain of data. + #: Daily grain of data. + DAILY_GRAIN = "daily" + #: Monthly grain of data. + MONTHLY_GRAIN = "monthly" class EventType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The type of event. + """Identifies the type of the event. """ SETTLED_CHARGES = "SettledCharges" @@ -85,7 +87,9 @@ class EventType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): NEW_CREDIT = "NewCredit" class Grain(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The granularity of forecast. + """The granularity of forecast. Please note that Yearly is not currently supported in this API. + The API will provide responses in the Monthly grain if Yearly is selected. To get yearly grain + data, please use our newer Forecast API. """ DAILY = "Daily" @@ -94,22 +98,29 @@ class Grain(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): class LookBackPeriod(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - LAST07_DAYS = "Last7Days" #: Use 7 days of data for recommendations. - LAST30_DAYS = "Last30Days" #: Use 30 days of data for recommendations. - LAST60_DAYS = "Last60Days" #: Use 60 days of data for recommendations. + #: Use 7 days of data for recommendations. + LAST07_DAYS = "Last7Days" + #: Use 30 days of data for recommendations. + LAST30_DAYS = "Last30Days" + #: Use 60 days of data for recommendations. + LAST60_DAYS = "Last60Days" class LotSource(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Lot source. + """The source of the lot. """ PURCHASED_CREDIT = "PurchasedCredit" PROMOTIONAL_CREDIT = "PromotionalCredit" + CONSUMPTION_COMMITMENT = "ConsumptionCommitment" class Metrictype(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - ACTUAL_COST_METRIC_TYPE = "actualcost" #: Actual cost data. - AMORTIZED_COST_METRIC_TYPE = "amortizedcost" #: Amortized cost data. - USAGE_METRIC_TYPE = "usage" #: Usage data. + #: Actual cost data. + ACTUAL_COST_METRIC_TYPE = "actualcost" + #: Amortized cost data. + AMORTIZED_COST_METRIC_TYPE = "amortizedcost" + #: Usage data. + USAGE_METRIC_TYPE = "usage" class OperatorType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The comparison operator. @@ -131,10 +142,23 @@ class Scope(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): SINGLE = "Single" SHARED = "Shared" +class Status(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The status of the lot. + """ + + NONE = "None" + ACTIVE = "Active" + INACTIVE = "Inactive" + EXPIRED = "Expired" + COMPLETE = "Complete" + CANCELED = "Canceled" + class Term(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - P1_Y = "P1Y" #: 1 year reservation term. - P3_Y = "P3Y" #: 3 year reservation term. + #: 1 year reservation term. + P1_Y = "P1Y" + #: 3 year reservation term. + P3_Y = "P3Y" class ThresholdType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The type of threshold 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 ba7caff4e715..3f1b36754aec 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 @@ -40,17 +40,49 @@ def __init__( self.value = None +class AmountWithExchangeRate(msrest.serialization.Model): + """The amount with exchange rate. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar exchange_rate: The exchange rate. + :vartype exchange_rate: float + :ivar exchange_rate_month: The exchange rate month. + :vartype exchange_rate_month: int + """ + + _validation = { + 'exchange_rate': {'readonly': True}, + 'exchange_rate_month': {'readonly': True}, + } + + _attribute_map = { + 'exchange_rate': {'key': 'exchangeRate', 'type': 'float'}, + 'exchange_rate_month': {'key': 'exchangeRateMonth', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(AmountWithExchangeRate, self).__init__(**kwargs) + self.exchange_rate = None + self.exchange_rate_month = None + + class Resource(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. + :ivar id: The full qualified ARM ID of an event. :vartype id: str - :ivar name: Resource name. + :ivar name: The ID that uniquely identifies an event. :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar etag: The etag for the resource. + :vartype etag: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] """ @@ -59,6 +91,7 @@ class Resource(msrest.serialization.Model): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'readonly': True}, 'tags': {'readonly': True}, } @@ -66,6 +99,7 @@ class Resource(msrest.serialization.Model): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, } @@ -77,6 +111,7 @@ def __init__( self.id = None self.name = None self.type = None + self.etag = None self.tags = None @@ -85,12 +120,14 @@ class Balance(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource Id. + :ivar id: The full qualified ARM ID of an event. :vartype id: str - :ivar name: Resource name. + :ivar name: The ID that uniquely identifies an event. :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar etag: The etag for the resource. + :vartype etag: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] :ivar currency: The ISO currency in which the meter is charged, for example, USD. @@ -133,6 +170,7 @@ class Balance(Resource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'readonly': True}, 'tags': {'readonly': True}, 'currency': {'readonly': True}, 'beginning_balance': {'readonly': True}, @@ -154,6 +192,7 @@ class Balance(Resource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'currency': {'key': 'properties.currency', 'type': 'str'}, 'beginning_balance': {'key': 'properties.beginningBalance', 'type': 'float'}, @@ -323,13 +362,15 @@ class Budget(ProxyResource): Future start date should not be more than twelve months. Past start date should be selected within the timegrain period. There are no restrictions on the end date. :type time_period: ~azure.mgmt.consumption.models.BudgetTimePeriod - :param filter: May be used to filter budgets by resource group, resource, or meter. + :param filter: May be used to filter budgets by user-specified dimensions and/or tags. :type filter: ~azure.mgmt.consumption.models.BudgetFilter :ivar current_spend: The current amount of cost which is being tracked for a budget. :vartype current_spend: ~azure.mgmt.consumption.models.CurrentSpend :param notifications: Dictionary of notifications associated with the budget. Budget can have up to five notifications. :type notifications: dict[str, ~azure.mgmt.consumption.models.Notification] + :ivar forecast_spend: The forecasted cost which is being tracked for a budget. + :vartype forecast_spend: ~azure.mgmt.consumption.models.ForecastSpend """ _validation = { @@ -337,6 +378,7 @@ class Budget(ProxyResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'current_spend': {'readonly': True}, + 'forecast_spend': {'readonly': True}, } _attribute_map = { @@ -351,6 +393,7 @@ class Budget(ProxyResource): 'filter': {'key': 'properties.filter', 'type': 'BudgetFilter'}, 'current_spend': {'key': 'properties.currentSpend', 'type': 'CurrentSpend'}, 'notifications': {'key': 'properties.notifications', 'type': '{Notification}'}, + 'forecast_spend': {'key': 'properties.forecastSpend', 'type': 'ForecastSpend'}, } def __init__( @@ -365,6 +408,7 @@ def __init__( self.filter = kwargs.get('filter', None) self.current_spend = None self.notifications = kwargs.get('notifications', None) + self.forecast_spend = None class BudgetComparisonExpression(msrest.serialization.Model): @@ -383,7 +427,7 @@ class BudgetComparisonExpression(msrest.serialization.Model): _validation = { 'name': {'required': True}, 'operator': {'required': True}, - 'values': {'required': True, 'min_items': 1}, + 'values': {'required': True}, } _attribute_map = { @@ -415,10 +459,6 @@ class BudgetFilter(msrest.serialization.Model): :type tags: ~azure.mgmt.consumption.models.BudgetComparisonExpression """ - _validation = { - 'and_property': {'min_items': 2}, - } - _attribute_map = { 'and_property': {'key': 'and', 'type': '[BudgetFilterProperties]'}, 'not_property': {'key': 'not', 'type': 'BudgetFilterProperties'}, @@ -555,12 +595,14 @@ class ChargeSummary(Resource): All required parameters must be populated in order to send to Azure. - :ivar id: Resource Id. + :ivar id: The full qualified ARM ID of an event. :vartype id: str - :ivar name: Resource name. + :ivar name: The ID that uniquely identifies an event. :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar etag: The etag for the resource. + :vartype etag: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] :param kind: Required. Specifies the kind of charge summary.Constant filled by server. @@ -572,6 +614,7 @@ class ChargeSummary(Resource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'readonly': True}, 'tags': {'readonly': True}, 'kind': {'required': True}, } @@ -580,6 +623,7 @@ class ChargeSummary(Resource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'kind': {'key': 'kind', 'type': 'str'}, } @@ -605,16 +649,21 @@ class CreditBalanceSummary(msrest.serialization.Model): :vartype estimated_balance: ~azure.mgmt.consumption.models.Amount :ivar current_balance: Current balance. :vartype current_balance: ~azure.mgmt.consumption.models.Amount + :ivar estimated_balance_in_billing_currency: Estimated balance in billing currency. + :vartype estimated_balance_in_billing_currency: + ~azure.mgmt.consumption.models.AmountWithExchangeRate """ _validation = { 'estimated_balance': {'readonly': True}, 'current_balance': {'readonly': True}, + 'estimated_balance_in_billing_currency': {'readonly': True}, } _attribute_map = { 'estimated_balance': {'key': 'estimatedBalance', 'type': 'Amount'}, 'current_balance': {'key': 'currentBalance', 'type': 'Amount'}, + 'estimated_balance_in_billing_currency': {'key': 'estimatedBalanceInBillingCurrency', 'type': 'AmountWithExchangeRate'}, } def __init__( @@ -624,6 +673,7 @@ def __init__( super(CreditBalanceSummary, self).__init__(**kwargs) self.estimated_balance = None self.current_balance = None + self.estimated_balance_in_billing_currency = None class CreditSummary(Resource): @@ -631,12 +681,14 @@ class CreditSummary(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource Id. + :ivar id: The full qualified ARM ID of an event. :vartype id: str - :ivar name: Resource name. + :ivar name: The ID that uniquely identifies an event. :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar etag: The etag for the resource. + :vartype etag: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] :ivar balance_summary: Summary of balances associated with this credit summary. @@ -647,28 +699,42 @@ class CreditSummary(Resource): :vartype expired_credit: ~azure.mgmt.consumption.models.Amount :ivar pending_eligible_charges: Pending eligible charges. :vartype pending_eligible_charges: ~azure.mgmt.consumption.models.Amount + :ivar credit_currency: The credit currency. + :vartype credit_currency: str + :ivar billing_currency: The billing currency. + :vartype billing_currency: str + :ivar reseller: Credit's reseller. + :vartype reseller: ~azure.mgmt.consumption.models.Reseller """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'readonly': True}, 'tags': {'readonly': True}, 'balance_summary': {'readonly': True}, 'pending_credit_adjustments': {'readonly': True}, 'expired_credit': {'readonly': True}, 'pending_eligible_charges': {'readonly': True}, + 'credit_currency': {'readonly': True}, + 'billing_currency': {'readonly': True}, + 'reseller': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'balance_summary': {'key': 'properties.balanceSummary', 'type': 'CreditBalanceSummary'}, 'pending_credit_adjustments': {'key': 'properties.pendingCreditAdjustments', 'type': 'Amount'}, 'expired_credit': {'key': 'properties.expiredCredit', 'type': 'Amount'}, 'pending_eligible_charges': {'key': 'properties.pendingEligibleCharges', 'type': 'Amount'}, + 'credit_currency': {'key': 'properties.creditCurrency', 'type': 'str'}, + 'billing_currency': {'key': 'properties.billingCurrency', 'type': 'str'}, + 'reseller': {'key': 'properties.reseller', 'type': 'Reseller'}, } def __init__( @@ -680,6 +746,9 @@ def __init__( self.pending_credit_adjustments = None self.expired_credit = None self.pending_eligible_charges = None + self.credit_currency = None + self.billing_currency = None + self.reseller = None class CurrentSpend(msrest.serialization.Model): @@ -712,6 +781,36 @@ def __init__( self.unit = None +class DownloadProperties(msrest.serialization.Model): + """The properties of the price sheet download. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar download_url: The link (url) to download the pricesheet. + :vartype download_url: str + :ivar valid_till: Download link validity. + :vartype valid_till: str + """ + + _validation = { + 'download_url': {'readonly': True}, + 'valid_till': {'readonly': True}, + } + + _attribute_map = { + 'download_url': {'key': 'downloadUrl', 'type': 'str'}, + 'valid_till': {'key': 'validTill', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DownloadProperties, self).__init__(**kwargs) + self.download_url = None + self.valid_till = None + + class ErrorDetails(msrest.serialization.Model): """The details of the error. @@ -805,40 +904,82 @@ class EventSummary(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource Id. + :ivar id: The full qualified ARM ID of an event. :vartype id: str - :ivar name: Resource name. + :ivar name: The ID that uniquely identifies an event. :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar etag: The etag for the resource. + :vartype etag: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] - :ivar transaction_date: Transaction date. + :ivar transaction_date: The date of the event. :vartype transaction_date: ~datetime.datetime - :ivar description: Transaction description. + :ivar description: The description of the event. :vartype description: str - :ivar new_credit: New Credit. + :ivar new_credit: The amount of new credit or commitment for NewCredit or SettleCharges event. :vartype new_credit: ~azure.mgmt.consumption.models.Amount - :ivar adjustments: Adjustments amount. + :ivar adjustments: The amount of balance adjustment. The property is not available for + ConsumptionCommitment lots. :vartype adjustments: ~azure.mgmt.consumption.models.Amount - :ivar credit_expired: Credit expired. + :ivar credit_expired: The amount of expired credit or commitment for NewCredit or SettleCharges + event. :vartype credit_expired: ~azure.mgmt.consumption.models.Amount - :ivar charges: Charges amount. + :ivar charges: The amount of charges for events of type SettleCharges and + PendingEligibleCharges. :vartype charges: ~azure.mgmt.consumption.models.Amount - :ivar closed_balance: Closed balance. + :ivar closed_balance: The balance after the event. :vartype closed_balance: ~azure.mgmt.consumption.models.Amount - :param event_type: The type of event. Possible values include: "SettledCharges", + :param event_type: Identifies the type of the event. Possible values include: "SettledCharges", "PendingCharges", "PendingAdjustments", "PendingNewCredit", "PendingExpiredCredit", "UnKnown", "NewCredit". :type event_type: str or ~azure.mgmt.consumption.models.EventType - :ivar invoice_number: Invoice number. + :ivar invoice_number: The number which uniquely identifies the invoice on which the event was + billed. This will be empty for unbilled events. :vartype invoice_number: str + :ivar billing_profile_id: The ID that uniquely identifies the billing profile for which the + event happened. The property is only available for billing account of type + MicrosoftCustomerAgreement. + :vartype billing_profile_id: str + :ivar billing_profile_display_name: The display name of the billing profile for which the event + happened. The property is only available for billing account of type + MicrosoftCustomerAgreement. + :vartype billing_profile_display_name: str + :ivar lot_id: The ID that uniquely identifies the lot for which the event happened. + :vartype lot_id: str + :ivar lot_source: Identifies the source of the lot for which the event happened. + :vartype lot_source: str + :ivar canceled_credit: Amount of canceled credit. + :vartype canceled_credit: ~azure.mgmt.consumption.models.Amount + :ivar credit_currency: The credit currency of the event. + :vartype credit_currency: str + :ivar billing_currency: The billing currency of the event. + :vartype billing_currency: str + :ivar reseller: The reseller of the event. + :vartype reseller: ~azure.mgmt.consumption.models.Reseller + :ivar credit_expired_in_billing_currency: The amount of expired credit or commitment for + NewCredit or SettleCharges event in billing currency. + :vartype credit_expired_in_billing_currency: + ~azure.mgmt.consumption.models.AmountWithExchangeRate + :ivar new_credit_in_billing_currency: The amount of new credit or commitment for NewCredit or + SettleCharges event in billing currency. + :vartype new_credit_in_billing_currency: ~azure.mgmt.consumption.models.AmountWithExchangeRate + :ivar adjustments_in_billing_currency: The amount of balance adjustment in billing currency. + :vartype adjustments_in_billing_currency: ~azure.mgmt.consumption.models.AmountWithExchangeRate + :ivar charges_in_billing_currency: The amount of charges for events of type SettleCharges and + PendingEligibleCharges in billing currency. + :vartype charges_in_billing_currency: ~azure.mgmt.consumption.models.AmountWithExchangeRate + :ivar closed_balance_in_billing_currency: The balance in billing currency after the event. + :vartype closed_balance_in_billing_currency: + ~azure.mgmt.consumption.models.AmountWithExchangeRate """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'readonly': True}, 'tags': {'readonly': True}, 'transaction_date': {'readonly': True}, 'description': {'readonly': True}, @@ -848,12 +989,26 @@ class EventSummary(Resource): 'charges': {'readonly': True}, 'closed_balance': {'readonly': True}, 'invoice_number': {'readonly': True}, + 'billing_profile_id': {'readonly': True}, + 'billing_profile_display_name': {'readonly': True}, + 'lot_id': {'readonly': True}, + 'lot_source': {'readonly': True}, + 'canceled_credit': {'readonly': True}, + 'credit_currency': {'readonly': True}, + 'billing_currency': {'readonly': True}, + 'reseller': {'readonly': True}, + 'credit_expired_in_billing_currency': {'readonly': True}, + 'new_credit_in_billing_currency': {'readonly': True}, + 'adjustments_in_billing_currency': {'readonly': True}, + 'charges_in_billing_currency': {'readonly': True}, + 'closed_balance_in_billing_currency': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'transaction_date': {'key': 'properties.transactionDate', 'type': 'iso-8601'}, 'description': {'key': 'properties.description', 'type': 'str'}, @@ -864,6 +1019,19 @@ class EventSummary(Resource): 'closed_balance': {'key': 'properties.closedBalance', 'type': 'Amount'}, 'event_type': {'key': 'properties.eventType', 'type': 'str'}, 'invoice_number': {'key': 'properties.invoiceNumber', 'type': 'str'}, + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'billing_profile_display_name': {'key': 'properties.billingProfileDisplayName', 'type': 'str'}, + 'lot_id': {'key': 'properties.lotId', 'type': 'str'}, + 'lot_source': {'key': 'properties.lotSource', 'type': 'str'}, + 'canceled_credit': {'key': 'properties.canceledCredit', 'type': 'Amount'}, + 'credit_currency': {'key': 'properties.creditCurrency', 'type': 'str'}, + 'billing_currency': {'key': 'properties.billingCurrency', 'type': 'str'}, + 'reseller': {'key': 'properties.reseller', 'type': 'Reseller'}, + 'credit_expired_in_billing_currency': {'key': 'properties.creditExpiredInBillingCurrency', 'type': 'AmountWithExchangeRate'}, + 'new_credit_in_billing_currency': {'key': 'properties.newCreditInBillingCurrency', 'type': 'AmountWithExchangeRate'}, + 'adjustments_in_billing_currency': {'key': 'properties.adjustmentsInBillingCurrency', 'type': 'AmountWithExchangeRate'}, + 'charges_in_billing_currency': {'key': 'properties.chargesInBillingCurrency', 'type': 'AmountWithExchangeRate'}, + 'closed_balance_in_billing_currency': {'key': 'properties.closedBalanceInBillingCurrency', 'type': 'AmountWithExchangeRate'}, } def __init__( @@ -880,6 +1048,19 @@ def __init__( self.closed_balance = None self.event_type = kwargs.get('event_type', None) self.invoice_number = None + self.billing_profile_id = None + self.billing_profile_display_name = None + self.lot_id = None + self.lot_source = None + self.canceled_credit = None + self.credit_currency = None + self.billing_currency = None + self.reseller = None + self.credit_expired_in_billing_currency = None + self.new_credit_in_billing_currency = None + self.adjustments_in_billing_currency = None + self.charges_in_billing_currency = None + self.closed_balance_in_billing_currency = None class Forecast(Resource): @@ -887,18 +1068,22 @@ class Forecast(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource Id. + :ivar id: The full qualified ARM ID of an event. :vartype id: str - :ivar name: Resource name. + :ivar name: The ID that uniquely identifies an event. :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar etag: The etag for the resource. + :vartype etag: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] :ivar usage_date: The usage date of the forecast. :vartype usage_date: str - :param grain: The granularity of forecast. Possible values include: "Daily", "Monthly", - "Yearly". + :param grain: The granularity of forecast. Please note that Yearly is not currently supported + in this API. The API will provide responses in the Monthly grain if Yearly is selected. To get + yearly grain data, please use our newer Forecast API. Possible values include: "Daily", + "Monthly", "Yearly". :type grain: str or ~azure.mgmt.consumption.models.Grain :ivar charge: The amount of charge. :vartype charge: float @@ -917,6 +1102,7 @@ class Forecast(Resource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'readonly': True}, 'tags': {'readonly': True}, 'usage_date': {'readonly': True}, 'charge': {'readonly': True}, @@ -928,6 +1114,7 @@ class Forecast(Resource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'usage_date': {'key': 'properties.usageDate', 'type': 'str'}, 'grain': {'key': 'properties.grain', 'type': 'str'}, @@ -1010,6 +1197,95 @@ def __init__( self.value = None +class ForecastSpend(msrest.serialization.Model): + """The forecasted cost which is being tracked for a budget. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar amount: The forecasted cost for the total time period which is being tracked by the + budget. This value is only provided if the budget contains a forecast alert type. + :vartype amount: float + :ivar unit: The unit of measure for the budget amount. + :vartype unit: str + """ + + _validation = { + 'amount': {'readonly': True}, + 'unit': {'readonly': True}, + } + + _attribute_map = { + 'amount': {'key': 'amount', 'type': 'float'}, + 'unit': {'key': 'unit', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ForecastSpend, self).__init__(**kwargs) + self.amount = None + self.unit = None + + +class HighCasedErrorDetails(msrest.serialization.Model): + """The details of the error. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Error code. + :vartype code: str + :ivar message: Error message indicating why the operation failed. + :vartype message: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HighCasedErrorDetails, self).__init__(**kwargs) + self.code = None + self.message = None + + +class HighCasedErrorResponse(msrest.serialization.Model): + """Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message. + +Some Error responses: + + +* + 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "x-ms-ratelimit-microsoft.consumption-retry-after" header. + +* + 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" header. + + :param error: The details of the error. + :type error: ~azure.mgmt.consumption.models.HighCasedErrorDetails + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'HighCasedErrorDetails'}, + } + + def __init__( + self, + **kwargs + ): + super(HighCasedErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + class LegacyChargeSummary(ChargeSummary): """Legacy charge summary. @@ -1017,12 +1293,14 @@ class LegacyChargeSummary(ChargeSummary): All required parameters must be populated in order to send to Azure. - :ivar id: Resource Id. + :ivar id: The full qualified ARM ID of an event. :vartype id: str - :ivar name: Resource name. + :ivar name: The ID that uniquely identifies an event. :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar etag: The etag for the resource. + :vartype etag: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] :param kind: Required. Specifies the kind of charge summary.Constant filled by server. @@ -1048,6 +1326,7 @@ class LegacyChargeSummary(ChargeSummary): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'readonly': True}, 'tags': {'readonly': True}, 'kind': {'required': True}, 'billing_period_id': {'readonly': True}, @@ -1063,6 +1342,7 @@ class LegacyChargeSummary(ChargeSummary): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'kind': {'key': 'kind', 'type': 'str'}, 'billing_period_id': {'key': 'properties.billingPeriodId', 'type': 'str'}, @@ -1133,12 +1413,14 @@ class ReservationRecommendation(Resource, ResourceAttributes): :vartype location: str :ivar sku: Resource sku. :vartype sku: str - :ivar id: Resource Id. + :ivar id: The full qualified ARM ID of an event. :vartype id: str - :ivar name: Resource name. + :ivar name: The ID that uniquely identifies an event. :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar etag: The etag for the resource. + :vartype etag: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] :param kind: Required. Specifies the kind of reservation recommendation.Constant filled by @@ -1152,6 +1434,7 @@ class ReservationRecommendation(Resource, ResourceAttributes): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'readonly': True}, 'tags': {'readonly': True}, 'kind': {'required': True}, } @@ -1162,6 +1445,7 @@ class ReservationRecommendation(Resource, ResourceAttributes): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'kind': {'key': 'kind', 'type': 'str'}, } @@ -1181,6 +1465,7 @@ def __init__( self.id = None self.name = None self.type = None + self.etag = None self.tags = None self.kind = 'ReservationRecommendation' # type: str @@ -1196,12 +1481,14 @@ class LegacyReservationRecommendation(ReservationRecommendation): :vartype location: str :ivar sku: Resource sku. :vartype sku: str - :ivar id: Resource Id. + :ivar id: The full qualified ARM ID of an event. :vartype id: str - :ivar name: Resource name. + :ivar name: The ID that uniquely identifies an event. :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar etag: The etag for the resource. + :vartype etag: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] :param kind: Required. Specifies the kind of reservation recommendation.Constant filled by @@ -1210,7 +1497,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. @@ -1219,6 +1506,8 @@ class LegacyReservationRecommendation(ReservationRecommendation): :vartype recommended_quantity_normalized: float :ivar meter_id: The meter id (GUID). :vartype meter_id: str + :ivar resource_type: The azure resource type. + :vartype resource_type: str :ivar term: RI recommendations in one or three year terms. :vartype term: str :ivar cost_with_no_reserved_instances: The total amount of cost without reserved instances. @@ -1243,6 +1532,7 @@ class LegacyReservationRecommendation(ReservationRecommendation): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'readonly': True}, 'tags': {'readonly': True}, 'kind': {'required': True}, 'look_back_period': {'readonly': True}, @@ -1251,6 +1541,7 @@ class LegacyReservationRecommendation(ReservationRecommendation): 'normalized_size': {'readonly': True}, 'recommended_quantity_normalized': {'readonly': True}, 'meter_id': {'readonly': True}, + 'resource_type': {'readonly': True}, 'term': {'readonly': True}, 'cost_with_no_reserved_instances': {'readonly': True}, 'recommended_quantity': {'readonly': True}, @@ -1267,14 +1558,16 @@ class LegacyReservationRecommendation(ReservationRecommendation): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, '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'}, 'meter_id': {'key': 'properties.meterId', 'type': 'str'}, + 'resource_type': {'key': 'properties.resourceType', 'type': 'str'}, 'term': {'key': 'properties.term', 'type': 'str'}, 'cost_with_no_reserved_instances': {'key': 'properties.costWithNoReservedInstances', 'type': 'float'}, 'recommended_quantity': {'key': 'properties.recommendedQuantity', 'type': 'float'}, @@ -1297,6 +1590,7 @@ def __init__( self.normalized_size = None self.recommended_quantity_normalized = None self.meter_id = None + self.resource_type = None self.term = None self.cost_with_no_reserved_instances = None self.recommended_quantity = None @@ -1619,12 +1913,14 @@ class UsageDetail(Resource): All required parameters must be populated in order to send to Azure. - :ivar id: Resource Id. + :ivar id: The full qualified ARM ID of an event. :vartype id: str - :ivar name: Resource name. + :ivar name: The ID that uniquely identifies an event. :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar etag: The etag for the resource. + :vartype etag: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] :param kind: Required. Specifies the kind of usage details.Constant filled by server. Possible @@ -1636,6 +1932,7 @@ class UsageDetail(Resource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'readonly': True}, 'tags': {'readonly': True}, 'kind': {'required': True}, } @@ -1644,6 +1941,7 @@ class UsageDetail(Resource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'kind': {'key': 'kind', 'type': 'str'}, } @@ -1667,12 +1965,14 @@ class LegacyUsageDetail(UsageDetail): All required parameters must be populated in order to send to Azure. - :ivar id: Resource Id. + :ivar id: The full qualified ARM ID of an event. :vartype id: str - :ivar name: Resource name. + :ivar name: The ID that uniquely identifies an event. :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar etag: The etag for the resource. + :vartype etag: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] :param kind: Required. Specifies the kind of usage details.Constant filled by server. Possible @@ -1728,13 +2028,13 @@ class LegacyUsageDetail(UsageDetail): :ivar consumed_service: Consumed service name. Name of the azure resource provider that emits the usage or was purchased. This value is not provided for marketplace usage. :vartype consumed_service: str - :ivar resource_id: Azure resource manager resource identifier. + :ivar resource_id: Unique identifier of the Azure Resource Manager usage detail resource. :vartype resource_id: str :ivar resource_name: Resource Name. :vartype resource_name: str - :ivar service_info1: Service Info 1. + :ivar service_info1: Service-specific metadata. :vartype service_info1: str - :ivar service_info2: Service Info 2. + :ivar service_info2: Legacy field with optional service-specific metadata. :vartype service_info2: str :ivar additional_info: Additional details of this usage item. By default this is not populated, unless it's specified in $expand. Use this field to get usage line item specific details such @@ -1785,6 +2085,7 @@ class LegacyUsageDetail(UsageDetail): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'readonly': True}, 'tags': {'readonly': True}, 'kind': {'required': True}, 'billing_account_id': {'readonly': True}, @@ -1835,6 +2136,7 @@ class LegacyUsageDetail(UsageDetail): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'kind': {'key': 'kind', 'type': 'str'}, 'billing_account_id': {'key': 'properties.billingAccountId', 'type': 'str'}, @@ -1966,32 +2268,55 @@ class LotSummary(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource Id. + :ivar id: The full qualified ARM ID of an event. :vartype id: str - :ivar name: Resource name. + :ivar name: The ID that uniquely identifies an event. :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar etag: The etag for the resource. + :vartype etag: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] - :ivar original_amount: Original amount. + :ivar original_amount: The original amount of a lot. :vartype original_amount: ~azure.mgmt.consumption.models.Amount - :ivar closed_balance: Closed balance. + :ivar closed_balance: The balance as of the last invoice. :vartype closed_balance: ~azure.mgmt.consumption.models.Amount - :ivar source: Lot source. Possible values include: "PurchasedCredit", "PromotionalCredit". + :ivar source: The source of the lot. Possible values include: "PurchasedCredit", + "PromotionalCredit", "ConsumptionCommitment". :vartype source: str or ~azure.mgmt.consumption.models.LotSource - :ivar start_date: Start date. + :ivar start_date: The date when the lot became effective. :vartype start_date: ~datetime.datetime - :ivar expiration_date: Expiration date. + :ivar expiration_date: The expiration date of a lot. :vartype expiration_date: ~datetime.datetime - :ivar po_number: PO number. + :ivar po_number: The po number of the invoice on which the lot was added. This property is not + available for ConsumptionCommitment lots. :vartype po_number: str + :ivar purchase_date: The date when the lot was added. + :vartype purchase_date: ~datetime.datetime + :ivar status: The status of the lot. Possible values include: "None", "Active", "Inactive", + "Expired", "Complete", "Canceled". + :vartype status: str or ~azure.mgmt.consumption.models.Status + :ivar credit_currency: The currency of the lot. + :vartype credit_currency: str + :ivar billing_currency: The billing currency of the lot. + :vartype billing_currency: str + :ivar original_amount_in_billing_currency: The original amount of a lot in billing currency. + :vartype original_amount_in_billing_currency: + ~azure.mgmt.consumption.models.AmountWithExchangeRate + :ivar closed_balance_in_billing_currency: The balance as of the last invoice in billing + currency. + :vartype closed_balance_in_billing_currency: + ~azure.mgmt.consumption.models.AmountWithExchangeRate + :ivar reseller: The reseller of the lot. + :vartype reseller: ~azure.mgmt.consumption.models.Reseller """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'readonly': True}, 'tags': {'readonly': True}, 'original_amount': {'readonly': True}, 'closed_balance': {'readonly': True}, @@ -1999,12 +2324,20 @@ class LotSummary(Resource): 'start_date': {'readonly': True}, 'expiration_date': {'readonly': True}, 'po_number': {'readonly': True}, + 'purchase_date': {'readonly': True}, + 'status': {'readonly': True}, + 'credit_currency': {'readonly': True}, + 'billing_currency': {'readonly': True}, + 'original_amount_in_billing_currency': {'readonly': True}, + 'closed_balance_in_billing_currency': {'readonly': True}, + 'reseller': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'original_amount': {'key': 'properties.originalAmount', 'type': 'Amount'}, 'closed_balance': {'key': 'properties.closedBalance', 'type': 'Amount'}, @@ -2012,6 +2345,13 @@ class LotSummary(Resource): 'start_date': {'key': 'properties.startDate', 'type': 'iso-8601'}, 'expiration_date': {'key': 'properties.expirationDate', 'type': 'iso-8601'}, 'po_number': {'key': 'properties.poNumber', 'type': 'str'}, + 'purchase_date': {'key': 'properties.purchaseDate', 'type': 'iso-8601'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'credit_currency': {'key': 'properties.creditCurrency', 'type': 'str'}, + 'billing_currency': {'key': 'properties.billingCurrency', 'type': 'str'}, + 'original_amount_in_billing_currency': {'key': 'properties.originalAmountInBillingCurrency', 'type': 'AmountWithExchangeRate'}, + 'closed_balance_in_billing_currency': {'key': 'properties.closedBalanceInBillingCurrency', 'type': 'AmountWithExchangeRate'}, + 'reseller': {'key': 'properties.reseller', 'type': 'Reseller'}, } def __init__( @@ -2025,6 +2365,13 @@ def __init__( self.start_date = None self.expiration_date = None self.po_number = None + self.purchase_date = None + self.status = None + self.credit_currency = None + self.billing_currency = None + self.original_amount_in_billing_currency = None + self.closed_balance_in_billing_currency = None + self.reseller = None class ManagementGroupAggregatedCostResult(Resource): @@ -2032,12 +2379,14 @@ class ManagementGroupAggregatedCostResult(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource Id. + :ivar id: The full qualified ARM ID of an event. :vartype id: str - :ivar name: Resource name. + :ivar name: The ID that uniquely identifies an event. :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar etag: The etag for the resource. + :vartype etag: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] :ivar billing_period_id: The id of the billing period resource that the aggregated cost belongs @@ -2069,6 +2418,7 @@ class ManagementGroupAggregatedCostResult(Resource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'readonly': True}, 'tags': {'readonly': True}, 'billing_period_id': {'readonly': True}, 'usage_start': {'readonly': True}, @@ -2083,6 +2433,7 @@ class ManagementGroupAggregatedCostResult(Resource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'billing_period_id': {'key': 'properties.billingPeriodId', 'type': 'str'}, 'usage_start': {'key': 'properties.usageStart', 'type': 'iso-8601'}, @@ -2114,16 +2465,18 @@ def __init__( class Marketplace(Resource): - """An marketplace resource. + """A marketplace resource. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource Id. + :ivar id: The full qualified ARM ID of an event. :vartype id: str - :ivar name: Resource name. + :ivar name: The ID that uniquely identifies an event. :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar etag: The etag for the resource. + :vartype etag: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] :ivar billing_period_id: The id of the billing period resource that the usage belongs to. @@ -2138,6 +2491,8 @@ class Marketplace(Resource): :vartype offer_name: str :ivar resource_group: The name of resource group. :vartype resource_group: str + :ivar additional_info: Additional information. + :vartype additional_info: str :ivar order_number: The order number. :vartype order_number: str :ivar instance_name: The name of the resource instance that the usage is about. @@ -2184,6 +2539,7 @@ class Marketplace(Resource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'readonly': True}, 'tags': {'readonly': True}, 'billing_period_id': {'readonly': True}, 'usage_start': {'readonly': True}, @@ -2191,6 +2547,7 @@ class Marketplace(Resource): 'resource_rate': {'readonly': True}, 'offer_name': {'readonly': True}, 'resource_group': {'readonly': True}, + 'additional_info': {'readonly': True}, 'order_number': {'readonly': True}, 'instance_name': {'readonly': True}, 'instance_id': {'readonly': True}, @@ -2216,6 +2573,7 @@ class Marketplace(Resource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'billing_period_id': {'key': 'properties.billingPeriodId', 'type': 'str'}, 'usage_start': {'key': 'properties.usageStart', 'type': 'iso-8601'}, @@ -2223,6 +2581,7 @@ class Marketplace(Resource): 'resource_rate': {'key': 'properties.resourceRate', 'type': 'float'}, 'offer_name': {'key': 'properties.offerName', 'type': 'str'}, 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'additional_info': {'key': 'properties.additionalInfo', 'type': 'str'}, 'order_number': {'key': 'properties.orderNumber', 'type': 'str'}, 'instance_name': {'key': 'properties.instanceName', 'type': 'str'}, 'instance_id': {'key': 'properties.instanceId', 'type': 'str'}, @@ -2255,6 +2614,7 @@ def __init__( self.resource_rate = None self.offer_name = None self.resource_group = None + self.additional_info = None self.order_number = None self.instance_name = None self.instance_id = None @@ -2429,12 +2789,14 @@ class ModernChargeSummary(ChargeSummary): All required parameters must be populated in order to send to Azure. - :ivar id: Resource Id. + :ivar id: The full qualified ARM ID of an event. :vartype id: str - :ivar name: Resource name. + :ivar name: The ID that uniquely identifies an event. :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar etag: The etag for the resource. + :vartype etag: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] :param kind: Required. Specifies the kind of charge summary.Constant filled by server. @@ -2468,6 +2830,7 @@ class ModernChargeSummary(ChargeSummary): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'readonly': True}, 'tags': {'readonly': True}, 'kind': {'required': True}, 'billing_period_id': {'readonly': True}, @@ -2487,6 +2850,7 @@ class ModernChargeSummary(ChargeSummary): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'kind': {'key': 'kind', 'type': 'str'}, 'billing_period_id': {'key': 'properties.billingPeriodId', 'type': 'str'}, @@ -2532,21 +2896,25 @@ class ModernReservationRecommendation(ReservationRecommendation): :vartype location: str :ivar sku: Resource sku. :vartype sku: str - :ivar id: Resource Id. + :ivar id: The full qualified ARM ID of an event. :vartype id: str - :ivar name: Resource name. + :ivar name: The ID that uniquely identifies an event. :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar etag: The etag for the resource. + :vartype etag: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] :param kind: Required. Specifies the kind of reservation recommendation.Constant filled by server. Possible values include: "legacy", "modern". :type kind: str or ~azure.mgmt.consumption.models.ReservationRecommendationKind + :ivar location_properties_location: Resource Location. + :vartype location_properties_location: str :ivar look_back_period: The number of days of usage to look back for recommendation. - :vartype look_back_period: str + :vartype look_back_period: int :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. @@ -2571,6 +2939,8 @@ class ModernReservationRecommendation(ReservationRecommendation): :vartype scope: str :ivar sku_properties: List of sku properties. :vartype sku_properties: list[~azure.mgmt.consumption.models.SkuProperty] + :ivar sku_name: This is the ARM Sku name. + :vartype sku_name: str """ _validation = { @@ -2579,8 +2949,10 @@ class ModernReservationRecommendation(ReservationRecommendation): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'readonly': True}, 'tags': {'readonly': True}, 'kind': {'required': True}, + 'location_properties_location': {'readonly': True}, 'look_back_period': {'readonly': True}, 'instance_flexibility_ratio': {'readonly': True}, 'instance_flexibility_group': {'readonly': True}, @@ -2595,6 +2967,7 @@ class ModernReservationRecommendation(ReservationRecommendation): 'first_usage_date': {'readonly': True}, 'scope': {'readonly': True}, 'sku_properties': {'readonly': True}, + 'sku_name': {'readonly': True}, } _attribute_map = { @@ -2603,10 +2976,12 @@ class ModernReservationRecommendation(ReservationRecommendation): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, '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'}, + 'location_properties_location': {'key': 'properties.location', 'type': 'str'}, + 'look_back_period': {'key': 'properties.lookBackPeriod', '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'}, @@ -2619,6 +2994,7 @@ class ModernReservationRecommendation(ReservationRecommendation): 'first_usage_date': {'key': 'properties.firstUsageDate', 'type': 'iso-8601'}, 'scope': {'key': 'properties.scope', 'type': 'str'}, 'sku_properties': {'key': 'properties.skuProperties', 'type': '[SkuProperty]'}, + 'sku_name': {'key': 'properties.skuName', 'type': 'str'}, } def __init__( @@ -2627,6 +3003,7 @@ def __init__( ): super(ModernReservationRecommendation, self).__init__(**kwargs) self.kind = 'modern' # type: str + self.location_properties_location = None self.look_back_period = None self.instance_flexibility_ratio = None self.instance_flexibility_group = None @@ -2641,6 +3018,7 @@ def __init__( self.first_usage_date = None self.scope = None self.sku_properties = None + self.sku_name = None class ModernReservationTransaction(ReservationTransactionResource): @@ -2820,12 +3198,14 @@ class ModernUsageDetail(UsageDetail): All required parameters must be populated in order to send to Azure. - :ivar id: Resource Id. + :ivar id: The full qualified ARM ID of an event. :vartype id: str - :ivar name: Resource name. + :ivar name: The ID that uniquely identifies an event. :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar etag: The etag for the resource. + :vartype etag: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] :param kind: Required. Specifies the kind of usage details.Constant filled by server. Possible @@ -2894,9 +3274,9 @@ class ModernUsageDetail(UsageDetail): :ivar consumed_service: Consumed service name. Name of the azure resource provider that emits the usage or was purchased. This value is not provided for marketplace usage. :vartype consumed_service: str - :ivar service_info1: Service Info 1. + :ivar service_info1: Service-specific metadata. :vartype service_info1: str - :ivar service_info2: Service Info 2. + :ivar service_info2: Legacy field with optional service-specific metadata. :vartype service_info2: str :ivar additional_info: Additional details of this usage item. Use this field to get usage line item specific details such as the actual VM Size (ServiceType) or the ratio in which the @@ -2966,8 +3346,8 @@ class ModernUsageDetail(UsageDetail): :vartype previous_invoice_id: str :ivar pricing_currency_code: Pricing Billing Currency. :vartype pricing_currency_code: str - :ivar product_identifier: Identifer for the product that has accrued charges by consumption or - purchase . This is the concatenated key of productId and SKuId in partner center. + :ivar product_identifier: Identifier for the product that has accrued charges by consumption or + purchase . This is the concatenated key of productId and SkuId in partner center. :vartype product_identifier: str :ivar resource_location_normalized: Resource Location Normalized. :vartype resource_location_normalized: str @@ -3006,12 +3386,15 @@ class ModernUsageDetail(UsageDetail): :ivar partner_earned_credit_applied: Flag to indicate if partner earned credit has been applied or not. :vartype partner_earned_credit_applied: str + :ivar pay_g_price: Retail price for the resource. + :vartype pay_g_price: float """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'readonly': True}, 'tags': {'readonly': True}, 'kind': {'required': True}, 'billing_account_id': {'readonly': True}, @@ -3079,12 +3462,14 @@ class ModernUsageDetail(UsageDetail): 'payg_cost_in_usd': {'readonly': True}, 'partner_earned_credit_rate': {'readonly': True}, 'partner_earned_credit_applied': {'readonly': True}, + 'pay_g_price': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'kind': {'key': 'kind', 'type': 'str'}, 'billing_account_id': {'key': 'properties.billingAccountId', 'type': 'str'}, @@ -3152,6 +3537,7 @@ class ModernUsageDetail(UsageDetail): 'payg_cost_in_usd': {'key': 'properties.paygCostInUSD', 'type': 'float'}, 'partner_earned_credit_rate': {'key': 'properties.partnerEarnedCreditRate', 'type': 'float'}, 'partner_earned_credit_applied': {'key': 'properties.partnerEarnedCreditApplied', 'type': 'str'}, + 'pay_g_price': {'key': 'properties.payGPrice', 'type': 'float'}, } def __init__( @@ -3225,6 +3611,7 @@ def __init__( self.payg_cost_in_usd = None self.partner_earned_credit_rate = None self.partner_earned_credit_applied = None + self.pay_g_price = None class Notification(msrest.serialization.Model): @@ -3242,15 +3629,19 @@ class Notification(msrest.serialization.Model): 1000. :type threshold: float :param contact_emails: Required. Email addresses to send the budget notification to when the - threshold is exceeded. + threshold is exceeded. Must have at least one contact email or contact group specified at the + Subscription or Resource Group scopes. All other scopes must have at least one contact email + specified. :type contact_emails: list[str] :param contact_roles: Contact roles to send the budget notification to when the threshold is exceeded. :type contact_roles: list[str] :param contact_groups: Action groups to send the budget notification to when the threshold is - exceeded. + exceeded. Must be provided as a fully qualified Azure resource id. Only supported at + Subscription or Resource Group scopes. :type contact_groups: list[str] - :param threshold_type: The type of threshold. Possible values include: "Actual". + :param threshold_type: The type of threshold. Possible values include: "Actual". Default value: + "Actual". :type threshold_type: str or ~azure.mgmt.consumption.models.ThresholdType """ @@ -3258,7 +3649,7 @@ class Notification(msrest.serialization.Model): 'enabled': {'required': True}, 'operator': {'required': True}, 'threshold': {'required': True}, - 'contact_emails': {'required': True, 'max_items': 50, 'min_items': 1}, + 'contact_emails': {'required': True, 'max_items': 50, 'min_items': 0}, 'contact_groups': {'max_items': 50, 'min_items': 0}, } @@ -3283,7 +3674,7 @@ def __init__( self.contact_emails = kwargs['contact_emails'] self.contact_roles = kwargs.get('contact_roles', None) self.contact_groups = kwargs.get('contact_groups', None) - self.threshold_type = kwargs.get('threshold_type', None) + self.threshold_type = kwargs.get('threshold_type', "Actual") class Operation(msrest.serialization.Model): @@ -3291,6 +3682,8 @@ class Operation(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. + :ivar id: Operation Id. + :vartype id: str :ivar name: Operation name: {provider}/{resource}/{operation}. :vartype name: str :param display: The object that represents the operation. @@ -3298,10 +3691,12 @@ class Operation(msrest.serialization.Model): """ _validation = { + 'id': {'readonly': True}, 'name': {'readonly': True}, } _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'display': {'key': 'display', 'type': 'OperationDisplay'}, } @@ -3311,6 +3706,7 @@ def __init__( **kwargs ): super(Operation, self).__init__(**kwargs) + self.id = None self.name = None self.display = kwargs.get('display', None) @@ -3326,18 +3722,22 @@ class OperationDisplay(msrest.serialization.Model): :vartype resource: str :ivar operation: Operation type: Read, write, delete, etc. :vartype operation: str + :ivar description: Description of the operation. + :vartype description: str """ _validation = { 'provider': {'readonly': True}, 'resource': {'readonly': True}, 'operation': {'readonly': True}, + 'description': {'readonly': True}, } _attribute_map = { 'provider': {'key': 'provider', 'type': 'str'}, 'resource': {'key': 'resource', 'type': 'str'}, 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, } def __init__( @@ -3348,6 +3748,7 @@ def __init__( self.provider = None self.resource = None self.operation = None + self.description = None class OperationListResult(msrest.serialization.Model): @@ -3452,36 +3853,44 @@ class PriceSheetResult(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource Id. + :ivar id: The full qualified ARM ID of an event. :vartype id: str - :ivar name: Resource name. + :ivar name: The ID that uniquely identifies an event. :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar etag: The etag for the resource. + :vartype etag: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] :ivar pricesheets: Price sheet. :vartype pricesheets: list[~azure.mgmt.consumption.models.PriceSheetProperties] :ivar next_link: The link (url) to the next page of results. :vartype next_link: str + :ivar download: Pricesheet download details. + :vartype download: ~azure.mgmt.consumption.models.MeterDetails """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'readonly': True}, 'tags': {'readonly': True}, 'pricesheets': {'readonly': True}, 'next_link': {'readonly': True}, + 'download': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'pricesheets': {'key': 'properties.pricesheets', 'type': '[PriceSheetProperties]'}, 'next_link': {'key': 'properties.nextLink', 'type': 'str'}, + 'download': {'key': 'properties.download', 'type': 'MeterDetails'}, } def __init__( @@ -3491,6 +3900,37 @@ def __init__( super(PriceSheetResult, self).__init__(**kwargs) self.pricesheets = None self.next_link = None + self.download = None + + +class Reseller(msrest.serialization.Model): + """The reseller properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar reseller_id: The reseller property ID. + :vartype reseller_id: str + :ivar reseller_description: The reseller property description. + :vartype reseller_description: str + """ + + _validation = { + 'reseller_id': {'readonly': True}, + 'reseller_description': {'readonly': True}, + } + + _attribute_map = { + 'reseller_id': {'key': 'resellerId', 'type': 'str'}, + 'reseller_description': {'key': 'resellerDescription', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Reseller, self).__init__(**kwargs) + self.reseller_id = None + self.reseller_description = None class ReservationDetail(Resource): @@ -3498,12 +3938,14 @@ class ReservationDetail(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource Id. + :ivar id: The full qualified ARM ID of an event. :vartype id: str - :ivar name: Resource name. + :ivar name: The ID that uniquely identifies an event. :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar etag: The etag for the resource. + :vartype etag: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] :ivar reservation_order_id: The reservation order ID is the identifier for a reservation @@ -3544,6 +3986,7 @@ class ReservationDetail(Resource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'readonly': True}, 'tags': {'readonly': True}, 'reservation_order_id': {'readonly': True}, 'instance_flexibility_ratio': {'readonly': True}, @@ -3562,6 +4005,7 @@ class ReservationDetail(Resource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'reservation_order_id': {'key': 'properties.reservationOrderId', 'type': 'str'}, 'instance_flexibility_ratio': {'key': 'properties.instanceFlexibilityRatio', 'type': 'str'}, @@ -3684,12 +4128,14 @@ class ReservationRecommendationDetailsModel(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource Id. + :ivar id: The full qualified ARM ID of an event. :vartype id: str - :ivar name: Resource name. + :ivar name: The ID that uniquely identifies an event. :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar etag: The etag for the resource. + :vartype etag: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] :param location: Resource Location. @@ -3716,6 +4162,7 @@ class ReservationRecommendationDetailsModel(Resource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'readonly': True}, 'tags': {'readonly': True}, 'currency': {'readonly': True}, 'resource': {'readonly': True}, @@ -3729,6 +4176,7 @@ class ReservationRecommendationDetailsModel(Resource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'location': {'key': 'location', 'type': 'str'}, 'sku': {'key': 'sku', 'type': 'str'}, @@ -3913,16 +4361,20 @@ class ReservationRecommendationsListResult(msrest.serialization.Model): :vartype value: list[~azure.mgmt.consumption.models.ReservationRecommendation] :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 = { 'value': {'readonly': True}, 'next_link': {'readonly': True}, + 'previous_link': {'readonly': True}, } _attribute_map = { 'value': {'key': 'value', 'type': '[ReservationRecommendation]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'previous_link': {'key': 'previousLink', 'type': 'str'}, } def __init__( @@ -3932,6 +4384,7 @@ def __init__( super(ReservationRecommendationsListResult, self).__init__(**kwargs) self.value = None self.next_link = None + self.previous_link = None class ReservationSummariesListResult(msrest.serialization.Model): @@ -3969,12 +4422,14 @@ class ReservationSummary(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource Id. + :ivar id: The full qualified ARM ID of an event. :vartype id: str - :ivar name: Resource name. + :ivar name: The ID that uniquely identifies an event. :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar etag: The etag for the resource. + :vartype etag: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] :ivar reservation_order_id: The reservation order ID is the identifier for a reservation @@ -4027,6 +4482,7 @@ class ReservationSummary(Resource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'readonly': True}, 'tags': {'readonly': True}, 'reservation_order_id': {'readonly': True}, 'reservation_id': {'readonly': True}, @@ -4049,6 +4505,7 @@ class ReservationSummary(Resource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'reservation_order_id': {'key': 'properties.reservationOrderId', 'type': 'str'}, 'reservation_id': {'key': 'properties.reservationId', 'type': 'str'}, @@ -4154,10 +4611,13 @@ class Tag(msrest.serialization.Model): :param key: Tag key. :type key: str + :param value: Tag values. + :type value: list[str] """ _attribute_map = { 'key': {'key': 'key', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[str]'}, } def __init__( @@ -4166,6 +4626,7 @@ def __init__( ): super(Tag, self).__init__(**kwargs) self.key = kwargs.get('key', None) + self.value = kwargs.get('value', None) class TagsResult(ProxyResource): @@ -4184,12 +4645,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 = { @@ -4198,6 +4665,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__( @@ -4206,6 +4675,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 aacfd19b6a23..0bee75ac661b 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 @@ -45,17 +45,49 @@ def __init__( self.value = None +class AmountWithExchangeRate(msrest.serialization.Model): + """The amount with exchange rate. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar exchange_rate: The exchange rate. + :vartype exchange_rate: float + :ivar exchange_rate_month: The exchange rate month. + :vartype exchange_rate_month: int + """ + + _validation = { + 'exchange_rate': {'readonly': True}, + 'exchange_rate_month': {'readonly': True}, + } + + _attribute_map = { + 'exchange_rate': {'key': 'exchangeRate', 'type': 'float'}, + 'exchange_rate_month': {'key': 'exchangeRateMonth', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(AmountWithExchangeRate, self).__init__(**kwargs) + self.exchange_rate = None + self.exchange_rate_month = None + + class Resource(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. + :ivar id: The full qualified ARM ID of an event. :vartype id: str - :ivar name: Resource name. + :ivar name: The ID that uniquely identifies an event. :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar etag: The etag for the resource. + :vartype etag: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] """ @@ -64,6 +96,7 @@ class Resource(msrest.serialization.Model): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'readonly': True}, 'tags': {'readonly': True}, } @@ -71,6 +104,7 @@ class Resource(msrest.serialization.Model): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, } @@ -82,6 +116,7 @@ def __init__( self.id = None self.name = None self.type = None + self.etag = None self.tags = None @@ -90,12 +125,14 @@ class Balance(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource Id. + :ivar id: The full qualified ARM ID of an event. :vartype id: str - :ivar name: Resource name. + :ivar name: The ID that uniquely identifies an event. :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar etag: The etag for the resource. + :vartype etag: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] :ivar currency: The ISO currency in which the meter is charged, for example, USD. @@ -138,6 +175,7 @@ class Balance(Resource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'readonly': True}, 'tags': {'readonly': True}, 'currency': {'readonly': True}, 'beginning_balance': {'readonly': True}, @@ -159,6 +197,7 @@ class Balance(Resource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'currency': {'key': 'properties.currency', 'type': 'str'}, 'beginning_balance': {'key': 'properties.beginningBalance', 'type': 'float'}, @@ -332,13 +371,15 @@ class Budget(ProxyResource): Future start date should not be more than twelve months. Past start date should be selected within the timegrain period. There are no restrictions on the end date. :type time_period: ~azure.mgmt.consumption.models.BudgetTimePeriod - :param filter: May be used to filter budgets by resource group, resource, or meter. + :param filter: May be used to filter budgets by user-specified dimensions and/or tags. :type filter: ~azure.mgmt.consumption.models.BudgetFilter :ivar current_spend: The current amount of cost which is being tracked for a budget. :vartype current_spend: ~azure.mgmt.consumption.models.CurrentSpend :param notifications: Dictionary of notifications associated with the budget. Budget can have up to five notifications. :type notifications: dict[str, ~azure.mgmt.consumption.models.Notification] + :ivar forecast_spend: The forecasted cost which is being tracked for a budget. + :vartype forecast_spend: ~azure.mgmt.consumption.models.ForecastSpend """ _validation = { @@ -346,6 +387,7 @@ class Budget(ProxyResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'current_spend': {'readonly': True}, + 'forecast_spend': {'readonly': True}, } _attribute_map = { @@ -360,6 +402,7 @@ class Budget(ProxyResource): 'filter': {'key': 'properties.filter', 'type': 'BudgetFilter'}, 'current_spend': {'key': 'properties.currentSpend', 'type': 'CurrentSpend'}, 'notifications': {'key': 'properties.notifications', 'type': '{Notification}'}, + 'forecast_spend': {'key': 'properties.forecastSpend', 'type': 'ForecastSpend'}, } def __init__( @@ -382,6 +425,7 @@ def __init__( self.filter = filter self.current_spend = None self.notifications = notifications + self.forecast_spend = None class BudgetComparisonExpression(msrest.serialization.Model): @@ -400,7 +444,7 @@ class BudgetComparisonExpression(msrest.serialization.Model): _validation = { 'name': {'required': True}, 'operator': {'required': True}, - 'values': {'required': True, 'min_items': 1}, + 'values': {'required': True}, } _attribute_map = { @@ -436,10 +480,6 @@ class BudgetFilter(msrest.serialization.Model): :type tags: ~azure.mgmt.consumption.models.BudgetComparisonExpression """ - _validation = { - 'and_property': {'min_items': 2}, - } - _attribute_map = { 'and_property': {'key': 'and', 'type': '[BudgetFilterProperties]'}, 'not_property': {'key': 'not', 'type': 'BudgetFilterProperties'}, @@ -587,12 +627,14 @@ class ChargeSummary(Resource): All required parameters must be populated in order to send to Azure. - :ivar id: Resource Id. + :ivar id: The full qualified ARM ID of an event. :vartype id: str - :ivar name: Resource name. + :ivar name: The ID that uniquely identifies an event. :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar etag: The etag for the resource. + :vartype etag: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] :param kind: Required. Specifies the kind of charge summary.Constant filled by server. @@ -604,6 +646,7 @@ class ChargeSummary(Resource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'readonly': True}, 'tags': {'readonly': True}, 'kind': {'required': True}, } @@ -612,6 +655,7 @@ class ChargeSummary(Resource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'kind': {'key': 'kind', 'type': 'str'}, } @@ -637,16 +681,21 @@ class CreditBalanceSummary(msrest.serialization.Model): :vartype estimated_balance: ~azure.mgmt.consumption.models.Amount :ivar current_balance: Current balance. :vartype current_balance: ~azure.mgmt.consumption.models.Amount + :ivar estimated_balance_in_billing_currency: Estimated balance in billing currency. + :vartype estimated_balance_in_billing_currency: + ~azure.mgmt.consumption.models.AmountWithExchangeRate """ _validation = { 'estimated_balance': {'readonly': True}, 'current_balance': {'readonly': True}, + 'estimated_balance_in_billing_currency': {'readonly': True}, } _attribute_map = { 'estimated_balance': {'key': 'estimatedBalance', 'type': 'Amount'}, 'current_balance': {'key': 'currentBalance', 'type': 'Amount'}, + 'estimated_balance_in_billing_currency': {'key': 'estimatedBalanceInBillingCurrency', 'type': 'AmountWithExchangeRate'}, } def __init__( @@ -656,6 +705,7 @@ def __init__( super(CreditBalanceSummary, self).__init__(**kwargs) self.estimated_balance = None self.current_balance = None + self.estimated_balance_in_billing_currency = None class CreditSummary(Resource): @@ -663,12 +713,14 @@ class CreditSummary(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource Id. + :ivar id: The full qualified ARM ID of an event. :vartype id: str - :ivar name: Resource name. + :ivar name: The ID that uniquely identifies an event. :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar etag: The etag for the resource. + :vartype etag: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] :ivar balance_summary: Summary of balances associated with this credit summary. @@ -679,28 +731,42 @@ class CreditSummary(Resource): :vartype expired_credit: ~azure.mgmt.consumption.models.Amount :ivar pending_eligible_charges: Pending eligible charges. :vartype pending_eligible_charges: ~azure.mgmt.consumption.models.Amount + :ivar credit_currency: The credit currency. + :vartype credit_currency: str + :ivar billing_currency: The billing currency. + :vartype billing_currency: str + :ivar reseller: Credit's reseller. + :vartype reseller: ~azure.mgmt.consumption.models.Reseller """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'readonly': True}, 'tags': {'readonly': True}, 'balance_summary': {'readonly': True}, 'pending_credit_adjustments': {'readonly': True}, 'expired_credit': {'readonly': True}, 'pending_eligible_charges': {'readonly': True}, + 'credit_currency': {'readonly': True}, + 'billing_currency': {'readonly': True}, + 'reseller': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'balance_summary': {'key': 'properties.balanceSummary', 'type': 'CreditBalanceSummary'}, 'pending_credit_adjustments': {'key': 'properties.pendingCreditAdjustments', 'type': 'Amount'}, 'expired_credit': {'key': 'properties.expiredCredit', 'type': 'Amount'}, 'pending_eligible_charges': {'key': 'properties.pendingEligibleCharges', 'type': 'Amount'}, + 'credit_currency': {'key': 'properties.creditCurrency', 'type': 'str'}, + 'billing_currency': {'key': 'properties.billingCurrency', 'type': 'str'}, + 'reseller': {'key': 'properties.reseller', 'type': 'Reseller'}, } def __init__( @@ -712,6 +778,9 @@ def __init__( self.pending_credit_adjustments = None self.expired_credit = None self.pending_eligible_charges = None + self.credit_currency = None + self.billing_currency = None + self.reseller = None class CurrentSpend(msrest.serialization.Model): @@ -744,6 +813,36 @@ def __init__( self.unit = None +class DownloadProperties(msrest.serialization.Model): + """The properties of the price sheet download. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar download_url: The link (url) to download the pricesheet. + :vartype download_url: str + :ivar valid_till: Download link validity. + :vartype valid_till: str + """ + + _validation = { + 'download_url': {'readonly': True}, + 'valid_till': {'readonly': True}, + } + + _attribute_map = { + 'download_url': {'key': 'downloadUrl', 'type': 'str'}, + 'valid_till': {'key': 'validTill', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DownloadProperties, self).__init__(**kwargs) + self.download_url = None + self.valid_till = None + + class ErrorDetails(msrest.serialization.Model): """The details of the error. @@ -839,40 +938,82 @@ class EventSummary(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource Id. + :ivar id: The full qualified ARM ID of an event. :vartype id: str - :ivar name: Resource name. + :ivar name: The ID that uniquely identifies an event. :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar etag: The etag for the resource. + :vartype etag: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] - :ivar transaction_date: Transaction date. + :ivar transaction_date: The date of the event. :vartype transaction_date: ~datetime.datetime - :ivar description: Transaction description. + :ivar description: The description of the event. :vartype description: str - :ivar new_credit: New Credit. + :ivar new_credit: The amount of new credit or commitment for NewCredit or SettleCharges event. :vartype new_credit: ~azure.mgmt.consumption.models.Amount - :ivar adjustments: Adjustments amount. + :ivar adjustments: The amount of balance adjustment. The property is not available for + ConsumptionCommitment lots. :vartype adjustments: ~azure.mgmt.consumption.models.Amount - :ivar credit_expired: Credit expired. + :ivar credit_expired: The amount of expired credit or commitment for NewCredit or SettleCharges + event. :vartype credit_expired: ~azure.mgmt.consumption.models.Amount - :ivar charges: Charges amount. + :ivar charges: The amount of charges for events of type SettleCharges and + PendingEligibleCharges. :vartype charges: ~azure.mgmt.consumption.models.Amount - :ivar closed_balance: Closed balance. + :ivar closed_balance: The balance after the event. :vartype closed_balance: ~azure.mgmt.consumption.models.Amount - :param event_type: The type of event. Possible values include: "SettledCharges", + :param event_type: Identifies the type of the event. Possible values include: "SettledCharges", "PendingCharges", "PendingAdjustments", "PendingNewCredit", "PendingExpiredCredit", "UnKnown", "NewCredit". :type event_type: str or ~azure.mgmt.consumption.models.EventType - :ivar invoice_number: Invoice number. + :ivar invoice_number: The number which uniquely identifies the invoice on which the event was + billed. This will be empty for unbilled events. :vartype invoice_number: str + :ivar billing_profile_id: The ID that uniquely identifies the billing profile for which the + event happened. The property is only available for billing account of type + MicrosoftCustomerAgreement. + :vartype billing_profile_id: str + :ivar billing_profile_display_name: The display name of the billing profile for which the event + happened. The property is only available for billing account of type + MicrosoftCustomerAgreement. + :vartype billing_profile_display_name: str + :ivar lot_id: The ID that uniquely identifies the lot for which the event happened. + :vartype lot_id: str + :ivar lot_source: Identifies the source of the lot for which the event happened. + :vartype lot_source: str + :ivar canceled_credit: Amount of canceled credit. + :vartype canceled_credit: ~azure.mgmt.consumption.models.Amount + :ivar credit_currency: The credit currency of the event. + :vartype credit_currency: str + :ivar billing_currency: The billing currency of the event. + :vartype billing_currency: str + :ivar reseller: The reseller of the event. + :vartype reseller: ~azure.mgmt.consumption.models.Reseller + :ivar credit_expired_in_billing_currency: The amount of expired credit or commitment for + NewCredit or SettleCharges event in billing currency. + :vartype credit_expired_in_billing_currency: + ~azure.mgmt.consumption.models.AmountWithExchangeRate + :ivar new_credit_in_billing_currency: The amount of new credit or commitment for NewCredit or + SettleCharges event in billing currency. + :vartype new_credit_in_billing_currency: ~azure.mgmt.consumption.models.AmountWithExchangeRate + :ivar adjustments_in_billing_currency: The amount of balance adjustment in billing currency. + :vartype adjustments_in_billing_currency: ~azure.mgmt.consumption.models.AmountWithExchangeRate + :ivar charges_in_billing_currency: The amount of charges for events of type SettleCharges and + PendingEligibleCharges in billing currency. + :vartype charges_in_billing_currency: ~azure.mgmt.consumption.models.AmountWithExchangeRate + :ivar closed_balance_in_billing_currency: The balance in billing currency after the event. + :vartype closed_balance_in_billing_currency: + ~azure.mgmt.consumption.models.AmountWithExchangeRate """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'readonly': True}, 'tags': {'readonly': True}, 'transaction_date': {'readonly': True}, 'description': {'readonly': True}, @@ -882,12 +1023,26 @@ class EventSummary(Resource): 'charges': {'readonly': True}, 'closed_balance': {'readonly': True}, 'invoice_number': {'readonly': True}, + 'billing_profile_id': {'readonly': True}, + 'billing_profile_display_name': {'readonly': True}, + 'lot_id': {'readonly': True}, + 'lot_source': {'readonly': True}, + 'canceled_credit': {'readonly': True}, + 'credit_currency': {'readonly': True}, + 'billing_currency': {'readonly': True}, + 'reseller': {'readonly': True}, + 'credit_expired_in_billing_currency': {'readonly': True}, + 'new_credit_in_billing_currency': {'readonly': True}, + 'adjustments_in_billing_currency': {'readonly': True}, + 'charges_in_billing_currency': {'readonly': True}, + 'closed_balance_in_billing_currency': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'transaction_date': {'key': 'properties.transactionDate', 'type': 'iso-8601'}, 'description': {'key': 'properties.description', 'type': 'str'}, @@ -898,6 +1053,19 @@ class EventSummary(Resource): 'closed_balance': {'key': 'properties.closedBalance', 'type': 'Amount'}, 'event_type': {'key': 'properties.eventType', 'type': 'str'}, 'invoice_number': {'key': 'properties.invoiceNumber', 'type': 'str'}, + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'billing_profile_display_name': {'key': 'properties.billingProfileDisplayName', 'type': 'str'}, + 'lot_id': {'key': 'properties.lotId', 'type': 'str'}, + 'lot_source': {'key': 'properties.lotSource', 'type': 'str'}, + 'canceled_credit': {'key': 'properties.canceledCredit', 'type': 'Amount'}, + 'credit_currency': {'key': 'properties.creditCurrency', 'type': 'str'}, + 'billing_currency': {'key': 'properties.billingCurrency', 'type': 'str'}, + 'reseller': {'key': 'properties.reseller', 'type': 'Reseller'}, + 'credit_expired_in_billing_currency': {'key': 'properties.creditExpiredInBillingCurrency', 'type': 'AmountWithExchangeRate'}, + 'new_credit_in_billing_currency': {'key': 'properties.newCreditInBillingCurrency', 'type': 'AmountWithExchangeRate'}, + 'adjustments_in_billing_currency': {'key': 'properties.adjustmentsInBillingCurrency', 'type': 'AmountWithExchangeRate'}, + 'charges_in_billing_currency': {'key': 'properties.chargesInBillingCurrency', 'type': 'AmountWithExchangeRate'}, + 'closed_balance_in_billing_currency': {'key': 'properties.closedBalanceInBillingCurrency', 'type': 'AmountWithExchangeRate'}, } def __init__( @@ -916,6 +1084,19 @@ def __init__( self.closed_balance = None self.event_type = event_type self.invoice_number = None + self.billing_profile_id = None + self.billing_profile_display_name = None + self.lot_id = None + self.lot_source = None + self.canceled_credit = None + self.credit_currency = None + self.billing_currency = None + self.reseller = None + self.credit_expired_in_billing_currency = None + self.new_credit_in_billing_currency = None + self.adjustments_in_billing_currency = None + self.charges_in_billing_currency = None + self.closed_balance_in_billing_currency = None class Forecast(Resource): @@ -923,18 +1104,22 @@ class Forecast(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource Id. + :ivar id: The full qualified ARM ID of an event. :vartype id: str - :ivar name: Resource name. + :ivar name: The ID that uniquely identifies an event. :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar etag: The etag for the resource. + :vartype etag: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] :ivar usage_date: The usage date of the forecast. :vartype usage_date: str - :param grain: The granularity of forecast. Possible values include: "Daily", "Monthly", - "Yearly". + :param grain: The granularity of forecast. Please note that Yearly is not currently supported + in this API. The API will provide responses in the Monthly grain if Yearly is selected. To get + yearly grain data, please use our newer Forecast API. Possible values include: "Daily", + "Monthly", "Yearly". :type grain: str or ~azure.mgmt.consumption.models.Grain :ivar charge: The amount of charge. :vartype charge: float @@ -953,6 +1138,7 @@ class Forecast(Resource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'readonly': True}, 'tags': {'readonly': True}, 'usage_date': {'readonly': True}, 'charge': {'readonly': True}, @@ -964,6 +1150,7 @@ class Forecast(Resource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'usage_date': {'key': 'properties.usageDate', 'type': 'str'}, 'grain': {'key': 'properties.grain', 'type': 'str'}, @@ -1051,6 +1238,97 @@ def __init__( self.value = None +class ForecastSpend(msrest.serialization.Model): + """The forecasted cost which is being tracked for a budget. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar amount: The forecasted cost for the total time period which is being tracked by the + budget. This value is only provided if the budget contains a forecast alert type. + :vartype amount: float + :ivar unit: The unit of measure for the budget amount. + :vartype unit: str + """ + + _validation = { + 'amount': {'readonly': True}, + 'unit': {'readonly': True}, + } + + _attribute_map = { + 'amount': {'key': 'amount', 'type': 'float'}, + 'unit': {'key': 'unit', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ForecastSpend, self).__init__(**kwargs) + self.amount = None + self.unit = None + + +class HighCasedErrorDetails(msrest.serialization.Model): + """The details of the error. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Error code. + :vartype code: str + :ivar message: Error message indicating why the operation failed. + :vartype message: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HighCasedErrorDetails, self).__init__(**kwargs) + self.code = None + self.message = None + + +class HighCasedErrorResponse(msrest.serialization.Model): + """Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message. + +Some Error responses: + + +* + 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "x-ms-ratelimit-microsoft.consumption-retry-after" header. + +* + 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" header. + + :param error: The details of the error. + :type error: ~azure.mgmt.consumption.models.HighCasedErrorDetails + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'HighCasedErrorDetails'}, + } + + def __init__( + self, + *, + error: Optional["HighCasedErrorDetails"] = None, + **kwargs + ): + super(HighCasedErrorResponse, self).__init__(**kwargs) + self.error = error + + class LegacyChargeSummary(ChargeSummary): """Legacy charge summary. @@ -1058,12 +1336,14 @@ class LegacyChargeSummary(ChargeSummary): All required parameters must be populated in order to send to Azure. - :ivar id: Resource Id. + :ivar id: The full qualified ARM ID of an event. :vartype id: str - :ivar name: Resource name. + :ivar name: The ID that uniquely identifies an event. :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar etag: The etag for the resource. + :vartype etag: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] :param kind: Required. Specifies the kind of charge summary.Constant filled by server. @@ -1089,6 +1369,7 @@ class LegacyChargeSummary(ChargeSummary): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'readonly': True}, 'tags': {'readonly': True}, 'kind': {'required': True}, 'billing_period_id': {'readonly': True}, @@ -1104,6 +1385,7 @@ class LegacyChargeSummary(ChargeSummary): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'kind': {'key': 'kind', 'type': 'str'}, 'billing_period_id': {'key': 'properties.billingPeriodId', 'type': 'str'}, @@ -1174,12 +1456,14 @@ class ReservationRecommendation(Resource, ResourceAttributes): :vartype location: str :ivar sku: Resource sku. :vartype sku: str - :ivar id: Resource Id. + :ivar id: The full qualified ARM ID of an event. :vartype id: str - :ivar name: Resource name. + :ivar name: The ID that uniquely identifies an event. :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar etag: The etag for the resource. + :vartype etag: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] :param kind: Required. Specifies the kind of reservation recommendation.Constant filled by @@ -1193,6 +1477,7 @@ class ReservationRecommendation(Resource, ResourceAttributes): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'readonly': True}, 'tags': {'readonly': True}, 'kind': {'required': True}, } @@ -1203,6 +1488,7 @@ class ReservationRecommendation(Resource, ResourceAttributes): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'kind': {'key': 'kind', 'type': 'str'}, } @@ -1222,6 +1508,7 @@ def __init__( self.id = None self.name = None self.type = None + self.etag = None self.tags = None self.kind = 'ReservationRecommendation' # type: str @@ -1237,12 +1524,14 @@ class LegacyReservationRecommendation(ReservationRecommendation): :vartype location: str :ivar sku: Resource sku. :vartype sku: str - :ivar id: Resource Id. + :ivar id: The full qualified ARM ID of an event. :vartype id: str - :ivar name: Resource name. + :ivar name: The ID that uniquely identifies an event. :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar etag: The etag for the resource. + :vartype etag: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] :param kind: Required. Specifies the kind of reservation recommendation.Constant filled by @@ -1251,7 +1540,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. @@ -1260,6 +1549,8 @@ class LegacyReservationRecommendation(ReservationRecommendation): :vartype recommended_quantity_normalized: float :ivar meter_id: The meter id (GUID). :vartype meter_id: str + :ivar resource_type: The azure resource type. + :vartype resource_type: str :ivar term: RI recommendations in one or three year terms. :vartype term: str :ivar cost_with_no_reserved_instances: The total amount of cost without reserved instances. @@ -1284,6 +1575,7 @@ class LegacyReservationRecommendation(ReservationRecommendation): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'readonly': True}, 'tags': {'readonly': True}, 'kind': {'required': True}, 'look_back_period': {'readonly': True}, @@ -1292,6 +1584,7 @@ class LegacyReservationRecommendation(ReservationRecommendation): 'normalized_size': {'readonly': True}, 'recommended_quantity_normalized': {'readonly': True}, 'meter_id': {'readonly': True}, + 'resource_type': {'readonly': True}, 'term': {'readonly': True}, 'cost_with_no_reserved_instances': {'readonly': True}, 'recommended_quantity': {'readonly': True}, @@ -1308,14 +1601,16 @@ class LegacyReservationRecommendation(ReservationRecommendation): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, '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'}, 'meter_id': {'key': 'properties.meterId', 'type': 'str'}, + 'resource_type': {'key': 'properties.resourceType', 'type': 'str'}, 'term': {'key': 'properties.term', 'type': 'str'}, 'cost_with_no_reserved_instances': {'key': 'properties.costWithNoReservedInstances', 'type': 'float'}, 'recommended_quantity': {'key': 'properties.recommendedQuantity', 'type': 'float'}, @@ -1338,6 +1633,7 @@ def __init__( self.normalized_size = None self.recommended_quantity_normalized = None self.meter_id = None + self.resource_type = None self.term = None self.cost_with_no_reserved_instances = None self.recommended_quantity = None @@ -1660,12 +1956,14 @@ class UsageDetail(Resource): All required parameters must be populated in order to send to Azure. - :ivar id: Resource Id. + :ivar id: The full qualified ARM ID of an event. :vartype id: str - :ivar name: Resource name. + :ivar name: The ID that uniquely identifies an event. :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar etag: The etag for the resource. + :vartype etag: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] :param kind: Required. Specifies the kind of usage details.Constant filled by server. Possible @@ -1677,6 +1975,7 @@ class UsageDetail(Resource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'readonly': True}, 'tags': {'readonly': True}, 'kind': {'required': True}, } @@ -1685,6 +1984,7 @@ class UsageDetail(Resource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'kind': {'key': 'kind', 'type': 'str'}, } @@ -1708,12 +2008,14 @@ class LegacyUsageDetail(UsageDetail): All required parameters must be populated in order to send to Azure. - :ivar id: Resource Id. + :ivar id: The full qualified ARM ID of an event. :vartype id: str - :ivar name: Resource name. + :ivar name: The ID that uniquely identifies an event. :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar etag: The etag for the resource. + :vartype etag: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] :param kind: Required. Specifies the kind of usage details.Constant filled by server. Possible @@ -1769,13 +2071,13 @@ class LegacyUsageDetail(UsageDetail): :ivar consumed_service: Consumed service name. Name of the azure resource provider that emits the usage or was purchased. This value is not provided for marketplace usage. :vartype consumed_service: str - :ivar resource_id: Azure resource manager resource identifier. + :ivar resource_id: Unique identifier of the Azure Resource Manager usage detail resource. :vartype resource_id: str :ivar resource_name: Resource Name. :vartype resource_name: str - :ivar service_info1: Service Info 1. + :ivar service_info1: Service-specific metadata. :vartype service_info1: str - :ivar service_info2: Service Info 2. + :ivar service_info2: Legacy field with optional service-specific metadata. :vartype service_info2: str :ivar additional_info: Additional details of this usage item. By default this is not populated, unless it's specified in $expand. Use this field to get usage line item specific details such @@ -1826,6 +2128,7 @@ class LegacyUsageDetail(UsageDetail): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'readonly': True}, 'tags': {'readonly': True}, 'kind': {'required': True}, 'billing_account_id': {'readonly': True}, @@ -1876,6 +2179,7 @@ class LegacyUsageDetail(UsageDetail): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'kind': {'key': 'kind', 'type': 'str'}, 'billing_account_id': {'key': 'properties.billingAccountId', 'type': 'str'}, @@ -2007,32 +2311,55 @@ class LotSummary(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource Id. + :ivar id: The full qualified ARM ID of an event. :vartype id: str - :ivar name: Resource name. + :ivar name: The ID that uniquely identifies an event. :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar etag: The etag for the resource. + :vartype etag: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] - :ivar original_amount: Original amount. + :ivar original_amount: The original amount of a lot. :vartype original_amount: ~azure.mgmt.consumption.models.Amount - :ivar closed_balance: Closed balance. + :ivar closed_balance: The balance as of the last invoice. :vartype closed_balance: ~azure.mgmt.consumption.models.Amount - :ivar source: Lot source. Possible values include: "PurchasedCredit", "PromotionalCredit". + :ivar source: The source of the lot. Possible values include: "PurchasedCredit", + "PromotionalCredit", "ConsumptionCommitment". :vartype source: str or ~azure.mgmt.consumption.models.LotSource - :ivar start_date: Start date. + :ivar start_date: The date when the lot became effective. :vartype start_date: ~datetime.datetime - :ivar expiration_date: Expiration date. + :ivar expiration_date: The expiration date of a lot. :vartype expiration_date: ~datetime.datetime - :ivar po_number: PO number. + :ivar po_number: The po number of the invoice on which the lot was added. This property is not + available for ConsumptionCommitment lots. :vartype po_number: str + :ivar purchase_date: The date when the lot was added. + :vartype purchase_date: ~datetime.datetime + :ivar status: The status of the lot. Possible values include: "None", "Active", "Inactive", + "Expired", "Complete", "Canceled". + :vartype status: str or ~azure.mgmt.consumption.models.Status + :ivar credit_currency: The currency of the lot. + :vartype credit_currency: str + :ivar billing_currency: The billing currency of the lot. + :vartype billing_currency: str + :ivar original_amount_in_billing_currency: The original amount of a lot in billing currency. + :vartype original_amount_in_billing_currency: + ~azure.mgmt.consumption.models.AmountWithExchangeRate + :ivar closed_balance_in_billing_currency: The balance as of the last invoice in billing + currency. + :vartype closed_balance_in_billing_currency: + ~azure.mgmt.consumption.models.AmountWithExchangeRate + :ivar reseller: The reseller of the lot. + :vartype reseller: ~azure.mgmt.consumption.models.Reseller """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'readonly': True}, 'tags': {'readonly': True}, 'original_amount': {'readonly': True}, 'closed_balance': {'readonly': True}, @@ -2040,12 +2367,20 @@ class LotSummary(Resource): 'start_date': {'readonly': True}, 'expiration_date': {'readonly': True}, 'po_number': {'readonly': True}, + 'purchase_date': {'readonly': True}, + 'status': {'readonly': True}, + 'credit_currency': {'readonly': True}, + 'billing_currency': {'readonly': True}, + 'original_amount_in_billing_currency': {'readonly': True}, + 'closed_balance_in_billing_currency': {'readonly': True}, + 'reseller': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'original_amount': {'key': 'properties.originalAmount', 'type': 'Amount'}, 'closed_balance': {'key': 'properties.closedBalance', 'type': 'Amount'}, @@ -2053,6 +2388,13 @@ class LotSummary(Resource): 'start_date': {'key': 'properties.startDate', 'type': 'iso-8601'}, 'expiration_date': {'key': 'properties.expirationDate', 'type': 'iso-8601'}, 'po_number': {'key': 'properties.poNumber', 'type': 'str'}, + 'purchase_date': {'key': 'properties.purchaseDate', 'type': 'iso-8601'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'credit_currency': {'key': 'properties.creditCurrency', 'type': 'str'}, + 'billing_currency': {'key': 'properties.billingCurrency', 'type': 'str'}, + 'original_amount_in_billing_currency': {'key': 'properties.originalAmountInBillingCurrency', 'type': 'AmountWithExchangeRate'}, + 'closed_balance_in_billing_currency': {'key': 'properties.closedBalanceInBillingCurrency', 'type': 'AmountWithExchangeRate'}, + 'reseller': {'key': 'properties.reseller', 'type': 'Reseller'}, } def __init__( @@ -2066,6 +2408,13 @@ def __init__( self.start_date = None self.expiration_date = None self.po_number = None + self.purchase_date = None + self.status = None + self.credit_currency = None + self.billing_currency = None + self.original_amount_in_billing_currency = None + self.closed_balance_in_billing_currency = None + self.reseller = None class ManagementGroupAggregatedCostResult(Resource): @@ -2073,12 +2422,14 @@ class ManagementGroupAggregatedCostResult(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource Id. + :ivar id: The full qualified ARM ID of an event. :vartype id: str - :ivar name: Resource name. + :ivar name: The ID that uniquely identifies an event. :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar etag: The etag for the resource. + :vartype etag: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] :ivar billing_period_id: The id of the billing period resource that the aggregated cost belongs @@ -2110,6 +2461,7 @@ class ManagementGroupAggregatedCostResult(Resource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'readonly': True}, 'tags': {'readonly': True}, 'billing_period_id': {'readonly': True}, 'usage_start': {'readonly': True}, @@ -2124,6 +2476,7 @@ class ManagementGroupAggregatedCostResult(Resource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'billing_period_id': {'key': 'properties.billingPeriodId', 'type': 'str'}, 'usage_start': {'key': 'properties.usageStart', 'type': 'iso-8601'}, @@ -2159,16 +2512,18 @@ def __init__( class Marketplace(Resource): - """An marketplace resource. + """A marketplace resource. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource Id. + :ivar id: The full qualified ARM ID of an event. :vartype id: str - :ivar name: Resource name. + :ivar name: The ID that uniquely identifies an event. :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar etag: The etag for the resource. + :vartype etag: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] :ivar billing_period_id: The id of the billing period resource that the usage belongs to. @@ -2183,6 +2538,8 @@ class Marketplace(Resource): :vartype offer_name: str :ivar resource_group: The name of resource group. :vartype resource_group: str + :ivar additional_info: Additional information. + :vartype additional_info: str :ivar order_number: The order number. :vartype order_number: str :ivar instance_name: The name of the resource instance that the usage is about. @@ -2229,6 +2586,7 @@ class Marketplace(Resource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'readonly': True}, 'tags': {'readonly': True}, 'billing_period_id': {'readonly': True}, 'usage_start': {'readonly': True}, @@ -2236,6 +2594,7 @@ class Marketplace(Resource): 'resource_rate': {'readonly': True}, 'offer_name': {'readonly': True}, 'resource_group': {'readonly': True}, + 'additional_info': {'readonly': True}, 'order_number': {'readonly': True}, 'instance_name': {'readonly': True}, 'instance_id': {'readonly': True}, @@ -2261,6 +2620,7 @@ class Marketplace(Resource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'billing_period_id': {'key': 'properties.billingPeriodId', 'type': 'str'}, 'usage_start': {'key': 'properties.usageStart', 'type': 'iso-8601'}, @@ -2268,6 +2628,7 @@ class Marketplace(Resource): 'resource_rate': {'key': 'properties.resourceRate', 'type': 'float'}, 'offer_name': {'key': 'properties.offerName', 'type': 'str'}, 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'additional_info': {'key': 'properties.additionalInfo', 'type': 'str'}, 'order_number': {'key': 'properties.orderNumber', 'type': 'str'}, 'instance_name': {'key': 'properties.instanceName', 'type': 'str'}, 'instance_id': {'key': 'properties.instanceId', 'type': 'str'}, @@ -2300,6 +2661,7 @@ def __init__( self.resource_rate = None self.offer_name = None self.resource_group = None + self.additional_info = None self.order_number = None self.instance_name = None self.instance_id = None @@ -2474,12 +2836,14 @@ class ModernChargeSummary(ChargeSummary): All required parameters must be populated in order to send to Azure. - :ivar id: Resource Id. + :ivar id: The full qualified ARM ID of an event. :vartype id: str - :ivar name: Resource name. + :ivar name: The ID that uniquely identifies an event. :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar etag: The etag for the resource. + :vartype etag: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] :param kind: Required. Specifies the kind of charge summary.Constant filled by server. @@ -2513,6 +2877,7 @@ class ModernChargeSummary(ChargeSummary): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'readonly': True}, 'tags': {'readonly': True}, 'kind': {'required': True}, 'billing_period_id': {'readonly': True}, @@ -2532,6 +2897,7 @@ class ModernChargeSummary(ChargeSummary): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'kind': {'key': 'kind', 'type': 'str'}, 'billing_period_id': {'key': 'properties.billingPeriodId', 'type': 'str'}, @@ -2577,21 +2943,25 @@ class ModernReservationRecommendation(ReservationRecommendation): :vartype location: str :ivar sku: Resource sku. :vartype sku: str - :ivar id: Resource Id. + :ivar id: The full qualified ARM ID of an event. :vartype id: str - :ivar name: Resource name. + :ivar name: The ID that uniquely identifies an event. :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar etag: The etag for the resource. + :vartype etag: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] :param kind: Required. Specifies the kind of reservation recommendation.Constant filled by server. Possible values include: "legacy", "modern". :type kind: str or ~azure.mgmt.consumption.models.ReservationRecommendationKind + :ivar location_properties_location: Resource Location. + :vartype location_properties_location: str :ivar look_back_period: The number of days of usage to look back for recommendation. - :vartype look_back_period: str + :vartype look_back_period: int :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. @@ -2616,6 +2986,8 @@ class ModernReservationRecommendation(ReservationRecommendation): :vartype scope: str :ivar sku_properties: List of sku properties. :vartype sku_properties: list[~azure.mgmt.consumption.models.SkuProperty] + :ivar sku_name: This is the ARM Sku name. + :vartype sku_name: str """ _validation = { @@ -2624,8 +2996,10 @@ class ModernReservationRecommendation(ReservationRecommendation): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'readonly': True}, 'tags': {'readonly': True}, 'kind': {'required': True}, + 'location_properties_location': {'readonly': True}, 'look_back_period': {'readonly': True}, 'instance_flexibility_ratio': {'readonly': True}, 'instance_flexibility_group': {'readonly': True}, @@ -2640,6 +3014,7 @@ class ModernReservationRecommendation(ReservationRecommendation): 'first_usage_date': {'readonly': True}, 'scope': {'readonly': True}, 'sku_properties': {'readonly': True}, + 'sku_name': {'readonly': True}, } _attribute_map = { @@ -2648,10 +3023,12 @@ class ModernReservationRecommendation(ReservationRecommendation): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, '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'}, + 'location_properties_location': {'key': 'properties.location', 'type': 'str'}, + 'look_back_period': {'key': 'properties.lookBackPeriod', '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'}, @@ -2664,6 +3041,7 @@ class ModernReservationRecommendation(ReservationRecommendation): 'first_usage_date': {'key': 'properties.firstUsageDate', 'type': 'iso-8601'}, 'scope': {'key': 'properties.scope', 'type': 'str'}, 'sku_properties': {'key': 'properties.skuProperties', 'type': '[SkuProperty]'}, + 'sku_name': {'key': 'properties.skuName', 'type': 'str'}, } def __init__( @@ -2672,6 +3050,7 @@ def __init__( ): super(ModernReservationRecommendation, self).__init__(**kwargs) self.kind = 'modern' # type: str + self.location_properties_location = None self.look_back_period = None self.instance_flexibility_ratio = None self.instance_flexibility_group = None @@ -2686,6 +3065,7 @@ def __init__( self.first_usage_date = None self.scope = None self.sku_properties = None + self.sku_name = None class ModernReservationTransaction(ReservationTransactionResource): @@ -2865,12 +3245,14 @@ class ModernUsageDetail(UsageDetail): All required parameters must be populated in order to send to Azure. - :ivar id: Resource Id. + :ivar id: The full qualified ARM ID of an event. :vartype id: str - :ivar name: Resource name. + :ivar name: The ID that uniquely identifies an event. :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar etag: The etag for the resource. + :vartype etag: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] :param kind: Required. Specifies the kind of usage details.Constant filled by server. Possible @@ -2939,9 +3321,9 @@ class ModernUsageDetail(UsageDetail): :ivar consumed_service: Consumed service name. Name of the azure resource provider that emits the usage or was purchased. This value is not provided for marketplace usage. :vartype consumed_service: str - :ivar service_info1: Service Info 1. + :ivar service_info1: Service-specific metadata. :vartype service_info1: str - :ivar service_info2: Service Info 2. + :ivar service_info2: Legacy field with optional service-specific metadata. :vartype service_info2: str :ivar additional_info: Additional details of this usage item. Use this field to get usage line item specific details such as the actual VM Size (ServiceType) or the ratio in which the @@ -3011,8 +3393,8 @@ class ModernUsageDetail(UsageDetail): :vartype previous_invoice_id: str :ivar pricing_currency_code: Pricing Billing Currency. :vartype pricing_currency_code: str - :ivar product_identifier: Identifer for the product that has accrued charges by consumption or - purchase . This is the concatenated key of productId and SKuId in partner center. + :ivar product_identifier: Identifier for the product that has accrued charges by consumption or + purchase . This is the concatenated key of productId and SkuId in partner center. :vartype product_identifier: str :ivar resource_location_normalized: Resource Location Normalized. :vartype resource_location_normalized: str @@ -3051,12 +3433,15 @@ class ModernUsageDetail(UsageDetail): :ivar partner_earned_credit_applied: Flag to indicate if partner earned credit has been applied or not. :vartype partner_earned_credit_applied: str + :ivar pay_g_price: Retail price for the resource. + :vartype pay_g_price: float """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'readonly': True}, 'tags': {'readonly': True}, 'kind': {'required': True}, 'billing_account_id': {'readonly': True}, @@ -3124,12 +3509,14 @@ class ModernUsageDetail(UsageDetail): 'payg_cost_in_usd': {'readonly': True}, 'partner_earned_credit_rate': {'readonly': True}, 'partner_earned_credit_applied': {'readonly': True}, + 'pay_g_price': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'kind': {'key': 'kind', 'type': 'str'}, 'billing_account_id': {'key': 'properties.billingAccountId', 'type': 'str'}, @@ -3197,6 +3584,7 @@ class ModernUsageDetail(UsageDetail): 'payg_cost_in_usd': {'key': 'properties.paygCostInUSD', 'type': 'float'}, 'partner_earned_credit_rate': {'key': 'properties.partnerEarnedCreditRate', 'type': 'float'}, 'partner_earned_credit_applied': {'key': 'properties.partnerEarnedCreditApplied', 'type': 'str'}, + 'pay_g_price': {'key': 'properties.payGPrice', 'type': 'float'}, } def __init__( @@ -3270,6 +3658,7 @@ def __init__( self.payg_cost_in_usd = None self.partner_earned_credit_rate = None self.partner_earned_credit_applied = None + self.pay_g_price = None class Notification(msrest.serialization.Model): @@ -3287,15 +3676,19 @@ class Notification(msrest.serialization.Model): 1000. :type threshold: float :param contact_emails: Required. Email addresses to send the budget notification to when the - threshold is exceeded. + threshold is exceeded. Must have at least one contact email or contact group specified at the + Subscription or Resource Group scopes. All other scopes must have at least one contact email + specified. :type contact_emails: list[str] :param contact_roles: Contact roles to send the budget notification to when the threshold is exceeded. :type contact_roles: list[str] :param contact_groups: Action groups to send the budget notification to when the threshold is - exceeded. + exceeded. Must be provided as a fully qualified Azure resource id. Only supported at + Subscription or Resource Group scopes. :type contact_groups: list[str] - :param threshold_type: The type of threshold. Possible values include: "Actual". + :param threshold_type: The type of threshold. Possible values include: "Actual". Default value: + "Actual". :type threshold_type: str or ~azure.mgmt.consumption.models.ThresholdType """ @@ -3303,7 +3696,7 @@ class Notification(msrest.serialization.Model): 'enabled': {'required': True}, 'operator': {'required': True}, 'threshold': {'required': True}, - 'contact_emails': {'required': True, 'max_items': 50, 'min_items': 1}, + 'contact_emails': {'required': True, 'max_items': 50, 'min_items': 0}, 'contact_groups': {'max_items': 50, 'min_items': 0}, } @@ -3326,7 +3719,7 @@ def __init__( contact_emails: List[str], contact_roles: Optional[List[str]] = None, contact_groups: Optional[List[str]] = None, - threshold_type: Optional[Union[str, "ThresholdType"]] = None, + threshold_type: Optional[Union[str, "ThresholdType"]] = "Actual", **kwargs ): super(Notification, self).__init__(**kwargs) @@ -3344,6 +3737,8 @@ class Operation(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. + :ivar id: Operation Id. + :vartype id: str :ivar name: Operation name: {provider}/{resource}/{operation}. :vartype name: str :param display: The object that represents the operation. @@ -3351,10 +3746,12 @@ class Operation(msrest.serialization.Model): """ _validation = { + 'id': {'readonly': True}, 'name': {'readonly': True}, } _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'display': {'key': 'display', 'type': 'OperationDisplay'}, } @@ -3366,6 +3763,7 @@ def __init__( **kwargs ): super(Operation, self).__init__(**kwargs) + self.id = None self.name = None self.display = display @@ -3381,18 +3779,22 @@ class OperationDisplay(msrest.serialization.Model): :vartype resource: str :ivar operation: Operation type: Read, write, delete, etc. :vartype operation: str + :ivar description: Description of the operation. + :vartype description: str """ _validation = { 'provider': {'readonly': True}, 'resource': {'readonly': True}, 'operation': {'readonly': True}, + 'description': {'readonly': True}, } _attribute_map = { 'provider': {'key': 'provider', 'type': 'str'}, 'resource': {'key': 'resource', 'type': 'str'}, 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, } def __init__( @@ -3403,6 +3805,7 @@ def __init__( self.provider = None self.resource = None self.operation = None + self.description = None class OperationListResult(msrest.serialization.Model): @@ -3507,36 +3910,44 @@ class PriceSheetResult(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource Id. + :ivar id: The full qualified ARM ID of an event. :vartype id: str - :ivar name: Resource name. + :ivar name: The ID that uniquely identifies an event. :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar etag: The etag for the resource. + :vartype etag: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] :ivar pricesheets: Price sheet. :vartype pricesheets: list[~azure.mgmt.consumption.models.PriceSheetProperties] :ivar next_link: The link (url) to the next page of results. :vartype next_link: str + :ivar download: Pricesheet download details. + :vartype download: ~azure.mgmt.consumption.models.MeterDetails """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'readonly': True}, 'tags': {'readonly': True}, 'pricesheets': {'readonly': True}, 'next_link': {'readonly': True}, + 'download': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'pricesheets': {'key': 'properties.pricesheets', 'type': '[PriceSheetProperties]'}, 'next_link': {'key': 'properties.nextLink', 'type': 'str'}, + 'download': {'key': 'properties.download', 'type': 'MeterDetails'}, } def __init__( @@ -3546,6 +3957,37 @@ def __init__( super(PriceSheetResult, self).__init__(**kwargs) self.pricesheets = None self.next_link = None + self.download = None + + +class Reseller(msrest.serialization.Model): + """The reseller properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar reseller_id: The reseller property ID. + :vartype reseller_id: str + :ivar reseller_description: The reseller property description. + :vartype reseller_description: str + """ + + _validation = { + 'reseller_id': {'readonly': True}, + 'reseller_description': {'readonly': True}, + } + + _attribute_map = { + 'reseller_id': {'key': 'resellerId', 'type': 'str'}, + 'reseller_description': {'key': 'resellerDescription', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Reseller, self).__init__(**kwargs) + self.reseller_id = None + self.reseller_description = None class ReservationDetail(Resource): @@ -3553,12 +3995,14 @@ class ReservationDetail(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource Id. + :ivar id: The full qualified ARM ID of an event. :vartype id: str - :ivar name: Resource name. + :ivar name: The ID that uniquely identifies an event. :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar etag: The etag for the resource. + :vartype etag: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] :ivar reservation_order_id: The reservation order ID is the identifier for a reservation @@ -3599,6 +4043,7 @@ class ReservationDetail(Resource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'readonly': True}, 'tags': {'readonly': True}, 'reservation_order_id': {'readonly': True}, 'instance_flexibility_ratio': {'readonly': True}, @@ -3617,6 +4062,7 @@ class ReservationDetail(Resource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'reservation_order_id': {'key': 'properties.reservationOrderId', 'type': 'str'}, 'instance_flexibility_ratio': {'key': 'properties.instanceFlexibilityRatio', 'type': 'str'}, @@ -3741,12 +4187,14 @@ class ReservationRecommendationDetailsModel(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource Id. + :ivar id: The full qualified ARM ID of an event. :vartype id: str - :ivar name: Resource name. + :ivar name: The ID that uniquely identifies an event. :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar etag: The etag for the resource. + :vartype etag: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] :param location: Resource Location. @@ -3773,6 +4221,7 @@ class ReservationRecommendationDetailsModel(Resource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'readonly': True}, 'tags': {'readonly': True}, 'currency': {'readonly': True}, 'resource': {'readonly': True}, @@ -3786,6 +4235,7 @@ class ReservationRecommendationDetailsModel(Resource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'location': {'key': 'location', 'type': 'str'}, 'sku': {'key': 'sku', 'type': 'str'}, @@ -3975,16 +4425,20 @@ class ReservationRecommendationsListResult(msrest.serialization.Model): :vartype value: list[~azure.mgmt.consumption.models.ReservationRecommendation] :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 = { 'value': {'readonly': True}, 'next_link': {'readonly': True}, + 'previous_link': {'readonly': True}, } _attribute_map = { 'value': {'key': 'value', 'type': '[ReservationRecommendation]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'previous_link': {'key': 'previousLink', 'type': 'str'}, } def __init__( @@ -3994,6 +4448,7 @@ def __init__( super(ReservationRecommendationsListResult, self).__init__(**kwargs) self.value = None self.next_link = None + self.previous_link = None class ReservationSummariesListResult(msrest.serialization.Model): @@ -4031,12 +4486,14 @@ class ReservationSummary(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource Id. + :ivar id: The full qualified ARM ID of an event. :vartype id: str - :ivar name: Resource name. + :ivar name: The ID that uniquely identifies an event. :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar etag: The etag for the resource. + :vartype etag: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] :ivar reservation_order_id: The reservation order ID is the identifier for a reservation @@ -4089,6 +4546,7 @@ class ReservationSummary(Resource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'readonly': True}, 'tags': {'readonly': True}, 'reservation_order_id': {'readonly': True}, 'reservation_id': {'readonly': True}, @@ -4111,6 +4569,7 @@ class ReservationSummary(Resource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'reservation_order_id': {'key': 'properties.reservationOrderId', 'type': 'str'}, 'reservation_id': {'key': 'properties.reservationId', 'type': 'str'}, @@ -4216,20 +4675,25 @@ class Tag(msrest.serialization.Model): :param key: Tag key. :type key: str + :param value: Tag values. + :type value: list[str] """ _attribute_map = { 'key': {'key': 'key', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[str]'}, } def __init__( self, *, key: Optional[str] = None, + value: Optional[List[str]] = None, **kwargs ): super(Tag, self).__init__(**kwargs) self.key = key + self.value = value class TagsResult(ProxyResource): @@ -4248,12 +4712,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 = { @@ -4262,6 +4732,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__( @@ -4273,6 +4745,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 ccf5e9b480db..595a189a054f 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 @@ -71,7 +71,7 @@ def get_by_management_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" # Construct URL @@ -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.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ManagementGroupAggregatedCostResult', pipeline_response) @@ -132,7 +132,7 @@ def get_for_billing_period_by_management_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" # Construct URL @@ -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.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ManagementGroupAggregatedCostResult', pipeline_response) @@ -166,4 +166,4 @@ def get_for_billing_period_by_management_group( return cls(pipeline_response, deserialized, {}) return deserialized - get_for_billing_period_by_management_group.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/Microsoft.Consumption/aggregatedcost'} # type: ignore + get_for_billing_period_by_management_group.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/Microsoft.Consumption/aggregatedCost'} # type: ignore 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 5556d12d355f..31849bb119fe 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 @@ -65,7 +65,7 @@ def get_by_billing_account( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" # Construct URL @@ -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.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Balance', pipeline_response) @@ -124,7 +124,7 @@ def get_for_billing_period_by_billing_account( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" # Construct URL @@ -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.failsafe_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 c50bf7bc303c..62abda087122 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 @@ -78,7 +78,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" def prepare_request(next_link=None): @@ -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.failsafe_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) @@ -165,7 +165,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" # Construct URL @@ -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.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Budget', pipeline_response) @@ -209,9 +209,9 @@ def create_or_update( **kwargs # type: Any ): # 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. + """The operation to create or update a budget. You can optionally provide an eTag if desired as a + form of concurrency control. To obtain the latest eTag for a given budget, perform a get + operation prior to your put operation. :param scope: The scope associated with budget operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, @@ -242,7 +242,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -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.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -323,7 +323,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" # Construct URL @@ -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.failsafe_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 52fcba6f0225..278e3979f042 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 @@ -96,7 +96,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" # Construct URL @@ -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.failsafe_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 4a66919ad61d..c1dbe46e8f04 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 @@ -67,7 +67,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" # Construct URL @@ -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.failsafe_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 60491b1fa499..3530f67f8763 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 @@ -45,7 +45,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config - def list( + def list_by_billing_profile( self, billing_account_id, # type: str billing_profile_id, # type: str @@ -54,7 +54,8 @@ def list( **kwargs # type: Any ): # type: (...) -> Iterable["_models.Events"] - """Lists the events by billingAccountId and billingProfileId for given start and end date. + """Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a + billing account or a billing profile for a given start and end date. :param billing_account_id: BillingAccount ID. :type billing_account_id: str @@ -74,7 +75,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" def prepare_request(next_link=None): @@ -84,7 +85,7 @@ def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list.metadata['url'] # type: ignore + url = self.list_by_billing_profile.metadata['url'] # type: ignore path_format_arguments = { 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), 'billingProfileId': self._serialize.url("billing_profile_id", billing_profile_id, 'str'), @@ -117,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.failsafe_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) @@ -126,4 +127,83 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.Consumption/events'} # type: ignore + list_by_billing_profile.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.Consumption/events'} # type: ignore + + def list_by_billing_account( + self, + billing_account_id, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.Events"] + """Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a + billing account or a billing profile for a given start and end date. + + :param billing_account_id: BillingAccount ID. + :type billing_account_id: str + :param filter: May be used to filter the events by lotId, lotSource etc. The filter supports + 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. + Tag filter is a key value pair string where key and value is separated by a colon (:). + :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 Events or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.consumption.models.Events] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Events"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_billing_account.metadata['url'] # type: ignore + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('Events', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + 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.failsafe_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) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/events'} # type: ignore 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 507a13eb386c..62d1092146ba 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 @@ -51,7 +51,9 @@ def list( **kwargs # type: Any ): # type: (...) -> Iterable["_models.ForecastsListResult"] - """Lists the forecast charges by subscriptionId. + """Lists the forecast charges for scope defined. Please note that this API is no longer actively + under development. We recommend using our new Forecast API moving forward: + https://docs.microsoft.com/en-us/rest/api/cost-management/forecast/usage. :param filter: May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', @@ -67,7 +69,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" def prepare_request(next_link=None): @@ -109,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.failsafe_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 2ce4ec50c139..0bcfb9628ad7 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 @@ -45,14 +45,16 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config - def list( + def list_by_billing_profile( self, billing_account_id, # type: str billing_profile_id, # type: str **kwargs # type: Any ): # type: (...) -> Iterable["_models.Lots"] - """Lists the lots by billingAccountId and billingProfileId. + """Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a + billing profile. Microsoft Azure consumption commitments are only supported for the billing + account scope. :param billing_account_id: BillingAccount ID. :type billing_account_id: str @@ -68,7 +70,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" def prepare_request(next_link=None): @@ -78,7 +80,7 @@ def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list.metadata['url'] # type: ignore + url = self.list_by_billing_profile.metadata['url'] # type: ignore path_format_arguments = { 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), 'billingProfileId': self._serialize.url("billing_profile_id", billing_profile_id, 'str'), @@ -109,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.failsafe_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) @@ -118,4 +120,84 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.Consumption/lots'} # type: ignore + list_by_billing_profile.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.Consumption/lots'} # type: ignore + + def list_by_billing_account( + self, + billing_account_id, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.Lots"] + """Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a + billing profile. Microsoft Azure consumption commitments are only supported for the billing + account scope. + + :param billing_account_id: BillingAccount ID. + :type billing_account_id: str + :param filter: May be used to filter the lots by Status, Source etc. The filter supports 'eq', + 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag + filter is a key value pair string where key and value is separated by a colon (:). + :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 Lots or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.consumption.models.Lots] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Lots"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_billing_account.metadata['url'] # type: ignore + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('Lots', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + 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.failsafe_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) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/lots'} # type: ignore 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 40e846b0e68a..13b66223c0a5 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 @@ -90,7 +90,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" def prepare_request(next_link=None): @@ -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.failsafe_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 813dfd60a360..413b3e24df5e 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 @@ -62,7 +62,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" def prepare_request(next_link=None): @@ -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.failsafe_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 e9a983b25ece..436ab8cb71ed 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 @@ -52,8 +52,8 @@ def get( **kwargs # type: Any ): # 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. + """Gets the price sheet for a subscription. Price sheet is available via this API only for May 1, + 2014 or later. :param expand: May be used to expand the properties/meterDetails within a price sheet. By default, these fields are not included when returning price sheet. @@ -74,7 +74,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" # Construct URL @@ -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.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PriceSheetResult', pipeline_response) @@ -148,7 +148,7 @@ def get_by_billing_period( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" # Construct URL @@ -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.failsafe_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 103b363b2977..fe4252ed7b66 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 @@ -46,8 +46,8 @@ def __init__(self, client, config, serializer, deserializer): def get( self, - billing_scope, # type: str - scope, # type: Union[str, "_models.Scope"] + scope, # type: str + scope1, # type: Union[str, "_models.Scope"] region, # type: str term, # type: Union[str, "_models.Term"] look_back_period, # type: Union[str, "_models.LookBackPeriod"] @@ -57,15 +57,15 @@ def get( # 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. - This includes '/subscriptions/{subscriptionId}/' for subscription scope, + :param scope: The scope associated with reservation recommendation details operations. This + includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope. - :type billing_scope: str - :param scope: Scope of the reservation. - :type scope: str or ~azure.mgmt.consumption.models.Scope + :type scope: str + :param scope1: Scope of the reservation. + :type scope1: str or ~azure.mgmt.consumption.models.Scope :param region: Used to select the region the recommendation should be generated for. :type region: str :param term: Specify length of reservation recommendation term. @@ -86,20 +86,20 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'billingScope': self._serialize.url("billing_scope", billing_scope, 'str', skip_quote=True), + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - query_parameters['scope'] = self._serialize.query("scope", scope, 'str') + query_parameters['scope'] = self._serialize.query("scope1", scope1, 'str') query_parameters['region'] = self._serialize.query("region", region, 'str') query_parameters['term'] = self._serialize.query("term", term, 'str') query_parameters['lookBackPeriod'] = self._serialize.query("look_back_period", look_back_period, 'str') @@ -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.failsafe_deserialize(_models.HighCasedErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -126,4 +126,4 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/{billingScope}/providers/Microsoft.Consumption/reservationRecommendationDetails'} # type: ignore + get.metadata = {'url': '/{scope}/providers/Microsoft.Consumption/reservationRecommendationDetails'} # type: ignore 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 4ccabe6916da..ca7b4bf126a4 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 @@ -79,7 +79,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" def prepare_request(next_link=None): @@ -121,7 +121,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200, 204]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_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 6a880e33d835..bc8c1323ba35 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 @@ -69,7 +69,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" def prepare_request(next_link=None): @@ -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.failsafe_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) @@ -149,7 +149,7 @@ def list_by_billing_profile( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" def prepare_request(next_link=None): @@ -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.failsafe_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 f36ae1dea425..04f3b4da96b8 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 @@ -69,7 +69,7 @@ def list_by_reservation_order( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" def prepare_request(next_link=None): @@ -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.failsafe_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) @@ -148,7 +148,7 @@ def list_by_reservation_order_and_reservation( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" def prepare_request(next_link=None): @@ -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.failsafe_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) @@ -244,7 +244,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" def prepare_request(next_link=None): @@ -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.failsafe_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 3a8ed1bb990b..b80ebc0ac530 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 @@ -72,7 +72,7 @@ def list_by_reservation_order( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" def prepare_request(next_link=None): @@ -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.failsafe_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) @@ -156,7 +156,7 @@ def list_by_reservation_order_and_reservation( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" def prepare_request(next_link=None): @@ -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.failsafe_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) @@ -256,7 +256,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" def prepare_request(next_link=None): @@ -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.failsafe_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 e6cedfb6f459..234a9fcd23d1 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 @@ -49,7 +49,7 @@ def get( scope, # type: str **kwargs # type: Any ): - # type: (...) -> "_models.TagsResult" + # type: (...) -> Optional["_models.TagsResult"] """Get all available tag keys for the defined scope. :param scope: The scope associated with tags operations. This includes @@ -65,15 +65,15 @@ def get( :type scope: str :keyword callable cls: A custom type or function that will be passed the direct response :return: TagsResult, or the result of cls(response) - :rtype: ~azure.mgmt.consumption.models.TagsResult + :rtype: ~azure.mgmt.consumption.models.TagsResult or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.TagsResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.TagsResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" # Construct URL @@ -95,12 +95,14 @@ def get( pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + 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.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('TagsResult', pipeline_response) + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TagsResult', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) 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 ea7090e301f1..ff22b32c1be8 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 @@ -109,7 +109,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-10-01" + api_version = "2021-05-01" accept = "application/json" def prepare_request(next_link=None): @@ -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.failsafe_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)