diff --git a/sdk/consumption/azure-mgmt-consumption/CHANGELOG.md b/sdk/consumption/azure-mgmt-consumption/CHANGELOG.md index bc35596b063e..c4d389e9cd1c 100644 --- a/sdk/consumption/azure-mgmt-consumption/CHANGELOG.md +++ b/sdk/consumption/azure-mgmt-consumption/CHANGELOG.md @@ -1,5 +1,36 @@ # Release History +## 8.0.0b1 (2020-10-31) + +This is beta preview version. +For detailed changelog please refer to equivalent stable version 3.0.0(https://pypi.org/project/azure-mgmt-consumption/3.0.0/) + +This version uses a next-generation code generator that introduces important breaking changes, but also important new features (like unified authentication and async programming). + +**General breaking changes** + +- Credential system has been completly revamped: + + - `azure.common.credentials` or `msrestazure.azure_active_directory` instances are no longer supported, use the `azure-identity` classes instead: https://pypi.org/project/azure-identity/ + - `credentials` parameter has been renamed `credential` + +- The `config` attribute no longer exists on a client, configuration should be passed as kwarg. Example: `MyClient(credential, subscription_id, enable_logging=True)`. For a complete set of + supported options, see the [parameters accept in init documentation of azure-core](https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/core/azure-core/CLIENT_LIBRARY_DEVELOPER.md#available-policies) +- You can't import a `version` module anymore, use `__version__` instead +- Operations that used to return a `msrest.polling.LROPoller` now returns a `azure.core.polling.LROPoller` and are prefixed with `begin_`. +- Exceptions tree have been simplified and most exceptions are now `azure.core.exceptions.HttpResponseError` (`CloudError` has been removed). +- Most of the operation kwarg have changed. Some of the most noticeable: + + - `raw` has been removed. Equivalent feature can be found using `cls`, a callback that will give access to internal HTTP response for advanced user + - For a complete set of supported options, see the [parameters accept in Request documentation of azure-core](https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/core/azure-core/CLIENT_LIBRARY_DEVELOPER.md#available-policies) + +**General new features** + +- Type annotations support using `typing`. SDKs are mypy ready. +- This client has now stable and official support for async. Check the `aio` namespace of your package to find the async client. +- This client now support natively tracing library like OpenCensus or OpenTelemetry. See this [tracing quickstart](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/core/azure-core-tracing-opentelemetry) for an overview. + + ## 3.0.0 (2018-05-16) **Features** diff --git a/sdk/consumption/azure-mgmt-consumption/README.md b/sdk/consumption/azure-mgmt-consumption/README.md index 8f9bf036eb9b..a3c08e6c8278 100644 --- a/sdk/consumption/azure-mgmt-consumption/README.md +++ b/sdk/consumption/azure-mgmt-consumption/README.md @@ -14,11 +14,17 @@ library. For a more complete set of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). -## Usage +# Usage + + +To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt) + + + +For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/) +Code samples for this package can be found at [Consumption Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com. +Additional code samples for different Azure services are available at [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples) -For code examples, see -[Consumption](https://docs.microsoft.com/python/api/overview/azure/consumption) -on docs.microsoft.com. ## Provide Feedback diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/__init__.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/__init__.py index 184b8ddbd0f6..2bdfad84041a 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/__init__.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/__init__.py @@ -1,18 +1,19 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from .consumption_management_client import ConsumptionManagementClient -from .version import VERSION - -__all__ = ['ConsumptionManagementClient'] +from ._consumption_management_client import ConsumptionManagementClient +from ._version import VERSION __version__ = VERSION +__all__ = ['ConsumptionManagementClient'] +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/_configuration.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/_configuration.py new file mode 100644 index 000000000000..23d380af7ac4 --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/_configuration.py @@ -0,0 +1,71 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +from ._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + + +class ConsumptionManagementClientConfiguration(Configuration): + """Configuration for ConsumptionManagementClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: Azure Subscription ID. + :type subscription_id: str + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(ConsumptionManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2019-10-01" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-consumption/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **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 new file mode 100644 index 000000000000..bd8acadb67e7 --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/_consumption_management_client.py @@ -0,0 +1,154 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential + +from ._configuration import ConsumptionManagementClientConfiguration +from .operations import UsageDetailsOperations +from .operations import MarketplacesOperations +from .operations import BudgetsOperations +from .operations import TagsOperations +from .operations import ChargesOperations +from .operations import BalancesOperations +from .operations import ReservationsSummariesOperations +from .operations import ReservationsDetailsOperations +from .operations import ReservationRecommendationsOperations +from .operations import ReservationRecommendationDetailsOperations +from .operations import ReservationTransactionsOperations +from .operations import PriceSheetOperations +from .operations import ForecastsOperations +from .operations import Operations +from .operations import AggregatedCostOperations +from .operations import EventsOperations +from .operations import LotsOperations +from .operations import CreditsOperations +from . import models + + +class ConsumptionManagementClient(object): + """Consumption management client provides access to consumption resources for Azure Enterprise Subscriptions. + + :ivar usage_details: UsageDetailsOperations operations + :vartype usage_details: azure.mgmt.consumption.operations.UsageDetailsOperations + :ivar marketplaces: MarketplacesOperations operations + :vartype marketplaces: azure.mgmt.consumption.operations.MarketplacesOperations + :ivar budgets: BudgetsOperations operations + :vartype budgets: azure.mgmt.consumption.operations.BudgetsOperations + :ivar tags: TagsOperations operations + :vartype tags: azure.mgmt.consumption.operations.TagsOperations + :ivar charges: ChargesOperations operations + :vartype charges: azure.mgmt.consumption.operations.ChargesOperations + :ivar balances: BalancesOperations operations + :vartype balances: azure.mgmt.consumption.operations.BalancesOperations + :ivar reservations_summaries: ReservationsSummariesOperations operations + :vartype reservations_summaries: azure.mgmt.consumption.operations.ReservationsSummariesOperations + :ivar reservations_details: ReservationsDetailsOperations operations + :vartype reservations_details: azure.mgmt.consumption.operations.ReservationsDetailsOperations + :ivar reservation_recommendations: ReservationRecommendationsOperations operations + :vartype reservation_recommendations: azure.mgmt.consumption.operations.ReservationRecommendationsOperations + :ivar reservation_recommendation_details: ReservationRecommendationDetailsOperations operations + :vartype reservation_recommendation_details: azure.mgmt.consumption.operations.ReservationRecommendationDetailsOperations + :ivar reservation_transactions: ReservationTransactionsOperations operations + :vartype reservation_transactions: azure.mgmt.consumption.operations.ReservationTransactionsOperations + :ivar price_sheet: PriceSheetOperations operations + :vartype price_sheet: azure.mgmt.consumption.operations.PriceSheetOperations + :ivar forecasts: ForecastsOperations operations + :vartype forecasts: azure.mgmt.consumption.operations.ForecastsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.consumption.operations.Operations + :ivar aggregated_cost: AggregatedCostOperations operations + :vartype aggregated_cost: azure.mgmt.consumption.operations.AggregatedCostOperations + :ivar events: EventsOperations operations + :vartype events: azure.mgmt.consumption.operations.EventsOperations + :ivar lots: LotsOperations operations + :vartype lots: azure.mgmt.consumption.operations.LotsOperations + :ivar credits: CreditsOperations operations + :vartype credits: azure.mgmt.consumption.operations.CreditsOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: Azure Subscription ID. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = ConsumptionManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.usage_details = UsageDetailsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.marketplaces = MarketplacesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.budgets = BudgetsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.tags = TagsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.charges = ChargesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.balances = BalancesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.reservations_summaries = ReservationsSummariesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.reservations_details = ReservationsDetailsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.reservation_recommendations = ReservationRecommendationsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.reservation_recommendation_details = ReservationRecommendationDetailsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.reservation_transactions = ReservationTransactionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.price_sheet = PriceSheetOperations( + self._client, self._config, self._serialize, self._deserialize) + self.forecasts = ForecastsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.aggregated_cost = AggregatedCostOperations( + self._client, self._config, self._serialize, self._deserialize) + self.events = EventsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.lots = LotsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.credits = CreditsOperations( + self._client, self._config, self._serialize, self._deserialize) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> ConsumptionManagementClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/version.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/_version.py similarity index 84% rename from sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/version.py rename to sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/_version.py index 7f225c6aab41..0d5779dc14de 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/version.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/_version.py @@ -1,13 +1,9 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "3.0.0" - +VERSION = "8.0.0b1" diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/tag.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/__init__.py similarity index 51% rename from sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/tag.py rename to sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/__init__.py index f52e1c5671ad..9894be2c5458 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/tag.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/__init__.py @@ -1,28 +1,10 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model - - -class Tag(Model): - """The tag resource. - - :param key: Tag key. - :type key: str - """ - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(Tag, self).__init__(**kwargs) - self.key = kwargs.get('key', None) +from ._consumption_management_client import ConsumptionManagementClient +__all__ = ['ConsumptionManagementClient'] 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 new file mode 100644 index 000000000000..35ea926982d4 --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/_configuration.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +from .._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class ConsumptionManagementClientConfiguration(Configuration): + """Configuration for ConsumptionManagementClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: Azure Subscription ID. + :type subscription_id: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(ConsumptionManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2019-10-01" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-consumption/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **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 new file mode 100644 index 000000000000..c709a3e4f1e9 --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/_consumption_management_client.py @@ -0,0 +1,148 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import ConsumptionManagementClientConfiguration +from .operations import UsageDetailsOperations +from .operations import MarketplacesOperations +from .operations import BudgetsOperations +from .operations import TagsOperations +from .operations import ChargesOperations +from .operations import BalancesOperations +from .operations import ReservationsSummariesOperations +from .operations import ReservationsDetailsOperations +from .operations import ReservationRecommendationsOperations +from .operations import ReservationRecommendationDetailsOperations +from .operations import ReservationTransactionsOperations +from .operations import PriceSheetOperations +from .operations import ForecastsOperations +from .operations import Operations +from .operations import AggregatedCostOperations +from .operations import EventsOperations +from .operations import LotsOperations +from .operations import CreditsOperations +from .. import models + + +class ConsumptionManagementClient(object): + """Consumption management client provides access to consumption resources for Azure Enterprise Subscriptions. + + :ivar usage_details: UsageDetailsOperations operations + :vartype usage_details: azure.mgmt.consumption.aio.operations.UsageDetailsOperations + :ivar marketplaces: MarketplacesOperations operations + :vartype marketplaces: azure.mgmt.consumption.aio.operations.MarketplacesOperations + :ivar budgets: BudgetsOperations operations + :vartype budgets: azure.mgmt.consumption.aio.operations.BudgetsOperations + :ivar tags: TagsOperations operations + :vartype tags: azure.mgmt.consumption.aio.operations.TagsOperations + :ivar charges: ChargesOperations operations + :vartype charges: azure.mgmt.consumption.aio.operations.ChargesOperations + :ivar balances: BalancesOperations operations + :vartype balances: azure.mgmt.consumption.aio.operations.BalancesOperations + :ivar reservations_summaries: ReservationsSummariesOperations operations + :vartype reservations_summaries: azure.mgmt.consumption.aio.operations.ReservationsSummariesOperations + :ivar reservations_details: ReservationsDetailsOperations operations + :vartype reservations_details: azure.mgmt.consumption.aio.operations.ReservationsDetailsOperations + :ivar reservation_recommendations: ReservationRecommendationsOperations operations + :vartype reservation_recommendations: azure.mgmt.consumption.aio.operations.ReservationRecommendationsOperations + :ivar reservation_recommendation_details: ReservationRecommendationDetailsOperations operations + :vartype reservation_recommendation_details: azure.mgmt.consumption.aio.operations.ReservationRecommendationDetailsOperations + :ivar reservation_transactions: ReservationTransactionsOperations operations + :vartype reservation_transactions: azure.mgmt.consumption.aio.operations.ReservationTransactionsOperations + :ivar price_sheet: PriceSheetOperations operations + :vartype price_sheet: azure.mgmt.consumption.aio.operations.PriceSheetOperations + :ivar forecasts: ForecastsOperations operations + :vartype forecasts: azure.mgmt.consumption.aio.operations.ForecastsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.consumption.aio.operations.Operations + :ivar aggregated_cost: AggregatedCostOperations operations + :vartype aggregated_cost: azure.mgmt.consumption.aio.operations.AggregatedCostOperations + :ivar events: EventsOperations operations + :vartype events: azure.mgmt.consumption.aio.operations.EventsOperations + :ivar lots: LotsOperations operations + :vartype lots: azure.mgmt.consumption.aio.operations.LotsOperations + :ivar credits: CreditsOperations operations + :vartype credits: azure.mgmt.consumption.aio.operations.CreditsOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: Azure Subscription ID. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = ConsumptionManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.usage_details = UsageDetailsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.marketplaces = MarketplacesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.budgets = BudgetsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.tags = TagsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.charges = ChargesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.balances = BalancesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.reservations_summaries = ReservationsSummariesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.reservations_details = ReservationsDetailsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.reservation_recommendations = ReservationRecommendationsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.reservation_recommendation_details = ReservationRecommendationDetailsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.reservation_transactions = ReservationTransactionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.price_sheet = PriceSheetOperations( + self._client, self._config, self._serialize, self._deserialize) + self.forecasts = ForecastsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.aggregated_cost = AggregatedCostOperations( + self._client, self._config, self._serialize, self._deserialize) + self.events = EventsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.lots = LotsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.credits = CreditsOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "ConsumptionManagementClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/__init__.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/__init__.py new file mode 100644 index 000000000000..9736d77b0f1e --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/__init__.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._usage_details_operations import UsageDetailsOperations +from ._marketplaces_operations import MarketplacesOperations +from ._budgets_operations import BudgetsOperations +from ._tags_operations import TagsOperations +from ._charges_operations import ChargesOperations +from ._balances_operations import BalancesOperations +from ._reservations_summaries_operations import ReservationsSummariesOperations +from ._reservations_details_operations import ReservationsDetailsOperations +from ._reservation_recommendations_operations import ReservationRecommendationsOperations +from ._reservation_recommendation_details_operations import ReservationRecommendationDetailsOperations +from ._reservation_transactions_operations import ReservationTransactionsOperations +from ._price_sheet_operations import PriceSheetOperations +from ._forecasts_operations import ForecastsOperations +from ._operations import Operations +from ._aggregated_cost_operations import AggregatedCostOperations +from ._events_operations import EventsOperations +from ._lots_operations import LotsOperations +from ._credits_operations import CreditsOperations + +__all__ = [ + 'UsageDetailsOperations', + 'MarketplacesOperations', + 'BudgetsOperations', + 'TagsOperations', + 'ChargesOperations', + 'BalancesOperations', + 'ReservationsSummariesOperations', + 'ReservationsDetailsOperations', + 'ReservationRecommendationsOperations', + 'ReservationRecommendationDetailsOperations', + 'ReservationTransactionsOperations', + 'PriceSheetOperations', + 'ForecastsOperations', + 'Operations', + 'AggregatedCostOperations', + 'EventsOperations', + 'LotsOperations', + 'CreditsOperations', +] 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 new file mode 100644 index 000000000000..8b009d96f666 --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_aggregated_cost_operations.py @@ -0,0 +1,163 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AggregatedCostOperations: + """AggregatedCostOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.consumption.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get_by_management_group( + self, + management_group_id: str, + filter: Optional[str] = None, + **kwargs + ) -> "models.ManagementGroupAggregatedCostResult": + """Provides the aggregate cost of a management group and all child management groups by current + billing period. + + :param management_group_id: Azure Management Group ID. + :type management_group_id: str + :param filter: May be used to filter aggregated cost by properties/usageStart (Utc time), + properties/usageEnd (Utc time). 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: ManagementGroupAggregatedCostResult, or the result of cls(response) + :rtype: ~azure.mgmt.consumption.models.ManagementGroupAggregatedCostResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ManagementGroupAggregatedCostResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-01" + accept = "application/json" + + # Construct URL + url = self.get_by_management_group.metadata['url'] # type: ignore + path_format_arguments = { + 'managementGroupId': self._serialize.url("management_group_id", management_group_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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + 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) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ManagementGroupAggregatedCostResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_by_management_group.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Consumption/aggregatedcost'} # type: ignore + + async def get_for_billing_period_by_management_group( + self, + management_group_id: str, + billing_period_name: str, + **kwargs + ) -> "models.ManagementGroupAggregatedCostResult": + """Provides the aggregate cost of a management group and all child management groups by specified + billing period. + + :param management_group_id: Azure Management Group ID. + :type management_group_id: str + :param billing_period_name: Billing Period Name. + :type billing_period_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagementGroupAggregatedCostResult, or the result of cls(response) + :rtype: ~azure.mgmt.consumption.models.ManagementGroupAggregatedCostResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ManagementGroupAggregatedCostResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-01" + accept = "application/json" + + # Construct URL + url = self.get_for_billing_period_by_management_group.metadata['url'] # type: ignore + path_format_arguments = { + 'managementGroupId': self._serialize.url("management_group_id", management_group_id, 'str'), + 'billingPeriodName': self._serialize.url("billing_period_name", billing_period_name, '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + 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) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ManagementGroupAggregatedCostResult', pipeline_response) + + if cls: + 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 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 new file mode 100644 index 000000000000..be5dd721ac7d --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_balances_operations.py @@ -0,0 +1,155 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class BalancesOperations: + """BalancesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.consumption.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get_by_billing_account( + self, + billing_account_id: str, + **kwargs + ) -> "models.Balance": + """Gets the balances for a scope by billingAccountId. Balances are available via this API only for + May 1, 2014 or later. + + :param billing_account_id: BillingAccount ID. + :type billing_account_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Balance, or the result of cls(response) + :rtype: ~azure.mgmt.consumption.models.Balance + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Balance"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-01" + accept = "application/json" + + # Construct URL + url = self.get_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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + 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) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Balance', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_by_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/balances'} # type: ignore + + async def get_for_billing_period_by_billing_account( + self, + billing_account_id: str, + billing_period_name: str, + **kwargs + ) -> "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. + + :param billing_account_id: BillingAccount ID. + :type billing_account_id: str + :param billing_period_name: Billing Period Name. + :type billing_period_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Balance, or the result of cls(response) + :rtype: ~azure.mgmt.consumption.models.Balance + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Balance"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-01" + accept = "application/json" + + # Construct URL + url = self.get_for_billing_period_by_billing_account.metadata['url'] # type: ignore + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), + 'billingPeriodName': self._serialize.url("billing_period_name", billing_period_name, '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + 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) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Balance', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_for_billing_period_by_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/balances'} # type: ignore 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 new file mode 100644 index 000000000000..c15217abae40 --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_budgets_operations.py @@ -0,0 +1,349 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class BudgetsOperations: + """BudgetsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.consumption.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + scope: str, + **kwargs + ) -> AsyncIterable["models.BudgetsListResult"]: + """Lists all budgets for the defined scope. + + :param scope: The scope associated with budget operations. This includes + '/subscriptions/{subscriptionId}/' for subscription scope, + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' + for Department scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + for EnrollmentAccount scope, + '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group + scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + for billingProfile scope, + 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' + for invoiceSection scope. + :type scope: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either BudgetsListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.consumption.models.BudgetsListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.BudgetsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-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.metadata['url'] # type: ignore + path_format_arguments = { + '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') + + 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('BudgetsListResult', 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(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.metadata = {'url': '/{scope}/providers/Microsoft.Consumption/budgets'} # type: ignore + + async def get( + self, + scope: str, + budget_name: str, + **kwargs + ) -> "models.Budget": + """Gets the budget for the scope by budget name. + + :param scope: The scope associated with budget operations. This includes + '/subscriptions/{subscriptionId}/' for subscription scope, + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' + for Department scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + for EnrollmentAccount scope, + '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group + scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + for billingProfile scope, + 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' + for invoiceSection scope. + :type scope: str + :param budget_name: Budget Name. + :type budget_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Budget, or the result of cls(response) + :rtype: ~azure.mgmt.consumption.models.Budget + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Budget"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'budgetName': self._serialize.url("budget_name", budget_name, '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + 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) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Budget', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}'} # type: ignore + + async def create_or_update( + self, + scope: str, + budget_name: str, + parameters: "models.Budget", + **kwargs + ) -> "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. + + :param scope: The scope associated with budget operations. This includes + '/subscriptions/{subscriptionId}/' for subscription scope, + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' + for Department scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + for EnrollmentAccount scope, + '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group + scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + for billingProfile scope, + 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' + for invoiceSection scope. + :type scope: str + :param budget_name: Budget Name. + :type budget_name: str + :param parameters: Parameters supplied to the Create Budget operation. + :type parameters: ~azure.mgmt.consumption.models.Budget + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Budget, or the result of cls(response) + :rtype: ~azure.mgmt.consumption.models.Budget + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Budget"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'budgetName': self._serialize.url("budget_name", budget_name, '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'Budget') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + 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) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Budget', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Budget', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}'} # type: ignore + + async def delete( + self, + scope: str, + budget_name: str, + **kwargs + ) -> None: + """The operation to delete a budget. + + :param scope: The scope associated with budget operations. This includes + '/subscriptions/{subscriptionId}/' for subscription scope, + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' + for Department scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + for EnrollmentAccount scope, + '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group + scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + for billingProfile scope, + 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' + for invoiceSection scope. + :type scope: str + :param budget_name: Budget Name. + :type budget_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'budgetName': self._serialize.url("budget_name", budget_name, '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + 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) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}'} # type: ignore 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 new file mode 100644 index 000000000000..45b1776a21cf --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_charges_operations.py @@ -0,0 +1,135 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ChargesOperations: + """ChargesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.consumption.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def list( + self, + scope: str, + start_date: Optional[str] = None, + end_date: Optional[str] = None, + filter: Optional[str] = None, + apply: Optional[str] = None, + **kwargs + ) -> "models.ChargesListResult": + """Lists the charges based for the defined scope. + + :param scope: The scope associated with charges operations. This includes + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' + for Department scope, and + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + for EnrollmentAccount scope. For department and enrollment accounts, you can also add billing + period to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + For e.g. to specify billing period at department scope use + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + Also, Modern Commerce Account scopes are + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + for billingProfile scope, + 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + for invoiceSection scope, and + 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' + specific for partners. + :type scope: str + :param start_date: Start date. + :type start_date: str + :param end_date: End date. + :type end_date: str + :param filter: May be used to filter charges by properties/usageEnd (Utc time), + properties/usageStart (Utc time). 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 + :param apply: May be used to group charges for billingAccount scope by + properties/billingProfileId, properties/invoiceSectionId, properties/customerId (specific for + Partner Led), or for billingProfile scope by properties/invoiceSectionId. + :type apply: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ChargesListResult, or the result of cls(response) + :rtype: ~azure.mgmt.consumption.models.ChargesListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ChargesListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-01" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + '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') + if start_date is not None: + query_parameters['startDate'] = self._serialize.query("start_date", start_date, 'str') + if end_date is not None: + query_parameters['endDate'] = self._serialize.query("end_date", end_date, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if apply is not None: + query_parameters['$apply'] = self._serialize.query("apply", apply, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + 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) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ChargesListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/{scope}/providers/Microsoft.Consumption/charges'} # type: ignore 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 new file mode 100644 index 000000000000..9b27049ece45 --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_credits_operations.py @@ -0,0 +1,99 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class CreditsOperations: + """CreditsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.consumption.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + billing_account_id: str, + billing_profile_id: str, + **kwargs + ) -> "models.CreditSummary": + """The credit summary by billingAccountId and billingProfileId. + + :param billing_account_id: BillingAccount ID. + :type billing_account_id: str + :param billing_profile_id: Azure Billing Profile ID. + :type billing_profile_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CreditSummary, or the result of cls(response) + :rtype: ~azure.mgmt.consumption.models.CreditSummary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CreditSummary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-01" + accept = "application/json" + + # Construct URL + url = self.get.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'), + } + 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + 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) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CreditSummary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.Consumption/credits/balanceSummary'} # type: ignore 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 new file mode 100644 index 000000000000..31006fbf05dd --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_events_operations.py @@ -0,0 +1,124 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class EventsOperations: + """EventsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.consumption.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + billing_account_id: str, + billing_profile_id: str, + start_date: str, + end_date: str, + **kwargs + ) -> AsyncIterable["models.Events"]: + """Lists the events by billingAccountId and billingProfileId for given start and end date. + + :param billing_account_id: BillingAccount ID. + :type billing_account_id: str + :param billing_profile_id: Azure Billing Profile ID. + :type billing_profile_id: str + :param start_date: Start date. + :type start_date: str + :param end_date: End date. + :type end_date: 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 = "2019-10-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.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'), + } + 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['startDate'] = self._serialize.query("start_date", start_date, 'str') + query_parameters['endDate'] = self._serialize.query("end_date", end_date, '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(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.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/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 new file mode 100644 index 000000000000..c511f791fd20 --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_forecasts_operations.py @@ -0,0 +1,116 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ForecastsOperations: + """ForecastsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.consumption.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + filter: Optional[str] = None, + **kwargs + ) -> AsyncIterable["models.ForecastsListResult"]: + """Lists the forecast charges by subscriptionId. + + :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', + and 'and'. It does not currently support 'ne', 'or', or 'not'. + :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 ForecastsListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.consumption.models.ForecastsListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ForecastsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-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.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, '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('ForecastsListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return 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(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.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/forecasts'} # type: ignore 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 new file mode 100644 index 000000000000..e854e7763c86 --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_lots_operations.py @@ -0,0 +1,116 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class LotsOperations: + """LotsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.consumption.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + billing_account_id: str, + billing_profile_id: str, + **kwargs + ) -> AsyncIterable["models.Lots"]: + """Lists the lots by billingAccountId and billingProfileId. + + :param billing_account_id: BillingAccount ID. + :type billing_account_id: str + :param billing_profile_id: Azure Billing Profile ID. + :type billing_profile_id: 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 = "2019-10-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.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'), + } + 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') + + 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(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.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/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 new file mode 100644 index 000000000000..d0e2921c70e5 --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_marketplaces_operations.py @@ -0,0 +1,143 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class MarketplacesOperations: + """MarketplacesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.consumption.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + scope: str, + filter: Optional[str] = None, + top: Optional[int] = None, + skiptoken: Optional[str] = None, + **kwargs + ) -> 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. + + :param scope: The scope associated with marketplace operations. This includes + '/subscriptions/{subscriptionId}/' for subscription scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, + '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount + scope and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management + Group scope. For subscription, billing account, department, enrollment account and + ManagementGroup, you can also add billing period to the scope using + '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing + period at department scope use + '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + :type scope: str + :param filter: May be used to filter marketplaces by properties/usageEnd (Utc time), + properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName or + properties/instanceId. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not + currently support 'ne', 'or', or 'not'. + :type filter: str + :param top: May be used to limit the number of results to the most recent N marketplaces. + :type top: int + :param skiptoken: Skiptoken is only used if a previous operation returned a partial result. If + a previous response contains a nextLink element, the value of the nextLink element will include + a skiptoken parameter that specifies a starting point to use for subsequent calls. + :type skiptoken: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either MarketplacesListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.consumption.models.MarketplacesListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.MarketplacesListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-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.metadata['url'] # type: ignore + path_format_arguments = { + '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] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, '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('MarketplacesListResult', 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(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.metadata = {'url': '/{scope}/providers/Microsoft.Consumption/marketplaces'} # type: ignore 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 new file mode 100644 index 000000000000..1c34ff459644 --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_operations.py @@ -0,0 +1,105 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class Operations: + """Operations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.consumption.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["models.OperationListResult"]: + """Lists all of the available consumption REST API operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.consumption.models.OperationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-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.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, '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('OperationListResult', 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(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.metadata = {'url': '/providers/Microsoft.Consumption/operations'} # type: ignore 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 new file mode 100644 index 000000000000..d00a9af531fd --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_price_sheet_operations.py @@ -0,0 +1,185 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PriceSheetOperations: + """PriceSheetOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.consumption.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + expand: Optional[str] = None, + skiptoken: Optional[str] = None, + top: Optional[int] = None, + **kwargs + ) -> "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. + + :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. + :type expand: str + :param skiptoken: Skiptoken is only used if a previous operation returned a partial result. If + a previous response contains a nextLink element, the value of the nextLink element will include + a skiptoken parameter that specifies a starting point to use for subsequent calls. + :type skiptoken: str + :param top: May be used to limit the number of results to the top N results. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PriceSheetResult, or the result of cls(response) + :rtype: ~azure.mgmt.consumption.models.PriceSheetResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PriceSheetResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + 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) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PriceSheetResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/pricesheets/default'} # type: ignore + + async def get_by_billing_period( + self, + billing_period_name: str, + expand: Optional[str] = None, + skiptoken: Optional[str] = None, + top: Optional[int] = None, + **kwargs + ) -> "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. + + :param billing_period_name: Billing Period Name. + :type billing_period_name: str + :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. + :type expand: str + :param skiptoken: Skiptoken is only used if a previous operation returned a partial result. If + a previous response contains a nextLink element, the value of the nextLink element will include + a skiptoken parameter that specifies a starting point to use for subsequent calls. + :type skiptoken: str + :param top: May be used to limit the number of results to the top N results. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PriceSheetResult, or the result of cls(response) + :rtype: ~azure.mgmt.consumption.models.PriceSheetResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PriceSheetResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-01" + accept = "application/json" + + # Construct URL + url = self.get_by_billing_period.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'billingPeriodName': self._serialize.url("billing_period_name", billing_period_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + 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) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PriceSheetResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_by_billing_period.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/pricesheets/default'} # type: ignore 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 new file mode 100644 index 000000000000..d54ff352e1ad --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_reservation_recommendation_details_operations.py @@ -0,0 +1,124 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ReservationRecommendationDetailsOperations: + """ReservationRecommendationDetailsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.consumption.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + billing_scope: str, + scope: Union[str, "models.Scope"], + region: str, + term: Union[str, "models.Term"], + look_back_period: Union[str, "models.LookBackPeriod"], + product: str, + **kwargs + ) -> 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, + '/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 + :param region: Used to select the region the recommendation should be generated for. + :type region: str + :param term: Specify length of reservation recommendation term. + :type term: str or ~azure.mgmt.consumption.models.Term + :param look_back_period: Filter the time period on which reservation recommendation results are + based. + :type look_back_period: str or ~azure.mgmt.consumption.models.LookBackPeriod + :param product: Filter the products for which reservation recommendation results are generated. + Examples: Standard_DS1_v2 (for VM), Premium_SSD_Managed_Disks_P30 (for Managed Disks). + :type product: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ReservationRecommendationDetailsModel, or the result of cls(response) + :rtype: ~azure.mgmt.consumption.models.ReservationRecommendationDetailsModel or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ReservationRecommendationDetailsModel"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-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), + } + 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['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') + query_parameters['product'] = self._serialize.query("product", product, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + 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) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ReservationRecommendationDetailsModel', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/{billingScope}/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 new file mode 100644 index 000000000000..0668185974e6 --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_reservation_recommendations_operations.py @@ -0,0 +1,128 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ReservationRecommendationsOperations: + """ReservationRecommendationsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.consumption.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + scope: str, + filter: Optional[str] = None, + **kwargs + ) -> AsyncIterable["models.ReservationRecommendationsListResult"]: + """List of recommendations for purchasing reserved instances. + + :param scope: The scope associated with reservation recommendations 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 scope: str + :param filter: May be used to filter reservationRecommendations by: properties/scope with + allowed values ['Single', 'Shared'] and default value 'Single'; properties/resourceType with + allowed values ['VirtualMachines', 'SQLDatabases', 'PostgreSQL', 'ManagedDisk', 'MySQL', + 'RedHat', 'MariaDB', 'RedisCache', 'CosmosDB', 'SqlDataWarehouse', 'SUSELinux', 'AppService', + 'BlockBlob', 'AzureDataExplorer', 'VMwareCloudSimple'] and default value 'VirtualMachines'; and + properties/lookBackPeriod with allowed values ['Last7Days', 'Last30Days', 'Last60Days'] and + default value 'Last7Days'. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ReservationRecommendationsListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.consumption.models.ReservationRecommendationsListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ReservationRecommendationsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-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.metadata['url'] # type: ignore + path_format_arguments = { + '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] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, '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('ReservationRecommendationsListResult', 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(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.metadata = {'url': '/{scope}/providers/Microsoft.Consumption/reservationRecommendations'} # type: ignore 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 new file mode 100644 index 000000000000..5f902f3cccd8 --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_reservation_transactions_operations.py @@ -0,0 +1,198 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ReservationTransactionsOperations: + """ReservationTransactionsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.consumption.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + billing_account_id: str, + filter: Optional[str] = None, + **kwargs + ) -> AsyncIterable["models.ReservationTransactionsListResult"]: + """List of transactions for reserved instances on billing account scope. + + :param billing_account_id: BillingAccount ID. + :type billing_account_id: str + :param filter: Filter reservation transactions by date range. The properties/EventDate for + start date and end date. The filter supports 'le' and 'ge'. + :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 ReservationTransactionsListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.consumption.models.ReservationTransactionsListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ReservationTransactionsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-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.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] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, '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('ReservationTransactionsListResult', 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(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.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/reservationTransactions'} # type: ignore + + def list_by_billing_profile( + self, + billing_account_id: str, + billing_profile_id: str, + filter: Optional[str] = None, + **kwargs + ) -> AsyncIterable["models.ModernReservationTransactionsListResult"]: + """List of transactions for reserved instances on billing account scope. + + :param billing_account_id: BillingAccount ID. + :type billing_account_id: str + :param billing_profile_id: Azure Billing Profile ID. + :type billing_profile_id: str + :param filter: Filter reservation transactions by date range. The properties/EventDate for + start date and end date. The filter supports 'le' and 'ge'. + :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 ModernReservationTransactionsListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.consumption.models.ModernReservationTransactionsListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ModernReservationTransactionsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-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_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'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, '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('ModernReservationTransactionsListResult', 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(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_profile.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.Consumption/reservationTransactions'} # type: ignore 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 new file mode 100644 index 000000000000..894235ade0de --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_reservations_details_operations.py @@ -0,0 +1,299 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ReservationsDetailsOperations: + """ReservationsDetailsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.consumption.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_reservation_order( + self, + reservation_order_id: str, + filter: str, + **kwargs + ) -> AsyncIterable["models.ReservationDetailsListResult"]: + """Lists the reservations details for provided date range. + + :param reservation_order_id: Order Id of the reservation. + :type reservation_order_id: str + :param filter: Filter reservation details by date range. The properties/UsageDate for start + date and end date. The filter supports 'le' and 'ge'. + :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 ReservationDetailsListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.consumption.models.ReservationDetailsListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ReservationDetailsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-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_reservation_order.metadata['url'] # type: ignore + path_format_arguments = { + 'reservationOrderId': self._serialize.url("reservation_order_id", reservation_order_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, '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('ReservationDetailsListResult', 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(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_reservation_order.metadata = {'url': '/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/providers/Microsoft.Consumption/reservationDetails'} # type: ignore + + def list_by_reservation_order_and_reservation( + self, + reservation_order_id: str, + reservation_id: str, + filter: str, + **kwargs + ) -> AsyncIterable["models.ReservationDetailsListResult"]: + """Lists the reservations details for provided date range. + + :param reservation_order_id: Order Id of the reservation. + :type reservation_order_id: str + :param reservation_id: Id of the reservation. + :type reservation_id: str + :param filter: Filter reservation details by date range. The properties/UsageDate for start + date and end date. The filter supports 'le' and 'ge'. + :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 ReservationDetailsListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.consumption.models.ReservationDetailsListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ReservationDetailsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-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_reservation_order_and_reservation.metadata['url'] # type: ignore + path_format_arguments = { + 'reservationOrderId': self._serialize.url("reservation_order_id", reservation_order_id, 'str'), + 'reservationId': self._serialize.url("reservation_id", reservation_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, '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('ReservationDetailsListResult', 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(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_reservation_order_and_reservation.metadata = {'url': '/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/reservations/{reservationId}/providers/Microsoft.Consumption/reservationDetails'} # type: ignore + + def list( + self, + scope: str, + start_date: Optional[str] = None, + end_date: Optional[str] = None, + filter: Optional[str] = None, + reservation_id: Optional[str] = None, + reservation_order_id: Optional[str] = None, + **kwargs + ) -> AsyncIterable["models.ReservationDetailsListResult"]: + """Lists the reservations details for the defined scope and provided date range. + + :param scope: The scope associated with reservations details operations. This includes + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope + (legacy), and + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + for BillingProfile scope (modern). + :type scope: str + :param start_date: Start date. Only applicable when querying with billing profile. + :type start_date: str + :param end_date: End date. Only applicable when querying with billing profile. + :type end_date: str + :param filter: Filter reservation details by date range. The properties/UsageDate for start + date and end date. The filter supports 'le' and 'ge'. Not applicable when querying with + billing profile. + :type filter: str + :param reservation_id: Reservation Id GUID. Only valid if reservationOrderId is also provided. + Filter to a specific reservation. + :type reservation_id: str + :param reservation_order_id: Reservation Order Id GUID. Required if reservationId is provided. + Filter to a specific reservation order. + :type reservation_order_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ReservationDetailsListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.consumption.models.ReservationDetailsListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ReservationDetailsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-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.metadata['url'] # type: ignore + path_format_arguments = { + '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] + if start_date is not None: + query_parameters['startDate'] = self._serialize.query("start_date", start_date, 'str') + if end_date is not None: + query_parameters['endDate'] = self._serialize.query("end_date", end_date, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if reservation_id is not None: + query_parameters['reservationId'] = self._serialize.query("reservation_id", reservation_id, 'str') + if reservation_order_id is not None: + query_parameters['reservationOrderId'] = self._serialize.query("reservation_order_id", reservation_order_id, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, '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('ReservationDetailsListResult', 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(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.metadata = {'url': '/{scope}/providers/Microsoft.Consumption/reservationDetails'} # type: ignore 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 new file mode 100644 index 000000000000..89ee6810680d --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_reservations_summaries_operations.py @@ -0,0 +1,312 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ReservationsSummariesOperations: + """ReservationsSummariesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.consumption.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_reservation_order( + self, + reservation_order_id: str, + grain: Union[str, "models.Datagrain"], + filter: Optional[str] = None, + **kwargs + ) -> AsyncIterable["models.ReservationSummariesListResult"]: + """Lists the reservations summaries for daily or monthly grain. + + :param reservation_order_id: Order Id of the reservation. + :type reservation_order_id: str + :param grain: Can be daily or monthly. + :type grain: str or ~azure.mgmt.consumption.models.Datagrain + :param filter: Required only for daily grain. The properties/UsageDate for start date and end + date. The filter supports 'le' and 'ge'. + :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 ReservationSummariesListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.consumption.models.ReservationSummariesListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ReservationSummariesListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-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_reservation_order.metadata['url'] # type: ignore + path_format_arguments = { + 'reservationOrderId': self._serialize.url("reservation_order_id", reservation_order_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['grain'] = self._serialize.query("grain", grain, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, '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('ReservationSummariesListResult', 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(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_reservation_order.metadata = {'url': '/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/providers/Microsoft.Consumption/reservationSummaries'} # type: ignore + + def list_by_reservation_order_and_reservation( + self, + reservation_order_id: str, + reservation_id: str, + grain: Union[str, "models.Datagrain"], + filter: Optional[str] = None, + **kwargs + ) -> AsyncIterable["models.ReservationSummariesListResult"]: + """Lists the reservations summaries for daily or monthly grain. + + :param reservation_order_id: Order Id of the reservation. + :type reservation_order_id: str + :param reservation_id: Id of the reservation. + :type reservation_id: str + :param grain: Can be daily or monthly. + :type grain: str or ~azure.mgmt.consumption.models.Datagrain + :param filter: Required only for daily grain. The properties/UsageDate for start date and end + date. The filter supports 'le' and 'ge'. + :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 ReservationSummariesListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.consumption.models.ReservationSummariesListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ReservationSummariesListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-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_reservation_order_and_reservation.metadata['url'] # type: ignore + path_format_arguments = { + 'reservationOrderId': self._serialize.url("reservation_order_id", reservation_order_id, 'str'), + 'reservationId': self._serialize.url("reservation_id", reservation_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['grain'] = self._serialize.query("grain", grain, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, '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('ReservationSummariesListResult', 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(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_reservation_order_and_reservation.metadata = {'url': '/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/reservations/{reservationId}/providers/Microsoft.Consumption/reservationSummaries'} # type: ignore + + def list( + self, + scope: str, + grain: Union[str, "models.Datagrain"], + start_date: Optional[str] = None, + end_date: Optional[str] = None, + filter: Optional[str] = None, + reservation_id: Optional[str] = None, + reservation_order_id: Optional[str] = None, + **kwargs + ) -> AsyncIterable["models.ReservationSummariesListResult"]: + """Lists the reservations summaries for the defined scope daily or monthly grain. + + :param scope: The scope associated with reservations summaries operations. This includes + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope + (legacy), and + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + for BillingProfile scope (modern). + :type scope: str + :param grain: Can be daily or monthly. + :type grain: str or ~azure.mgmt.consumption.models.Datagrain + :param start_date: Start date. Only applicable when querying with billing profile. + :type start_date: str + :param end_date: End date. Only applicable when querying with billing profile. + :type end_date: str + :param filter: Required only for daily grain. The properties/UsageDate for start date and end + date. The filter supports 'le' and 'ge'. Not applicable when querying with billing profile. + :type filter: str + :param reservation_id: Reservation Id GUID. Only valid if reservationOrderId is also provided. + Filter to a specific reservation. + :type reservation_id: str + :param reservation_order_id: Reservation Order Id GUID. Required if reservationId is provided. + Filter to a specific reservation order. + :type reservation_order_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ReservationSummariesListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.consumption.models.ReservationSummariesListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ReservationSummariesListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-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.metadata['url'] # type: ignore + path_format_arguments = { + '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['grain'] = self._serialize.query("grain", grain, 'str') + if start_date is not None: + query_parameters['startDate'] = self._serialize.query("start_date", start_date, 'str') + if end_date is not None: + query_parameters['endDate'] = self._serialize.query("end_date", end_date, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if reservation_id is not None: + query_parameters['reservationId'] = self._serialize.query("reservation_id", reservation_id, 'str') + if reservation_order_id is not None: + query_parameters['reservationOrderId'] = self._serialize.query("reservation_order_id", reservation_order_id, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, '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('ReservationSummariesListResult', 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(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.metadata = {'url': '/{scope}/providers/Microsoft.Consumption/reservationSummaries'} # type: ignore 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 new file mode 100644 index 000000000000..c16d81f9fa32 --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_tags_operations.py @@ -0,0 +1,104 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class TagsOperations: + """TagsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.consumption.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + scope: str, + **kwargs + ) -> "models.TagsResult": + """Get all available tag keys for the defined scope. + + :param scope: The scope associated with tags operations. This includes + '/subscriptions/{subscriptionId}/' for subscription scope, + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' + for Department scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + for EnrollmentAccount scope and + '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group + scope.. + :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 + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.TagsResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + 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) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('TagsResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/{scope}/providers/Microsoft.Consumption/tags'} # type: ignore 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 new file mode 100644 index 000000000000..34dfd3527bd4 --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_usage_details_operations.py @@ -0,0 +1,166 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class UsageDetailsOperations: + """UsageDetailsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.consumption.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + scope: str, + expand: Optional[str] = None, + filter: Optional[str] = None, + skiptoken: Optional[str] = None, + top: Optional[int] = None, + metric: Optional[Union[str, "models.Metrictype"]] = None, + **kwargs + ) -> 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. + + :param scope: The scope associated with usage details operations. This includes + '/subscriptions/{subscriptionId}/' for subscription scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, + '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount + scope and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management + Group scope. For subscription, billing account, department, enrollment account and management + group, you can also add billing period to the scope using + '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing + period at department scope use + '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + Also, Modern Commerce Account scopes are + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + for billingProfile scope, + 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + for invoiceSection scope, and + 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' + specific for partners. + :type scope: str + :param expand: May be used to expand the properties/additionalInfo or properties/meterDetails + within a list of usage details. By default, these fields are not included when listing usage + details. + :type expand: str + :param filter: May be used to filter usageDetails by properties/resourceGroup, + properties/resourceName, properties/resourceId, properties/chargeType, + properties/reservationId, properties/publisherType or tags. 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 (:). PublisherType Filter + accepts two values azure and marketplace and it is currently supported for Web Direct Offer + Type. + :type filter: str + :param skiptoken: Skiptoken is only used if a previous operation returned a partial result. If + a previous response contains a nextLink element, the value of the nextLink element will include + a skiptoken parameter that specifies a starting point to use for subsequent calls. + :type skiptoken: str + :param top: May be used to limit the number of results to the most recent N usageDetails. + :type top: int + :param metric: Allows to select different type of cost/usage records. + :type metric: str or ~azure.mgmt.consumption.models.Metrictype + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either UsageDetailsListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.consumption.models.UsageDetailsListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.UsageDetailsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-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.metadata['url'] # type: ignore + path_format_arguments = { + '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] + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if metric is not None: + query_parameters['metric'] = self._serialize.query("metric", metric, '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('UsageDetailsListResult', 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(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.metadata = {'url': '/{scope}/providers/Microsoft.Consumption/usageDetails'} # type: ignore 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 deleted file mode 100644 index b3a48986494c..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/consumption_management_client.py +++ /dev/null @@ -1,141 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.service_client import SDKClient -from msrest import Serializer, Deserializer -from msrestazure import AzureConfiguration -from .version import VERSION -from .operations.usage_details_operations import UsageDetailsOperations -from .operations.marketplaces_operations import MarketplacesOperations -from .operations.budgets_operations import BudgetsOperations -from .operations.tags_operations import TagsOperations -from .operations.charges_operations import ChargesOperations -from .operations.balances_operations import BalancesOperations -from .operations.reservations_summaries_operations import ReservationsSummariesOperations -from .operations.reservations_details_operations import ReservationsDetailsOperations -from .operations.reservation_recommendations_operations import ReservationRecommendationsOperations -from .operations.price_sheet_operations import PriceSheetOperations -from .operations.forecasts_operations import ForecastsOperations -from .operations.operations import Operations -from .operations.aggregated_cost_operations import AggregatedCostOperations -from . import models - - -class ConsumptionManagementClientConfiguration(AzureConfiguration): - """Configuration for ConsumptionManagementClient - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Azure Subscription ID. - :type subscription_id: str - :param str base_url: Service URL - """ - - def __init__( - self, credentials, subscription_id, base_url=None): - - if credentials is None: - raise ValueError("Parameter 'credentials' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - if not base_url: - base_url = 'https://management.azure.com' - - super(ConsumptionManagementClientConfiguration, self).__init__(base_url) - - self.add_user_agent('azure-mgmt-consumption/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials - self.subscription_id = subscription_id - - -class ConsumptionManagementClient(SDKClient): - """Consumption management client provides access to consumption resources for Azure Enterprise Subscriptions. - - :ivar config: Configuration for client. - :vartype config: ConsumptionManagementClientConfiguration - - :ivar usage_details: UsageDetails operations - :vartype usage_details: azure.mgmt.consumption.operations.UsageDetailsOperations - :ivar marketplaces: Marketplaces operations - :vartype marketplaces: azure.mgmt.consumption.operations.MarketplacesOperations - :ivar budgets: Budgets operations - :vartype budgets: azure.mgmt.consumption.operations.BudgetsOperations - :ivar tags: Tags operations - :vartype tags: azure.mgmt.consumption.operations.TagsOperations - :ivar charges: Charges operations - :vartype charges: azure.mgmt.consumption.operations.ChargesOperations - :ivar balances: Balances operations - :vartype balances: azure.mgmt.consumption.operations.BalancesOperations - :ivar reservations_summaries: ReservationsSummaries operations - :vartype reservations_summaries: azure.mgmt.consumption.operations.ReservationsSummariesOperations - :ivar reservations_details: ReservationsDetails operations - :vartype reservations_details: azure.mgmt.consumption.operations.ReservationsDetailsOperations - :ivar reservation_recommendations: ReservationRecommendations operations - :vartype reservation_recommendations: azure.mgmt.consumption.operations.ReservationRecommendationsOperations - :ivar price_sheet: PriceSheet operations - :vartype price_sheet: azure.mgmt.consumption.operations.PriceSheetOperations - :ivar forecasts: Forecasts operations - :vartype forecasts: azure.mgmt.consumption.operations.ForecastsOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.consumption.operations.Operations - :ivar aggregated_cost: AggregatedCost operations - :vartype aggregated_cost: azure.mgmt.consumption.operations.AggregatedCostOperations - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Azure Subscription ID. - :type subscription_id: str - :param str base_url: Service URL - """ - - def __init__( - self, credentials, subscription_id, base_url=None): - - self.config = ConsumptionManagementClientConfiguration(credentials, subscription_id, base_url) - super(ConsumptionManagementClient, self).__init__(self.config.credentials, self.config) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2019-04-01-preview' - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - - self.usage_details = UsageDetailsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.marketplaces = MarketplacesOperations( - self._client, self.config, self._serialize, self._deserialize) - self.budgets = BudgetsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.tags = TagsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.charges = ChargesOperations( - self._client, self.config, self._serialize, self._deserialize) - self.balances = BalancesOperations( - self._client, self.config, self._serialize, self._deserialize) - self.reservations_summaries = ReservationsSummariesOperations( - self._client, self.config, self._serialize, self._deserialize) - self.reservations_details = ReservationsDetailsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.reservation_recommendations = ReservationRecommendationsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.price_sheet = PriceSheetOperations( - self._client, self.config, self._serialize, self._deserialize) - self.forecasts = ForecastsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self.config, self._serialize, self._deserialize) - self.aggregated_cost = AggregatedCostOperations( - self._client, self.config, self._serialize, self._deserialize) 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 b9815d6ee2d5..f39f10f8d3a3 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 @@ -1,148 +1,249 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- try: - from .meter_details_py3 import MeterDetails - from .meter_details_response_py3 import MeterDetailsResponse - from .usage_detail_py3 import UsageDetail - from .usage_details_download_response_py3 import UsageDetailsDownloadResponse - from .marketplace_py3 import Marketplace - from .balance_properties_new_purchases_details_item_py3 import BalancePropertiesNewPurchasesDetailsItem - from .balance_properties_adjustment_details_item_py3 import BalancePropertiesAdjustmentDetailsItem - from .balance_py3 import Balance - from .reservation_summary_py3 import ReservationSummary - from .reservation_detail_py3 import ReservationDetail - from .reservation_recommendation_py3 import ReservationRecommendation - from .tag_py3 import Tag - from .tags_result_py3 import TagsResult - from .budget_time_period_py3 import BudgetTimePeriod - from .filters_py3 import Filters - from .current_spend_py3 import CurrentSpend - from .notification_py3 import Notification - from .budget_py3 import Budget - from .price_sheet_properties_py3 import PriceSheetProperties - from .price_sheet_result_py3 import PriceSheetResult - from .forecast_properties_confidence_levels_item_py3 import ForecastPropertiesConfidenceLevelsItem - from .forecast_py3 import Forecast - from .management_group_aggregated_cost_result_py3 import ManagementGroupAggregatedCostResult - from .charge_summary_py3 import ChargeSummary - from .charges_list_result_py3 import ChargesListResult - from .error_details_py3 import ErrorDetails - from .error_response_py3 import ErrorResponse, ErrorResponseException - from .operation_display_py3 import OperationDisplay - from .operation_py3 import Operation - from .resource_py3 import Resource - from .resource_attributes_py3 import ResourceAttributes - from .proxy_resource_py3 import ProxyResource + from ._models_py3 import Amount + from ._models_py3 import Balance + from ._models_py3 import BalancePropertiesAdjustmentDetailsItem + from ._models_py3 import BalancePropertiesNewPurchasesDetailsItem + from ._models_py3 import Budget + from ._models_py3 import BudgetComparisonExpression + from ._models_py3 import BudgetFilter + from ._models_py3 import BudgetFilterProperties + from ._models_py3 import BudgetTimePeriod + from ._models_py3 import BudgetsListResult + from ._models_py3 import ChargeSummary + from ._models_py3 import ChargesListResult + from ._models_py3 import CreditBalanceSummary + from ._models_py3 import CreditSummary + from ._models_py3 import CurrentSpend + 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 ForecastsListResult + from ._models_py3 import LegacyChargeSummary + from ._models_py3 import LegacyReservationRecommendation + from ._models_py3 import LegacyReservationTransaction + from ._models_py3 import LegacyUsageDetail + from ._models_py3 import LotSummary + from ._models_py3 import Lots + from ._models_py3 import ManagementGroupAggregatedCostResult + from ._models_py3 import Marketplace + from ._models_py3 import MarketplacesListResult + from ._models_py3 import MeterDetails + from ._models_py3 import MeterDetailsResponse + from ._models_py3 import ModernChargeSummary + from ._models_py3 import ModernReservationRecommendation + from ._models_py3 import ModernReservationTransaction + from ._models_py3 import ModernReservationTransactionsListResult + from ._models_py3 import ModernUsageDetail + from ._models_py3 import Notification + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import OperationListResult + from ._models_py3 import PriceSheetProperties + from ._models_py3 import PriceSheetResult + from ._models_py3 import ProxyResource + from ._models_py3 import ReservationDetail + from ._models_py3 import ReservationDetailsListResult + from ._models_py3 import ReservationRecommendation + from ._models_py3 import ReservationRecommendationDetailsCalculatedSavingsProperties + from ._models_py3 import ReservationRecommendationDetailsModel + from ._models_py3 import ReservationRecommendationDetailsResourceProperties + from ._models_py3 import ReservationRecommendationDetailsSavingsProperties + from ._models_py3 import ReservationRecommendationDetailsUsageProperties + from ._models_py3 import ReservationRecommendationsListResult + from ._models_py3 import ReservationSummariesListResult + from ._models_py3 import ReservationSummary + from ._models_py3 import ReservationTransaction + from ._models_py3 import ReservationTransactionsListResult + from ._models_py3 import Resource + from ._models_py3 import ResourceAttributes + from ._models_py3 import SkuProperty + from ._models_py3 import Tag + from ._models_py3 import TagsResult + from ._models_py3 import UsageDetail + from ._models_py3 import UsageDetailsListResult except (SyntaxError, ImportError): - from .meter_details import MeterDetails - from .meter_details_response import MeterDetailsResponse - from .usage_detail import UsageDetail - from .usage_details_download_response import UsageDetailsDownloadResponse - from .marketplace import Marketplace - from .balance_properties_new_purchases_details_item import BalancePropertiesNewPurchasesDetailsItem - from .balance_properties_adjustment_details_item import BalancePropertiesAdjustmentDetailsItem - from .balance import Balance - from .reservation_summary import ReservationSummary - from .reservation_detail import ReservationDetail - from .reservation_recommendation import ReservationRecommendation - from .tag import Tag - from .tags_result import TagsResult - from .budget_time_period import BudgetTimePeriod - from .filters import Filters - from .current_spend import CurrentSpend - from .notification import Notification - from .budget import Budget - from .price_sheet_properties import PriceSheetProperties - from .price_sheet_result import PriceSheetResult - from .forecast_properties_confidence_levels_item import ForecastPropertiesConfidenceLevelsItem - from .forecast import Forecast - from .management_group_aggregated_cost_result import ManagementGroupAggregatedCostResult - from .charge_summary import ChargeSummary - from .charges_list_result import ChargesListResult - from .error_details import ErrorDetails - from .error_response import ErrorResponse, ErrorResponseException - from .operation_display import OperationDisplay - from .operation import Operation - from .resource import Resource - from .resource_attributes import ResourceAttributes - from .proxy_resource import ProxyResource -from .usage_detail_paged import UsageDetailPaged -from .marketplace_paged import MarketplacePaged -from .budget_paged import BudgetPaged -from .reservation_summary_paged import ReservationSummaryPaged -from .reservation_detail_paged import ReservationDetailPaged -from .reservation_recommendation_paged import ReservationRecommendationPaged -from .forecast_paged import ForecastPaged -from .operation_paged import OperationPaged -from .consumption_management_client_enums import ( + from ._models import Amount # type: ignore + from ._models import Balance # type: ignore + from ._models import BalancePropertiesAdjustmentDetailsItem # type: ignore + from ._models import BalancePropertiesNewPurchasesDetailsItem # type: ignore + from ._models import Budget # type: ignore + from ._models import BudgetComparisonExpression # type: ignore + from ._models import BudgetFilter # type: ignore + from ._models import BudgetFilterProperties # type: ignore + from ._models import BudgetTimePeriod # type: ignore + from ._models import BudgetsListResult # type: ignore + from ._models import ChargeSummary # type: ignore + from ._models import ChargesListResult # type: ignore + from ._models import CreditBalanceSummary # type: ignore + from ._models import CreditSummary # type: ignore + from ._models import CurrentSpend # 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 ForecastsListResult # type: ignore + from ._models import LegacyChargeSummary # type: ignore + from ._models import LegacyReservationRecommendation # type: ignore + from ._models import LegacyReservationTransaction # type: ignore + from ._models import LegacyUsageDetail # type: ignore + from ._models import LotSummary # type: ignore + from ._models import Lots # type: ignore + from ._models import ManagementGroupAggregatedCostResult # type: ignore + from ._models import Marketplace # type: ignore + from ._models import MarketplacesListResult # type: ignore + from ._models import MeterDetails # type: ignore + from ._models import MeterDetailsResponse # type: ignore + from ._models import ModernChargeSummary # type: ignore + from ._models import ModernReservationRecommendation # type: ignore + from ._models import ModernReservationTransaction # type: ignore + from ._models import ModernReservationTransactionsListResult # type: ignore + from ._models import ModernUsageDetail # type: ignore + from ._models import Notification # type: ignore + from ._models import Operation # type: ignore + from ._models import OperationDisplay # type: ignore + from ._models import OperationListResult # type: ignore + from ._models import PriceSheetProperties # type: ignore + from ._models import PriceSheetResult # type: ignore + from ._models import ProxyResource # type: ignore + from ._models import ReservationDetail # type: ignore + from ._models import ReservationDetailsListResult # type: ignore + from ._models import ReservationRecommendation # type: ignore + from ._models import ReservationRecommendationDetailsCalculatedSavingsProperties # type: ignore + from ._models import ReservationRecommendationDetailsModel # type: ignore + from ._models import ReservationRecommendationDetailsResourceProperties # type: ignore + from ._models import ReservationRecommendationDetailsSavingsProperties # type: ignore + from ._models import ReservationRecommendationDetailsUsageProperties # type: ignore + from ._models import ReservationRecommendationsListResult # type: ignore + from ._models import ReservationSummariesListResult # type: ignore + from ._models import ReservationSummary # type: ignore + from ._models import ReservationTransaction # type: ignore + from ._models import ReservationTransactionsListResult # type: ignore + from ._models import Resource # type: ignore + from ._models import ResourceAttributes # type: ignore + from ._models import SkuProperty # type: ignore + from ._models import Tag # type: ignore + from ._models import TagsResult # type: ignore + from ._models import UsageDetail # type: ignore + from ._models import UsageDetailsListResult # type: ignore + +from ._consumption_management_client_enums import ( BillingFrequency, + Bound, + BudgetOperatorType, CategoryType, - TimeGrainType, - OperatorType, - Grain, + ChargeSummaryKind, ChargeType, - Bound, Datagrain, + EventType, + Grain, + LookBackPeriod, + LotSource, Metrictype, + OperatorType, + ReservationRecommendationKind, + Scope, + Term, + ThresholdType, + TimeGrainType, + UsageDetailsKind, ) __all__ = [ - 'MeterDetails', - 'MeterDetailsResponse', - 'UsageDetail', - 'UsageDetailsDownloadResponse', - 'Marketplace', - 'BalancePropertiesNewPurchasesDetailsItem', - 'BalancePropertiesAdjustmentDetailsItem', + 'Amount', 'Balance', - 'ReservationSummary', - 'ReservationDetail', - 'ReservationRecommendation', - 'Tag', - 'TagsResult', - 'BudgetTimePeriod', - 'Filters', - 'CurrentSpend', - 'Notification', + 'BalancePropertiesAdjustmentDetailsItem', + 'BalancePropertiesNewPurchasesDetailsItem', 'Budget', - 'PriceSheetProperties', - 'PriceSheetResult', - 'ForecastPropertiesConfidenceLevelsItem', - 'Forecast', - 'ManagementGroupAggregatedCostResult', + 'BudgetComparisonExpression', + 'BudgetFilter', + 'BudgetFilterProperties', + 'BudgetTimePeriod', + 'BudgetsListResult', 'ChargeSummary', 'ChargesListResult', + 'CreditBalanceSummary', + 'CreditSummary', + 'CurrentSpend', 'ErrorDetails', - 'ErrorResponse', 'ErrorResponseException', - 'OperationDisplay', + 'ErrorResponse', + 'EventSummary', + 'Events', + 'Forecast', + 'ForecastPropertiesConfidenceLevelsItem', + 'ForecastsListResult', + 'LegacyChargeSummary', + 'LegacyReservationRecommendation', + 'LegacyReservationTransaction', + 'LegacyUsageDetail', + 'LotSummary', + 'Lots', + 'ManagementGroupAggregatedCostResult', + 'Marketplace', + 'MarketplacesListResult', + 'MeterDetails', + 'MeterDetailsResponse', + 'ModernChargeSummary', + 'ModernReservationRecommendation', + 'ModernReservationTransaction', + 'ModernReservationTransactionsListResult', + 'ModernUsageDetail', + 'Notification', 'Operation', + 'OperationDisplay', + 'OperationListResult', + 'PriceSheetProperties', + 'PriceSheetResult', + 'ProxyResource', + 'ReservationDetail', + 'ReservationDetailsListResult', + 'ReservationRecommendation', + 'ReservationRecommendationDetailsCalculatedSavingsProperties', + 'ReservationRecommendationDetailsModel', + 'ReservationRecommendationDetailsResourceProperties', + 'ReservationRecommendationDetailsSavingsProperties', + 'ReservationRecommendationDetailsUsageProperties', + 'ReservationRecommendationsListResult', + 'ReservationSummariesListResult', + 'ReservationSummary', + 'ReservationTransaction', + 'ReservationTransactionsListResult', 'Resource', 'ResourceAttributes', - 'ProxyResource', - 'UsageDetailPaged', - 'MarketplacePaged', - 'BudgetPaged', - 'ReservationSummaryPaged', - 'ReservationDetailPaged', - 'ReservationRecommendationPaged', - 'ForecastPaged', - 'OperationPaged', + 'SkuProperty', + 'Tag', + 'TagsResult', + 'UsageDetail', + 'UsageDetailsListResult', 'BillingFrequency', + 'Bound', + 'BudgetOperatorType', 'CategoryType', - 'TimeGrainType', - 'OperatorType', - 'Grain', + 'ChargeSummaryKind', 'ChargeType', - 'Bound', 'Datagrain', + 'EventType', + 'Grain', + 'LookBackPeriod', + 'LotSource', 'Metrictype', + 'OperatorType', + 'ReservationRecommendationKind', + 'Scope', + 'Term', + 'ThresholdType', + 'TimeGrainType', + 'UsageDetailsKind', ] 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 new file mode 100644 index 000000000000..cd7ad1ca77c1 --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/_consumption_management_client_enums.py @@ -0,0 +1,162 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class BillingFrequency(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The billing frequency. + """ + + MONTH = "Month" + QUARTER = "Quarter" + YEAR = "Year" + +class Bound(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The boundary of the percentage, values could be 'Upper' or 'Lower' + """ + + UPPER = "Upper" + LOWER = "Lower" + +class BudgetOperatorType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The operator to use for comparison. + """ + + IN_ENUM = "In" + +class CategoryType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The category of the budget, whether the budget tracks cost or usage. + """ + + COST = "Cost" + +class ChargeSummaryKind(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies the kind of charge summary. + """ + + LEGACY = "legacy" + MODERN = "modern" + +class ChargeType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of the charge. Could be actual or forecast + """ + + ACTUAL = "Actual" + FORECAST = "Forecast" + +class Datagrain(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + DAILY_GRAIN = "daily" #: Daily grain of data. + MONTHLY_GRAIN = "monthly" #: Monthly grain of data. + +class EventType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of event. + """ + + SETTLED_CHARGES = "SettledCharges" + PENDING_CHARGES = "PendingCharges" + PENDING_ADJUSTMENTS = "PendingAdjustments" + PENDING_NEW_CREDIT = "PendingNewCredit" + PENDING_EXPIRED_CREDIT = "PendingExpiredCredit" + UN_KNOWN = "UnKnown" + NEW_CREDIT = "NewCredit" + +class Grain(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The granularity of forecast. + """ + + DAILY = "Daily" + MONTHLY = "Monthly" + YEARLY = "Yearly" + +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. + +class LotSource(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Lot source. + """ + + PURCHASED_CREDIT = "PurchasedCredit" + PROMOTIONAL_CREDIT = "PromotionalCredit" + +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. + +class OperatorType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The comparison operator. + """ + + EQUAL_TO = "EqualTo" + GREATER_THAN = "GreaterThan" + GREATER_THAN_OR_EQUAL_TO = "GreaterThanOrEqualTo" + +class ReservationRecommendationKind(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies the kind of reservation recommendation. + """ + + LEGACY = "legacy" + MODERN = "modern" + +class Scope(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + SINGLE = "Single" + SHARED = "Shared" + +class Term(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + P1_Y = "P1Y" #: 1 year reservation term. + P3_Y = "P3Y" #: 3 year reservation term. + +class ThresholdType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of threshold + """ + + ACTUAL = "Actual" + +class TimeGrainType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The time covered by a budget. Tracking of the amount will be reset based on the time grain. + BillingMonth, BillingQuarter, and BillingAnnual are only supported by WD customers + """ + + MONTHLY = "Monthly" + QUARTERLY = "Quarterly" + ANNUALLY = "Annually" + BILLING_MONTH = "BillingMonth" + BILLING_QUARTER = "BillingQuarter" + BILLING_ANNUAL = "BillingAnnual" + +class UsageDetailsKind(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies the kind of usage details. + """ + + LEGACY = "legacy" + MODERN = "modern" 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 new file mode 100644 index 000000000000..7fbf9d534234 --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/_models.py @@ -0,0 +1,4185 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class Amount(msrest.serialization.Model): + """The amount plus currency . + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar currency: Amount currency. + :vartype currency: str + :ivar value: Amount. + :vartype value: float + """ + + _validation = { + 'currency': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'currency': {'key': 'currency', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(Amount, self).__init__(**kwargs) + self.currency = None + self.value = 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. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.tags = None + + +class Balance(Resource): + """A balance resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar currency: The ISO currency in which the meter is charged, for example, USD. + :vartype currency: str + :ivar beginning_balance: The beginning balance for the billing period. + :vartype beginning_balance: float + :ivar ending_balance: The ending balance for the billing period (for open periods this will be + updated daily). + :vartype ending_balance: float + :ivar new_purchases: Total new purchase amount. + :vartype new_purchases: float + :ivar adjustments: Total adjustment amount. + :vartype adjustments: float + :ivar utilized: Total Commitment usage. + :vartype utilized: float + :ivar service_overage: Overage for Azure services. + :vartype service_overage: float + :ivar charges_billed_separately: Charges Billed separately. + :vartype charges_billed_separately: float + :ivar total_overage: serviceOverage + chargesBilledSeparately. + :vartype total_overage: float + :ivar total_usage: Azure service commitment + total Overage. + :vartype total_usage: float + :ivar azure_marketplace_service_charges: Total charges for Azure Marketplace. + :vartype azure_marketplace_service_charges: float + :param billing_frequency: The billing frequency. Possible values include: "Month", "Quarter", + "Year". + :type billing_frequency: str or ~azure.mgmt.consumption.models.BillingFrequency + :ivar price_hidden: Price is hidden or not. + :vartype price_hidden: bool + :ivar new_purchases_details: List of new purchases. + :vartype new_purchases_details: + list[~azure.mgmt.consumption.models.BalancePropertiesNewPurchasesDetailsItem] + :ivar adjustment_details: List of Adjustments (Promo credit, SIE credit etc.). + :vartype adjustment_details: + list[~azure.mgmt.consumption.models.BalancePropertiesAdjustmentDetailsItem] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'currency': {'readonly': True}, + 'beginning_balance': {'readonly': True}, + 'ending_balance': {'readonly': True}, + 'new_purchases': {'readonly': True}, + 'adjustments': {'readonly': True}, + 'utilized': {'readonly': True}, + 'service_overage': {'readonly': True}, + 'charges_billed_separately': {'readonly': True}, + 'total_overage': {'readonly': True}, + 'total_usage': {'readonly': True}, + 'azure_marketplace_service_charges': {'readonly': True}, + 'price_hidden': {'readonly': True}, + 'new_purchases_details': {'readonly': True}, + 'adjustment_details': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'currency': {'key': 'properties.currency', 'type': 'str'}, + 'beginning_balance': {'key': 'properties.beginningBalance', 'type': 'float'}, + 'ending_balance': {'key': 'properties.endingBalance', 'type': 'float'}, + 'new_purchases': {'key': 'properties.newPurchases', 'type': 'float'}, + 'adjustments': {'key': 'properties.adjustments', 'type': 'float'}, + 'utilized': {'key': 'properties.utilized', 'type': 'float'}, + 'service_overage': {'key': 'properties.serviceOverage', 'type': 'float'}, + 'charges_billed_separately': {'key': 'properties.chargesBilledSeparately', 'type': 'float'}, + 'total_overage': {'key': 'properties.totalOverage', 'type': 'float'}, + 'total_usage': {'key': 'properties.totalUsage', 'type': 'float'}, + 'azure_marketplace_service_charges': {'key': 'properties.azureMarketplaceServiceCharges', 'type': 'float'}, + 'billing_frequency': {'key': 'properties.billingFrequency', 'type': 'str'}, + 'price_hidden': {'key': 'properties.priceHidden', 'type': 'bool'}, + 'new_purchases_details': {'key': 'properties.newPurchasesDetails', 'type': '[BalancePropertiesNewPurchasesDetailsItem]'}, + 'adjustment_details': {'key': 'properties.adjustmentDetails', 'type': '[BalancePropertiesAdjustmentDetailsItem]'}, + } + + def __init__( + self, + **kwargs + ): + super(Balance, self).__init__(**kwargs) + self.currency = None + self.beginning_balance = None + self.ending_balance = None + self.new_purchases = None + self.adjustments = None + self.utilized = None + self.service_overage = None + self.charges_billed_separately = None + self.total_overage = None + self.total_usage = None + self.azure_marketplace_service_charges = None + self.billing_frequency = kwargs.get('billing_frequency', None) + self.price_hidden = None + self.new_purchases_details = None + self.adjustment_details = None + + +class BalancePropertiesAdjustmentDetailsItem(msrest.serialization.Model): + """BalancePropertiesAdjustmentDetailsItem. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: the name of new adjustment. + :vartype name: str + :ivar value: the value of new adjustment. + :vartype value: float + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(BalancePropertiesAdjustmentDetailsItem, self).__init__(**kwargs) + self.name = None + self.value = None + + +class BalancePropertiesNewPurchasesDetailsItem(msrest.serialization.Model): + """BalancePropertiesNewPurchasesDetailsItem. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: the name of new purchase. + :vartype name: str + :ivar value: the value of new purchase. + :vartype value: float + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(BalancePropertiesNewPurchasesDetailsItem, self).__init__(**kwargs) + self.name = None + self.value = None + + +class ProxyResource(msrest.serialization.Model): + """The Resource model definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param e_tag: eTag of the resource. To handle concurrent update scenario, this field will be + used to determine whether the user is updating the latest version or not. + :type e_tag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProxyResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.e_tag = kwargs.get('e_tag', None) + + +class Budget(ProxyResource): + """A budget resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param e_tag: eTag of the resource. To handle concurrent update scenario, this field will be + used to determine whether the user is updating the latest version or not. + :type e_tag: str + :param category: The category of the budget, whether the budget tracks cost or usage. Possible + values include: "Cost". + :type category: str or ~azure.mgmt.consumption.models.CategoryType + :param amount: The total amount of cost to track with the budget. + :type amount: float + :param time_grain: The time covered by a budget. Tracking of the amount will be reset based on + the time grain. BillingMonth, BillingQuarter, and BillingAnnual are only supported by WD + customers. Possible values include: "Monthly", "Quarterly", "Annually", "BillingMonth", + "BillingQuarter", "BillingAnnual". + :type time_grain: str or ~azure.mgmt.consumption.models.TimeGrainType + :param time_period: Has start and end date of the budget. The start date must be first of the + month and should be less than the end date. Budget start date must be on or after June 1, 2017. + 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. + :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] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'current_spend': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'category': {'key': 'properties.category', 'type': 'str'}, + 'amount': {'key': 'properties.amount', 'type': 'float'}, + 'time_grain': {'key': 'properties.timeGrain', 'type': 'str'}, + 'time_period': {'key': 'properties.timePeriod', 'type': 'BudgetTimePeriod'}, + 'filter': {'key': 'properties.filter', 'type': 'BudgetFilter'}, + 'current_spend': {'key': 'properties.currentSpend', 'type': 'CurrentSpend'}, + 'notifications': {'key': 'properties.notifications', 'type': '{Notification}'}, + } + + def __init__( + self, + **kwargs + ): + super(Budget, self).__init__(**kwargs) + self.category = kwargs.get('category', None) + self.amount = kwargs.get('amount', None) + self.time_grain = kwargs.get('time_grain', None) + self.time_period = kwargs.get('time_period', None) + self.filter = kwargs.get('filter', None) + self.current_spend = None + self.notifications = kwargs.get('notifications', None) + + +class BudgetComparisonExpression(msrest.serialization.Model): + """The comparison expression to be used in the budgets. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the column to use in comparison. + :type name: str + :param operator: Required. The operator to use for comparison. Possible values include: "In". + :type operator: str or ~azure.mgmt.consumption.models.BudgetOperatorType + :param values: Required. Array of values to use for comparison. + :type values: list[str] + """ + + _validation = { + 'name': {'required': True}, + 'operator': {'required': True}, + 'values': {'required': True, 'min_items': 1}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(BudgetComparisonExpression, self).__init__(**kwargs) + self.name = kwargs['name'] + self.operator = kwargs['operator'] + self.values = kwargs['values'] + + +class BudgetFilter(msrest.serialization.Model): + """May be used to filter budgets by resource group, resource, or meter. + + :param and_property: The logical "AND" expression. Must have at least 2 items. + :type and_property: list[~azure.mgmt.consumption.models.BudgetFilterProperties] + :param not_property: The logical "NOT" expression. + :type not_property: ~azure.mgmt.consumption.models.BudgetFilterProperties + :param dimensions: Has comparison expression for a dimension. + :type dimensions: ~azure.mgmt.consumption.models.BudgetComparisonExpression + :param tags: A set of tags. Has comparison expression for a tag. + :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'}, + 'dimensions': {'key': 'dimensions', 'type': 'BudgetComparisonExpression'}, + 'tags': {'key': 'tags', 'type': 'BudgetComparisonExpression'}, + } + + def __init__( + self, + **kwargs + ): + super(BudgetFilter, self).__init__(**kwargs) + self.and_property = kwargs.get('and_property', None) + self.not_property = kwargs.get('not_property', None) + self.dimensions = kwargs.get('dimensions', None) + self.tags = kwargs.get('tags', None) + + +class BudgetFilterProperties(msrest.serialization.Model): + """The Dimensions or Tags to filter a budget by. + + :param dimensions: Has comparison expression for a dimension. + :type dimensions: ~azure.mgmt.consumption.models.BudgetComparisonExpression + :param tags: A set of tags. Has comparison expression for a tag. + :type tags: ~azure.mgmt.consumption.models.BudgetComparisonExpression + """ + + _attribute_map = { + 'dimensions': {'key': 'dimensions', 'type': 'BudgetComparisonExpression'}, + 'tags': {'key': 'tags', 'type': 'BudgetComparisonExpression'}, + } + + def __init__( + self, + **kwargs + ): + super(BudgetFilterProperties, self).__init__(**kwargs) + self.dimensions = kwargs.get('dimensions', None) + self.tags = kwargs.get('tags', None) + + +class BudgetsListResult(msrest.serialization.Model): + """Result of listing budgets. It contains a list of available budgets in the scope provided. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of budgets. + :vartype value: list[~azure.mgmt.consumption.models.Budget] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Budget]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BudgetsListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class BudgetTimePeriod(msrest.serialization.Model): + """The start and end date for a budget. + + All required parameters must be populated in order to send to Azure. + + :param start_date: Required. The start date for the budget. + :type start_date: ~datetime.datetime + :param end_date: The end date for the budget. If not provided, we default this to 10 years from + the start date. + :type end_date: ~datetime.datetime + """ + + _validation = { + 'start_date': {'required': True}, + } + + _attribute_map = { + 'start_date': {'key': 'startDate', 'type': 'iso-8601'}, + 'end_date': {'key': 'endDate', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(BudgetTimePeriod, self).__init__(**kwargs) + self.start_date = kwargs['start_date'] + self.end_date = kwargs.get('end_date', None) + + +class ChargesListResult(msrest.serialization.Model): + """Result of listing charge summary. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of charge summary. + :vartype value: list[~azure.mgmt.consumption.models.ChargeSummary] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ChargeSummary]'}, + } + + def __init__( + self, + **kwargs + ): + super(ChargesListResult, self).__init__(**kwargs) + self.value = None + + +class ChargeSummary(Resource): + """A charge summary resource. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: LegacyChargeSummary, ModernChargeSummary. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :param kind: Required. Specifies the kind of charge summary.Constant filled by server. + Possible values include: "legacy", "modern". + :type kind: str or ~azure.mgmt.consumption.models.ChargeSummaryKind + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'legacy': 'LegacyChargeSummary', 'modern': 'ModernChargeSummary'} + } + + def __init__( + self, + **kwargs + ): + super(ChargeSummary, self).__init__(**kwargs) + self.kind = 'ChargeSummary' # type: str + + +class CreditBalanceSummary(msrest.serialization.Model): + """Summary of credit balances. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar estimated_balance: Estimated balance. + :vartype estimated_balance: ~azure.mgmt.consumption.models.Amount + :ivar current_balance: Current balance. + :vartype current_balance: ~azure.mgmt.consumption.models.Amount + """ + + _validation = { + 'estimated_balance': {'readonly': True}, + 'current_balance': {'readonly': True}, + } + + _attribute_map = { + 'estimated_balance': {'key': 'estimatedBalance', 'type': 'Amount'}, + 'current_balance': {'key': 'currentBalance', 'type': 'Amount'}, + } + + def __init__( + self, + **kwargs + ): + super(CreditBalanceSummary, self).__init__(**kwargs) + self.estimated_balance = None + self.current_balance = None + + +class CreditSummary(Resource): + """A credit summary resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar balance_summary: Summary of balances associated with this credit summary. + :vartype balance_summary: ~azure.mgmt.consumption.models.CreditBalanceSummary + :ivar pending_credit_adjustments: Pending credit adjustments. + :vartype pending_credit_adjustments: ~azure.mgmt.consumption.models.Amount + :ivar expired_credit: Expired credit. + :vartype expired_credit: ~azure.mgmt.consumption.models.Amount + :ivar pending_eligible_charges: Pending eligible charges. + :vartype pending_eligible_charges: ~azure.mgmt.consumption.models.Amount + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'balance_summary': {'readonly': True}, + 'pending_credit_adjustments': {'readonly': True}, + 'expired_credit': {'readonly': True}, + 'pending_eligible_charges': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', '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'}, + } + + def __init__( + self, + **kwargs + ): + super(CreditSummary, self).__init__(**kwargs) + self.balance_summary = None + self.pending_credit_adjustments = None + self.expired_credit = None + self.pending_eligible_charges = None + + +class CurrentSpend(msrest.serialization.Model): + """The current amount of 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 total amount of cost which is being tracked by the budget. + :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(CurrentSpend, self).__init__(**kwargs) + self.amount = None + self.unit = None + + +class ErrorDetails(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(ErrorDetails, self).__init__(**kwargs) + self.code = None + self.message = None + + +class ErrorResponse(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.ErrorDetails + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetails'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class Events(msrest.serialization.Model): + """Result of listing event summary. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of event summary. + :vartype value: list[~azure.mgmt.consumption.models.EventSummary] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EventSummary]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Events, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class EventSummary(Resource): + """An event summary resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar transaction_date: Transaction date. + :vartype transaction_date: ~datetime.datetime + :ivar description: Transaction description. + :vartype description: str + :ivar new_credit: New Credit. + :vartype new_credit: ~azure.mgmt.consumption.models.Amount + :ivar adjustments: Adjustments amount. + :vartype adjustments: ~azure.mgmt.consumption.models.Amount + :ivar credit_expired: Credit expired. + :vartype credit_expired: ~azure.mgmt.consumption.models.Amount + :ivar charges: Charges amount. + :vartype charges: ~azure.mgmt.consumption.models.Amount + :ivar closed_balance: Closed balance. + :vartype closed_balance: ~azure.mgmt.consumption.models.Amount + :param event_type: The type of 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. + :vartype invoice_number: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'transaction_date': {'readonly': True}, + 'description': {'readonly': True}, + 'new_credit': {'readonly': True}, + 'adjustments': {'readonly': True}, + 'credit_expired': {'readonly': True}, + 'charges': {'readonly': True}, + 'closed_balance': {'readonly': True}, + 'invoice_number': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'transaction_date': {'key': 'properties.transactionDate', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'new_credit': {'key': 'properties.newCredit', 'type': 'Amount'}, + 'adjustments': {'key': 'properties.adjustments', 'type': 'Amount'}, + 'credit_expired': {'key': 'properties.creditExpired', 'type': 'Amount'}, + 'charges': {'key': 'properties.charges', 'type': 'Amount'}, + 'closed_balance': {'key': 'properties.closedBalance', 'type': 'Amount'}, + 'event_type': {'key': 'properties.eventType', 'type': 'str'}, + 'invoice_number': {'key': 'properties.invoiceNumber', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EventSummary, self).__init__(**kwargs) + self.transaction_date = None + self.description = None + self.new_credit = None + self.adjustments = None + self.credit_expired = None + self.charges = None + self.closed_balance = None + self.event_type = kwargs.get('event_type', None) + self.invoice_number = None + + +class Forecast(Resource): + """A forecast resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: 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". + :type grain: str or ~azure.mgmt.consumption.models.Grain + :ivar charge: The amount of charge. + :vartype charge: float + :ivar currency: The ISO currency in which the meter is charged, for example, USD. + :vartype currency: str + :param charge_type: The type of the charge. Could be actual or forecast. Possible values + include: "Actual", "Forecast". + :type charge_type: str or ~azure.mgmt.consumption.models.ChargeType + :ivar confidence_levels: The details about the forecast confidence levels. This is populated + only when chargeType is Forecast. + :vartype confidence_levels: + list[~azure.mgmt.consumption.models.ForecastPropertiesConfidenceLevelsItem] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'usage_date': {'readonly': True}, + 'charge': {'readonly': True}, + 'currency': {'readonly': True}, + 'confidence_levels': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'usage_date': {'key': 'properties.usageDate', 'type': 'str'}, + 'grain': {'key': 'properties.grain', 'type': 'str'}, + 'charge': {'key': 'properties.charge', 'type': 'float'}, + 'currency': {'key': 'properties.currency', 'type': 'str'}, + 'charge_type': {'key': 'properties.chargeType', 'type': 'str'}, + 'confidence_levels': {'key': 'properties.confidenceLevels', 'type': '[ForecastPropertiesConfidenceLevelsItem]'}, + } + + def __init__( + self, + **kwargs + ): + super(Forecast, self).__init__(**kwargs) + self.usage_date = None + self.grain = kwargs.get('grain', None) + self.charge = None + self.currency = None + self.charge_type = kwargs.get('charge_type', None) + self.confidence_levels = None + + +class ForecastPropertiesConfidenceLevelsItem(msrest.serialization.Model): + """ForecastPropertiesConfidenceLevelsItem. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar percentage: The percentage level of the confidence. + :vartype percentage: float + :param bound: The boundary of the percentage, values could be 'Upper' or 'Lower'. Possible + values include: "Upper", "Lower". + :type bound: str or ~azure.mgmt.consumption.models.Bound + :ivar value: The amount of forecast within the percentage level. + :vartype value: float + """ + + _validation = { + 'percentage': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'percentage': {'key': 'percentage', 'type': 'float'}, + 'bound': {'key': 'bound', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(ForecastPropertiesConfidenceLevelsItem, self).__init__(**kwargs) + self.percentage = None + self.bound = kwargs.get('bound', None) + self.value = None + + +class ForecastsListResult(msrest.serialization.Model): + """Result of listing forecasts. It contains a list of available forecasts. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of forecasts. + :vartype value: list[~azure.mgmt.consumption.models.Forecast] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Forecast]'}, + } + + def __init__( + self, + **kwargs + ): + super(ForecastsListResult, self).__init__(**kwargs) + self.value = None + + +class LegacyChargeSummary(ChargeSummary): + """Legacy charge summary. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :param kind: Required. Specifies the kind of charge summary.Constant filled by server. + Possible values include: "legacy", "modern". + :type kind: str or ~azure.mgmt.consumption.models.ChargeSummaryKind + :ivar billing_period_id: The id of the billing period resource that the charge belongs to. + :vartype billing_period_id: str + :ivar usage_start: Usage start date. + :vartype usage_start: str + :ivar usage_end: Usage end date. + :vartype usage_end: str + :ivar azure_charges: Azure Charges. + :vartype azure_charges: float + :ivar charges_billed_separately: Charges Billed separately. + :vartype charges_billed_separately: float + :ivar marketplace_charges: Marketplace Charges. + :vartype marketplace_charges: float + :ivar currency: Currency Code. + :vartype currency: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'kind': {'required': True}, + 'billing_period_id': {'readonly': True}, + 'usage_start': {'readonly': True}, + 'usage_end': {'readonly': True}, + 'azure_charges': {'readonly': True}, + 'charges_billed_separately': {'readonly': True}, + 'marketplace_charges': {'readonly': True}, + 'currency': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'billing_period_id': {'key': 'properties.billingPeriodId', 'type': 'str'}, + 'usage_start': {'key': 'properties.usageStart', 'type': 'str'}, + 'usage_end': {'key': 'properties.usageEnd', 'type': 'str'}, + 'azure_charges': {'key': 'properties.azureCharges', 'type': 'float'}, + 'charges_billed_separately': {'key': 'properties.chargesBilledSeparately', 'type': 'float'}, + 'marketplace_charges': {'key': 'properties.marketplaceCharges', 'type': 'float'}, + 'currency': {'key': 'properties.currency', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LegacyChargeSummary, self).__init__(**kwargs) + self.kind = 'legacy' # type: str + self.billing_period_id = None + self.usage_start = None + self.usage_end = None + self.azure_charges = None + self.charges_billed_separately = None + self.marketplace_charges = None + self.currency = None + + +class ResourceAttributes(msrest.serialization.Model): + """The Resource model definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar location: Resource location. + :vartype location: str + :ivar sku: Resource sku. + :vartype sku: str + """ + + _validation = { + 'location': {'readonly': True}, + 'sku': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceAttributes, self).__init__(**kwargs) + self.location = None + self.sku = None + + +class ReservationRecommendation(Resource, ResourceAttributes): + """A reservation recommendation resource. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: LegacyReservationRecommendation, ModernReservationRecommendation. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar location: Resource location. + :vartype location: str + :ivar sku: Resource sku. + :vartype sku: str + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: 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 + """ + + _validation = { + 'location': {'readonly': True}, + 'sku': {'readonly': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'legacy': 'LegacyReservationRecommendation', 'modern': 'ModernReservationRecommendation'} + } + + def __init__( + self, + **kwargs + ): + super(ReservationRecommendation, self).__init__(**kwargs) + self.location = None + self.sku = None + self.kind = 'ReservationRecommendation' # type: str + self.id = None + self.name = None + self.type = None + self.tags = None + self.kind = 'ReservationRecommendation' # type: str + + +class LegacyReservationRecommendation(ReservationRecommendation): + """Legacy reservation recommendation. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar location: Resource location. + :vartype location: str + :ivar sku: Resource sku. + :vartype sku: str + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: 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 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 + :ivar instance_flexibility_group: The instance Flexibility Group. + :vartype instance_flexibility_group: str + :ivar normalized_size: The normalized Size. + :vartype normalized_size: str + :ivar recommended_quantity_normalized: The recommended Quantity Normalized. + :vartype recommended_quantity_normalized: float + :ivar meter_id: The meter id (GUID). + :vartype meter_id: 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. + :vartype cost_with_no_reserved_instances: float + :ivar recommended_quantity: Recommended quality for reserved instances. + :vartype recommended_quantity: float + :ivar total_cost_with_reserved_instances: The total amount of cost with reserved instances. + :vartype total_cost_with_reserved_instances: float + :ivar net_savings: Total estimated savings with reserved instances. + :vartype net_savings: float + :ivar first_usage_date: The usage date for looking back. + :vartype first_usage_date: ~datetime.datetime + :ivar scope: Shared or single recommendation. + :vartype scope: str + :ivar sku_properties: List of sku properties. + :vartype sku_properties: list[~azure.mgmt.consumption.models.SkuProperty] + """ + + _validation = { + 'location': {'readonly': True}, + 'sku': {'readonly': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'kind': {'required': True}, + 'look_back_period': {'readonly': True}, + 'instance_flexibility_ratio': {'readonly': True}, + 'instance_flexibility_group': {'readonly': True}, + 'normalized_size': {'readonly': True}, + 'recommended_quantity_normalized': {'readonly': True}, + 'meter_id': {'readonly': True}, + 'term': {'readonly': True}, + 'cost_with_no_reserved_instances': {'readonly': True}, + 'recommended_quantity': {'readonly': True}, + 'total_cost_with_reserved_instances': {'readonly': True}, + 'net_savings': {'readonly': True}, + 'first_usage_date': {'readonly': True}, + 'scope': {'readonly': True}, + 'sku_properties': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', '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_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'}, + 'term': {'key': 'properties.term', 'type': 'str'}, + 'cost_with_no_reserved_instances': {'key': 'properties.costWithNoReservedInstances', 'type': 'float'}, + 'recommended_quantity': {'key': 'properties.recommendedQuantity', 'type': 'float'}, + 'total_cost_with_reserved_instances': {'key': 'properties.totalCostWithReservedInstances', 'type': 'float'}, + 'net_savings': {'key': 'properties.netSavings', 'type': 'float'}, + 'first_usage_date': {'key': 'properties.firstUsageDate', 'type': 'iso-8601'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + 'sku_properties': {'key': 'properties.skuProperties', 'type': '[SkuProperty]'}, + } + + def __init__( + self, + **kwargs + ): + super(LegacyReservationRecommendation, self).__init__(**kwargs) + self.kind = 'legacy' # type: str + self.look_back_period = None + self.instance_flexibility_ratio = None + self.instance_flexibility_group = None + self.normalized_size = None + self.recommended_quantity_normalized = None + self.meter_id = None + self.term = None + self.cost_with_no_reserved_instances = None + self.recommended_quantity = None + self.total_cost_with_reserved_instances = None + self.net_savings = None + self.first_usage_date = None + self.scope = None + self.sku_properties = None + + +class ReservationTransaction(Resource): + """Reservation transaction resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar event_date: The date of the transaction. + :vartype event_date: ~datetime.datetime + :ivar reservation_order_id: The reservation order ID is the identifier for a reservation + purchase. Each reservation order ID represents a single purchase transaction. A reservation + order contains reservations. The reservation order specifies the VM size and region for the + reservations. + :vartype reservation_order_id: str + :ivar description: The description of the transaction. + :vartype description: str + :ivar event_type: The type of the transaction (Purchase, Cancel, etc.). + :vartype event_type: str + :ivar quantity: The quantity of the transaction. + :vartype quantity: float + :ivar amount: The charge of the transaction. + :vartype amount: float + :ivar currency: The ISO currency in which the transaction is charged, for example, USD. + :vartype currency: str + :ivar reservation_order_name: The name of the reservation order. + :vartype reservation_order_name: str + :ivar purchasing_enrollment: The purchasing enrollment. + :vartype purchasing_enrollment: str + :ivar purchasing_subscription_guid: The subscription guid that makes the transaction. + :vartype purchasing_subscription_guid: str + :ivar purchasing_subscription_name: The subscription name that makes the transaction. + :vartype purchasing_subscription_name: str + :ivar arm_sku_name: This is the ARM Sku name. It can be used to join with the serviceType field + in additional info in usage records. + :vartype arm_sku_name: str + :ivar term: This is the term of the transaction. + :vartype term: str + :ivar region: The region of the transaction. + :vartype region: str + :ivar account_name: The name of the account that makes the transaction. + :vartype account_name: str + :ivar account_owner_email: The email of the account owner that makes the transaction. + :vartype account_owner_email: str + :ivar department_name: The department name. + :vartype department_name: str + :ivar cost_center: The cost center of this department if it is a department and a cost center + is provided. + :vartype cost_center: str + :ivar current_enrollment: The current enrollment. + :vartype current_enrollment: str + :ivar billing_frequency: The billing frequency, which can be either one-time or recurring. + :vartype billing_frequency: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'event_date': {'readonly': True}, + 'reservation_order_id': {'readonly': True}, + 'description': {'readonly': True}, + 'event_type': {'readonly': True}, + 'quantity': {'readonly': True}, + 'amount': {'readonly': True}, + 'currency': {'readonly': True}, + 'reservation_order_name': {'readonly': True}, + 'purchasing_enrollment': {'readonly': True}, + 'purchasing_subscription_guid': {'readonly': True}, + 'purchasing_subscription_name': {'readonly': True}, + 'arm_sku_name': {'readonly': True}, + 'term': {'readonly': True}, + 'region': {'readonly': True}, + 'account_name': {'readonly': True}, + 'account_owner_email': {'readonly': True}, + 'department_name': {'readonly': True}, + 'cost_center': {'readonly': True}, + 'current_enrollment': {'readonly': True}, + 'billing_frequency': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'event_date': {'key': 'properties.eventDate', 'type': 'iso-8601'}, + 'reservation_order_id': {'key': 'properties.reservationOrderId', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'event_type': {'key': 'properties.eventType', 'type': 'str'}, + 'quantity': {'key': 'properties.quantity', 'type': 'float'}, + 'amount': {'key': 'properties.amount', 'type': 'float'}, + 'currency': {'key': 'properties.currency', 'type': 'str'}, + 'reservation_order_name': {'key': 'properties.reservationOrderName', 'type': 'str'}, + 'purchasing_enrollment': {'key': 'properties.purchasingEnrollment', 'type': 'str'}, + 'purchasing_subscription_guid': {'key': 'properties.purchasingSubscriptionGuid', 'type': 'str'}, + 'purchasing_subscription_name': {'key': 'properties.purchasingSubscriptionName', 'type': 'str'}, + 'arm_sku_name': {'key': 'properties.armSkuName', 'type': 'str'}, + 'term': {'key': 'properties.term', 'type': 'str'}, + 'region': {'key': 'properties.region', 'type': 'str'}, + 'account_name': {'key': 'properties.accountName', 'type': 'str'}, + 'account_owner_email': {'key': 'properties.accountOwnerEmail', 'type': 'str'}, + 'department_name': {'key': 'properties.departmentName', 'type': 'str'}, + 'cost_center': {'key': 'properties.costCenter', 'type': 'str'}, + 'current_enrollment': {'key': 'properties.currentEnrollment', 'type': 'str'}, + 'billing_frequency': {'key': 'properties.billingFrequency', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ReservationTransaction, self).__init__(**kwargs) + self.event_date = None + self.reservation_order_id = None + self.description = None + self.event_type = None + self.quantity = None + self.amount = None + self.currency = None + self.reservation_order_name = None + self.purchasing_enrollment = None + self.purchasing_subscription_guid = None + self.purchasing_subscription_name = None + self.arm_sku_name = None + self.term = None + self.region = None + self.account_name = None + self.account_owner_email = None + self.department_name = None + self.cost_center = None + self.current_enrollment = None + self.billing_frequency = None + + +class LegacyReservationTransaction(ReservationTransaction): + """Legacy Reservation transaction resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar event_date: The date of the transaction. + :vartype event_date: ~datetime.datetime + :ivar reservation_order_id: The reservation order ID is the identifier for a reservation + purchase. Each reservation order ID represents a single purchase transaction. A reservation + order contains reservations. The reservation order specifies the VM size and region for the + reservations. + :vartype reservation_order_id: str + :ivar description: The description of the transaction. + :vartype description: str + :ivar event_type: The type of the transaction (Purchase, Cancel, etc.). + :vartype event_type: str + :ivar quantity: The quantity of the transaction. + :vartype quantity: float + :ivar amount: The charge of the transaction. + :vartype amount: float + :ivar currency: The ISO currency in which the transaction is charged, for example, USD. + :vartype currency: str + :ivar reservation_order_name: The name of the reservation order. + :vartype reservation_order_name: str + :ivar purchasing_enrollment: The purchasing enrollment. + :vartype purchasing_enrollment: str + :ivar purchasing_subscription_guid: The subscription guid that makes the transaction. + :vartype purchasing_subscription_guid: str + :ivar purchasing_subscription_name: The subscription name that makes the transaction. + :vartype purchasing_subscription_name: str + :ivar arm_sku_name: This is the ARM Sku name. It can be used to join with the serviceType field + in additional info in usage records. + :vartype arm_sku_name: str + :ivar term: This is the term of the transaction. + :vartype term: str + :ivar region: The region of the transaction. + :vartype region: str + :ivar account_name: The name of the account that makes the transaction. + :vartype account_name: str + :ivar account_owner_email: The email of the account owner that makes the transaction. + :vartype account_owner_email: str + :ivar department_name: The department name. + :vartype department_name: str + :ivar cost_center: The cost center of this department if it is a department and a cost center + is provided. + :vartype cost_center: str + :ivar current_enrollment: The current enrollment. + :vartype current_enrollment: str + :ivar billing_frequency: The billing frequency, which can be either one-time or recurring. + :vartype billing_frequency: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'event_date': {'readonly': True}, + 'reservation_order_id': {'readonly': True}, + 'description': {'readonly': True}, + 'event_type': {'readonly': True}, + 'quantity': {'readonly': True}, + 'amount': {'readonly': True}, + 'currency': {'readonly': True}, + 'reservation_order_name': {'readonly': True}, + 'purchasing_enrollment': {'readonly': True}, + 'purchasing_subscription_guid': {'readonly': True}, + 'purchasing_subscription_name': {'readonly': True}, + 'arm_sku_name': {'readonly': True}, + 'term': {'readonly': True}, + 'region': {'readonly': True}, + 'account_name': {'readonly': True}, + 'account_owner_email': {'readonly': True}, + 'department_name': {'readonly': True}, + 'cost_center': {'readonly': True}, + 'current_enrollment': {'readonly': True}, + 'billing_frequency': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'event_date': {'key': 'properties.eventDate', 'type': 'iso-8601'}, + 'reservation_order_id': {'key': 'properties.reservationOrderId', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'event_type': {'key': 'properties.eventType', 'type': 'str'}, + 'quantity': {'key': 'properties.quantity', 'type': 'float'}, + 'amount': {'key': 'properties.amount', 'type': 'float'}, + 'currency': {'key': 'properties.currency', 'type': 'str'}, + 'reservation_order_name': {'key': 'properties.reservationOrderName', 'type': 'str'}, + 'purchasing_enrollment': {'key': 'properties.purchasingEnrollment', 'type': 'str'}, + 'purchasing_subscription_guid': {'key': 'properties.purchasingSubscriptionGuid', 'type': 'str'}, + 'purchasing_subscription_name': {'key': 'properties.purchasingSubscriptionName', 'type': 'str'}, + 'arm_sku_name': {'key': 'properties.armSkuName', 'type': 'str'}, + 'term': {'key': 'properties.term', 'type': 'str'}, + 'region': {'key': 'properties.region', 'type': 'str'}, + 'account_name': {'key': 'properties.accountName', 'type': 'str'}, + 'account_owner_email': {'key': 'properties.accountOwnerEmail', 'type': 'str'}, + 'department_name': {'key': 'properties.departmentName', 'type': 'str'}, + 'cost_center': {'key': 'properties.costCenter', 'type': 'str'}, + 'current_enrollment': {'key': 'properties.currentEnrollment', 'type': 'str'}, + 'billing_frequency': {'key': 'properties.billingFrequency', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LegacyReservationTransaction, self).__init__(**kwargs) + + +class UsageDetail(Resource): + """An usage detail resource. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: LegacyUsageDetail, ModernUsageDetail. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :param kind: Required. Specifies the kind of usage details.Constant filled by server. Possible + values include: "legacy", "modern". + :type kind: str or ~azure.mgmt.consumption.models.UsageDetailsKind + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'legacy': 'LegacyUsageDetail', 'modern': 'ModernUsageDetail'} + } + + def __init__( + self, + **kwargs + ): + super(UsageDetail, self).__init__(**kwargs) + self.kind = 'UsageDetail' # type: str + + +class LegacyUsageDetail(UsageDetail): + """Legacy usage detail. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :param kind: Required. Specifies the kind of usage details.Constant filled by server. Possible + values include: "legacy", "modern". + :type kind: str or ~azure.mgmt.consumption.models.UsageDetailsKind + :ivar billing_account_id: Billing Account identifier. + :vartype billing_account_id: str + :ivar billing_account_name: Billing Account Name. + :vartype billing_account_name: str + :ivar billing_period_start_date: The billing period start date. + :vartype billing_period_start_date: ~datetime.datetime + :ivar billing_period_end_date: The billing period end date. + :vartype billing_period_end_date: ~datetime.datetime + :ivar billing_profile_id: Billing Profile identifier. + :vartype billing_profile_id: str + :ivar billing_profile_name: Billing Profile Name. + :vartype billing_profile_name: str + :ivar account_owner_id: Account Owner Id. + :vartype account_owner_id: str + :ivar account_name: Account Name. + :vartype account_name: str + :ivar subscription_id: Subscription guid. + :vartype subscription_id: str + :ivar subscription_name: Subscription name. + :vartype subscription_name: str + :ivar date: Date for the usage record. + :vartype date: ~datetime.datetime + :ivar product: Product name for the consumed service or purchase. Not available for + Marketplace. + :vartype product: str + :ivar part_number: Part Number of the service used. Can be used to join with the price sheet. + Not available for marketplace. + :vartype part_number: str + :ivar meter_id: The meter id (GUID). Not available for marketplace. For reserved instance this + represents the primary meter for which the reservation was purchased. For the actual VM Size + for which the reservation is purchased see productOrderName. + :vartype meter_id: str + :ivar meter_details: The details about the meter. By default this is not populated, unless it's + specified in $expand. + :vartype meter_details: ~azure.mgmt.consumption.models.MeterDetailsResponse + :ivar quantity: The usage quantity. + :vartype quantity: float + :ivar effective_price: Effective Price that's charged for the usage. + :vartype effective_price: float + :ivar cost: The amount of cost before tax. + :vartype cost: float + :ivar unit_price: Unit Price is the price applicable to you. (your EA or other contract price). + :vartype unit_price: float + :ivar billing_currency: Billing Currency. + :vartype billing_currency: str + :ivar resource_location: Resource Location. + :vartype resource_location: str + :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. + :vartype resource_id: str + :ivar resource_name: Resource Name. + :vartype resource_name: str + :ivar service_info1: Service Info 1. + :vartype service_info1: str + :ivar service_info2: Service Info 2. + :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 + as the actual VM Size (ServiceType) or the ratio in which the reservation discount is applied. + :vartype additional_info: str + :ivar invoice_section: Invoice Section Name. + :vartype invoice_section: str + :ivar cost_center: The cost center of this department if it is a department and a cost center + is provided. + :vartype cost_center: str + :ivar resource_group: Resource Group Name. + :vartype resource_group: str + :ivar reservation_id: ARM resource id of the reservation. Only applies to records relevant to + reservations. + :vartype reservation_id: str + :ivar reservation_name: User provided display name of the reservation. Last known name for a + particular day is populated in the daily data. Only applies to records relevant to + reservations. + :vartype reservation_name: str + :ivar product_order_id: Product Order Id. For reservations this is the Reservation Order ID. + :vartype product_order_id: str + :ivar product_order_name: Product Order Name. For reservations this is the SKU that was + purchased. + :vartype product_order_name: str + :ivar offer_id: Offer Id. Ex: MS-AZR-0017P, MS-AZR-0148P. + :vartype offer_id: str + :ivar is_azure_credit_eligible: Is Azure Credit Eligible. + :vartype is_azure_credit_eligible: bool + :ivar term: Term (in months). 1 month for monthly recurring purchase. 12 months for a 1 year + reservation. 36 months for a 3 year reservation. + :vartype term: str + :ivar publisher_name: Publisher Name. + :vartype publisher_name: str + :ivar publisher_type: Publisher Type. + :vartype publisher_type: str + :ivar plan_name: Plan Name. + :vartype plan_name: str + :ivar charge_type: Indicates a charge represents credits, usage, a Marketplace purchase, a + reservation fee, or a refund. + :vartype charge_type: str + :ivar frequency: Indicates how frequently this charge will occur. OneTime for purchases which + only happen once, Monthly for fees which recur every month, and UsageBased for charges based on + how much a service is used. + :vartype frequency: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'kind': {'required': True}, + 'billing_account_id': {'readonly': True}, + 'billing_account_name': {'readonly': True}, + 'billing_period_start_date': {'readonly': True}, + 'billing_period_end_date': {'readonly': True}, + 'billing_profile_id': {'readonly': True}, + 'billing_profile_name': {'readonly': True}, + 'account_owner_id': {'readonly': True}, + 'account_name': {'readonly': True}, + 'subscription_id': {'readonly': True}, + 'subscription_name': {'readonly': True}, + 'date': {'readonly': True}, + 'product': {'readonly': True}, + 'part_number': {'readonly': True}, + 'meter_id': {'readonly': True}, + 'meter_details': {'readonly': True}, + 'quantity': {'readonly': True}, + 'effective_price': {'readonly': True}, + 'cost': {'readonly': True}, + 'unit_price': {'readonly': True}, + 'billing_currency': {'readonly': True}, + 'resource_location': {'readonly': True}, + 'consumed_service': {'readonly': True}, + 'resource_id': {'readonly': True}, + 'resource_name': {'readonly': True}, + 'service_info1': {'readonly': True}, + 'service_info2': {'readonly': True}, + 'additional_info': {'readonly': True}, + 'invoice_section': {'readonly': True}, + 'cost_center': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'reservation_id': {'readonly': True}, + 'reservation_name': {'readonly': True}, + 'product_order_id': {'readonly': True}, + 'product_order_name': {'readonly': True}, + 'offer_id': {'readonly': True}, + 'is_azure_credit_eligible': {'readonly': True}, + 'term': {'readonly': True}, + 'publisher_name': {'readonly': True}, + 'publisher_type': {'readonly': True}, + 'plan_name': {'readonly': True}, + 'charge_type': {'readonly': True}, + 'frequency': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'billing_account_id': {'key': 'properties.billingAccountId', 'type': 'str'}, + 'billing_account_name': {'key': 'properties.billingAccountName', 'type': 'str'}, + 'billing_period_start_date': {'key': 'properties.billingPeriodStartDate', 'type': 'iso-8601'}, + 'billing_period_end_date': {'key': 'properties.billingPeriodEndDate', 'type': 'iso-8601'}, + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'billing_profile_name': {'key': 'properties.billingProfileName', 'type': 'str'}, + 'account_owner_id': {'key': 'properties.accountOwnerId', 'type': 'str'}, + 'account_name': {'key': 'properties.accountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + 'subscription_name': {'key': 'properties.subscriptionName', 'type': 'str'}, + 'date': {'key': 'properties.date', 'type': 'iso-8601'}, + 'product': {'key': 'properties.product', 'type': 'str'}, + 'part_number': {'key': 'properties.partNumber', 'type': 'str'}, + 'meter_id': {'key': 'properties.meterId', 'type': 'str'}, + 'meter_details': {'key': 'properties.meterDetails', 'type': 'MeterDetailsResponse'}, + 'quantity': {'key': 'properties.quantity', 'type': 'float'}, + 'effective_price': {'key': 'properties.effectivePrice', 'type': 'float'}, + 'cost': {'key': 'properties.cost', 'type': 'float'}, + 'unit_price': {'key': 'properties.unitPrice', 'type': 'float'}, + 'billing_currency': {'key': 'properties.billingCurrency', 'type': 'str'}, + 'resource_location': {'key': 'properties.resourceLocation', 'type': 'str'}, + 'consumed_service': {'key': 'properties.consumedService', 'type': 'str'}, + 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, + 'resource_name': {'key': 'properties.resourceName', 'type': 'str'}, + 'service_info1': {'key': 'properties.serviceInfo1', 'type': 'str'}, + 'service_info2': {'key': 'properties.serviceInfo2', 'type': 'str'}, + 'additional_info': {'key': 'properties.additionalInfo', 'type': 'str'}, + 'invoice_section': {'key': 'properties.invoiceSection', 'type': 'str'}, + 'cost_center': {'key': 'properties.costCenter', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'reservation_id': {'key': 'properties.reservationId', 'type': 'str'}, + 'reservation_name': {'key': 'properties.reservationName', 'type': 'str'}, + 'product_order_id': {'key': 'properties.productOrderId', 'type': 'str'}, + 'product_order_name': {'key': 'properties.productOrderName', 'type': 'str'}, + 'offer_id': {'key': 'properties.offerId', 'type': 'str'}, + 'is_azure_credit_eligible': {'key': 'properties.isAzureCreditEligible', 'type': 'bool'}, + 'term': {'key': 'properties.term', 'type': 'str'}, + 'publisher_name': {'key': 'properties.publisherName', 'type': 'str'}, + 'publisher_type': {'key': 'properties.publisherType', 'type': 'str'}, + 'plan_name': {'key': 'properties.planName', 'type': 'str'}, + 'charge_type': {'key': 'properties.chargeType', 'type': 'str'}, + 'frequency': {'key': 'properties.frequency', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LegacyUsageDetail, self).__init__(**kwargs) + self.kind = 'legacy' # type: str + self.billing_account_id = None + self.billing_account_name = None + self.billing_period_start_date = None + self.billing_period_end_date = None + self.billing_profile_id = None + self.billing_profile_name = None + self.account_owner_id = None + self.account_name = None + self.subscription_id = None + self.subscription_name = None + self.date = None + self.product = None + self.part_number = None + self.meter_id = None + self.meter_details = None + self.quantity = None + self.effective_price = None + self.cost = None + self.unit_price = None + self.billing_currency = None + self.resource_location = None + self.consumed_service = None + self.resource_id = None + self.resource_name = None + self.service_info1 = None + self.service_info2 = None + self.additional_info = None + self.invoice_section = None + self.cost_center = None + self.resource_group = None + self.reservation_id = None + self.reservation_name = None + self.product_order_id = None + self.product_order_name = None + self.offer_id = None + self.is_azure_credit_eligible = None + self.term = None + self.publisher_name = None + self.publisher_type = None + self.plan_name = None + self.charge_type = None + self.frequency = None + + +class Lots(msrest.serialization.Model): + """Result of listing lot summary. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of lot summary. + :vartype value: list[~azure.mgmt.consumption.models.LotSummary] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[LotSummary]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Lots, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class LotSummary(Resource): + """A lot summary resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar original_amount: Original amount. + :vartype original_amount: ~azure.mgmt.consumption.models.Amount + :ivar closed_balance: Closed balance. + :vartype closed_balance: ~azure.mgmt.consumption.models.Amount + :ivar source: Lot source. Possible values include: "PurchasedCredit", "PromotionalCredit". + :vartype source: str or ~azure.mgmt.consumption.models.LotSource + :ivar start_date: Start date. + :vartype start_date: ~datetime.datetime + :ivar expiration_date: Expiration date. + :vartype expiration_date: ~datetime.datetime + :ivar po_number: PO number. + :vartype po_number: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'original_amount': {'readonly': True}, + 'closed_balance': {'readonly': True}, + 'source': {'readonly': True}, + 'start_date': {'readonly': True}, + 'expiration_date': {'readonly': True}, + 'po_number': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'original_amount': {'key': 'properties.originalAmount', 'type': 'Amount'}, + 'closed_balance': {'key': 'properties.closedBalance', 'type': 'Amount'}, + 'source': {'key': 'properties.source', 'type': 'str'}, + 'start_date': {'key': 'properties.startDate', 'type': 'iso-8601'}, + 'expiration_date': {'key': 'properties.expirationDate', 'type': 'iso-8601'}, + 'po_number': {'key': 'properties.poNumber', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LotSummary, self).__init__(**kwargs) + self.original_amount = None + self.closed_balance = None + self.source = None + self.start_date = None + self.expiration_date = None + self.po_number = None + + +class ManagementGroupAggregatedCostResult(Resource): + """A management group aggregated cost resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar billing_period_id: The id of the billing period resource that the aggregated cost belongs + to. + :vartype billing_period_id: str + :ivar usage_start: The start of the date time range covered by aggregated cost. + :vartype usage_start: ~datetime.datetime + :ivar usage_end: The end of the date time range covered by the aggregated cost. + :vartype usage_end: ~datetime.datetime + :ivar azure_charges: Azure Charges. + :vartype azure_charges: float + :ivar marketplace_charges: Marketplace Charges. + :vartype marketplace_charges: float + :ivar charges_billed_separately: Charges Billed Separately. + :vartype charges_billed_separately: float + :ivar currency: The ISO currency in which the meter is charged, for example, USD. + :vartype currency: str + :param children: Children of a management group. + :type children: list[~azure.mgmt.consumption.models.ManagementGroupAggregatedCostResult] + :param included_subscriptions: List of subscription Guids included in the calculation of + aggregated cost. + :type included_subscriptions: list[str] + :param excluded_subscriptions: List of subscription Guids excluded from the calculation of + aggregated cost. + :type excluded_subscriptions: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'billing_period_id': {'readonly': True}, + 'usage_start': {'readonly': True}, + 'usage_end': {'readonly': True}, + 'azure_charges': {'readonly': True}, + 'marketplace_charges': {'readonly': True}, + 'charges_billed_separately': {'readonly': True}, + 'currency': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'billing_period_id': {'key': 'properties.billingPeriodId', 'type': 'str'}, + 'usage_start': {'key': 'properties.usageStart', 'type': 'iso-8601'}, + 'usage_end': {'key': 'properties.usageEnd', 'type': 'iso-8601'}, + 'azure_charges': {'key': 'properties.azureCharges', 'type': 'float'}, + 'marketplace_charges': {'key': 'properties.marketplaceCharges', 'type': 'float'}, + 'charges_billed_separately': {'key': 'properties.chargesBilledSeparately', 'type': 'float'}, + 'currency': {'key': 'properties.currency', 'type': 'str'}, + 'children': {'key': 'properties.children', 'type': '[ManagementGroupAggregatedCostResult]'}, + 'included_subscriptions': {'key': 'properties.includedSubscriptions', 'type': '[str]'}, + 'excluded_subscriptions': {'key': 'properties.excludedSubscriptions', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagementGroupAggregatedCostResult, self).__init__(**kwargs) + self.billing_period_id = None + self.usage_start = None + self.usage_end = None + self.azure_charges = None + self.marketplace_charges = None + self.charges_billed_separately = None + self.currency = None + self.children = kwargs.get('children', None) + self.included_subscriptions = kwargs.get('included_subscriptions', None) + self.excluded_subscriptions = kwargs.get('excluded_subscriptions', None) + + +class Marketplace(Resource): + """An marketplace resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar billing_period_id: The id of the billing period resource that the usage belongs to. + :vartype billing_period_id: str + :ivar usage_start: The start of the date time range covered by the usage detail. + :vartype usage_start: ~datetime.datetime + :ivar usage_end: The end of the date time range covered by the usage detail. + :vartype usage_end: ~datetime.datetime + :ivar resource_rate: The marketplace resource rate. + :vartype resource_rate: float + :ivar offer_name: The type of offer. + :vartype offer_name: str + :ivar resource_group: The name of resource group. + :vartype resource_group: 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. + :vartype instance_name: str + :ivar instance_id: The uri of the resource instance that the usage is about. + :vartype instance_id: str + :ivar currency: The ISO currency in which the meter is charged, for example, USD. + :vartype currency: str + :ivar consumed_quantity: The quantity of usage. + :vartype consumed_quantity: float + :ivar unit_of_measure: The unit of measure. + :vartype unit_of_measure: str + :ivar pretax_cost: The amount of cost before tax. + :vartype pretax_cost: float + :ivar is_estimated: The estimated usage is subject to change. + :vartype is_estimated: bool + :ivar meter_id: The meter id (GUID). + :vartype meter_id: str + :ivar subscription_guid: Subscription guid. + :vartype subscription_guid: str + :ivar subscription_name: Subscription name. + :vartype subscription_name: str + :ivar account_name: Account name. + :vartype account_name: str + :ivar department_name: Department name. + :vartype department_name: str + :ivar consumed_service: Consumed service name. + :vartype consumed_service: str + :ivar cost_center: The cost center of this department if it is a department and a costcenter + exists. + :vartype cost_center: str + :ivar additional_properties: Additional details of this usage item. By default this is not + populated, unless it's specified in $expand. + :vartype additional_properties: str + :ivar publisher_name: The name of publisher. + :vartype publisher_name: str + :ivar plan_name: The name of plan. + :vartype plan_name: str + :ivar is_recurring_charge: Flag indicating whether this is a recurring charge or not. + :vartype is_recurring_charge: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'billing_period_id': {'readonly': True}, + 'usage_start': {'readonly': True}, + 'usage_end': {'readonly': True}, + 'resource_rate': {'readonly': True}, + 'offer_name': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'order_number': {'readonly': True}, + 'instance_name': {'readonly': True}, + 'instance_id': {'readonly': True}, + 'currency': {'readonly': True}, + 'consumed_quantity': {'readonly': True}, + 'unit_of_measure': {'readonly': True}, + 'pretax_cost': {'readonly': True}, + 'is_estimated': {'readonly': True}, + 'meter_id': {'readonly': True}, + 'subscription_guid': {'readonly': True}, + 'subscription_name': {'readonly': True}, + 'account_name': {'readonly': True}, + 'department_name': {'readonly': True}, + 'consumed_service': {'readonly': True}, + 'cost_center': {'readonly': True}, + 'additional_properties': {'readonly': True}, + 'publisher_name': {'readonly': True}, + 'plan_name': {'readonly': True}, + 'is_recurring_charge': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'billing_period_id': {'key': 'properties.billingPeriodId', 'type': 'str'}, + 'usage_start': {'key': 'properties.usageStart', 'type': 'iso-8601'}, + 'usage_end': {'key': 'properties.usageEnd', 'type': 'iso-8601'}, + 'resource_rate': {'key': 'properties.resourceRate', 'type': 'float'}, + 'offer_name': {'key': 'properties.offerName', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'order_number': {'key': 'properties.orderNumber', 'type': 'str'}, + 'instance_name': {'key': 'properties.instanceName', 'type': 'str'}, + 'instance_id': {'key': 'properties.instanceId', 'type': 'str'}, + 'currency': {'key': 'properties.currency', 'type': 'str'}, + 'consumed_quantity': {'key': 'properties.consumedQuantity', 'type': 'float'}, + 'unit_of_measure': {'key': 'properties.unitOfMeasure', 'type': 'str'}, + 'pretax_cost': {'key': 'properties.pretaxCost', 'type': 'float'}, + 'is_estimated': {'key': 'properties.isEstimated', 'type': 'bool'}, + 'meter_id': {'key': 'properties.meterId', 'type': 'str'}, + 'subscription_guid': {'key': 'properties.subscriptionGuid', 'type': 'str'}, + 'subscription_name': {'key': 'properties.subscriptionName', 'type': 'str'}, + 'account_name': {'key': 'properties.accountName', 'type': 'str'}, + 'department_name': {'key': 'properties.departmentName', 'type': 'str'}, + 'consumed_service': {'key': 'properties.consumedService', 'type': 'str'}, + 'cost_center': {'key': 'properties.costCenter', 'type': 'str'}, + 'additional_properties': {'key': 'properties.additionalProperties', 'type': 'str'}, + 'publisher_name': {'key': 'properties.publisherName', 'type': 'str'}, + 'plan_name': {'key': 'properties.planName', 'type': 'str'}, + 'is_recurring_charge': {'key': 'properties.isRecurringCharge', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(Marketplace, self).__init__(**kwargs) + self.billing_period_id = None + self.usage_start = None + self.usage_end = None + self.resource_rate = None + self.offer_name = None + self.resource_group = None + self.order_number = None + self.instance_name = None + self.instance_id = None + self.currency = None + self.consumed_quantity = None + self.unit_of_measure = None + self.pretax_cost = None + self.is_estimated = None + self.meter_id = None + self.subscription_guid = None + self.subscription_name = None + self.account_name = None + self.department_name = None + self.consumed_service = None + self.cost_center = None + self.additional_properties = None + self.publisher_name = None + self.plan_name = None + self.is_recurring_charge = None + + +class MarketplacesListResult(msrest.serialization.Model): + """Result of listing marketplaces. It contains a list of available marketplaces in reverse chronological order by billing period. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of marketplaces. + :vartype value: list[~azure.mgmt.consumption.models.Marketplace] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Marketplace]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MarketplacesListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class MeterDetails(msrest.serialization.Model): + """The properties of the meter detail. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar meter_name: The name of the meter, within the given meter category. + :vartype meter_name: str + :ivar meter_category: The category of the meter, for example, 'Cloud services', 'Networking', + etc.. + :vartype meter_category: str + :ivar meter_sub_category: The subcategory of the meter, for example, 'A6 Cloud services', + 'ExpressRoute (IXP)', etc.. + :vartype meter_sub_category: str + :ivar unit: The unit in which the meter consumption is charged, for example, 'Hours', 'GB', + etc. + :vartype unit: str + :ivar meter_location: The location in which the Azure service is available. + :vartype meter_location: str + :ivar total_included_quantity: The total included quantity associated with the offer. + :vartype total_included_quantity: float + :ivar pretax_standard_rate: The pretax listing price. + :vartype pretax_standard_rate: float + :ivar service_name: The name of the service. + :vartype service_name: str + :ivar service_tier: The service tier. + :vartype service_tier: str + """ + + _validation = { + 'meter_name': {'readonly': True}, + 'meter_category': {'readonly': True}, + 'meter_sub_category': {'readonly': True}, + 'unit': {'readonly': True}, + 'meter_location': {'readonly': True}, + 'total_included_quantity': {'readonly': True}, + 'pretax_standard_rate': {'readonly': True}, + 'service_name': {'readonly': True}, + 'service_tier': {'readonly': True}, + } + + _attribute_map = { + 'meter_name': {'key': 'meterName', 'type': 'str'}, + 'meter_category': {'key': 'meterCategory', 'type': 'str'}, + 'meter_sub_category': {'key': 'meterSubCategory', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'meter_location': {'key': 'meterLocation', 'type': 'str'}, + 'total_included_quantity': {'key': 'totalIncludedQuantity', 'type': 'float'}, + 'pretax_standard_rate': {'key': 'pretaxStandardRate', 'type': 'float'}, + 'service_name': {'key': 'serviceName', 'type': 'str'}, + 'service_tier': {'key': 'serviceTier', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MeterDetails, self).__init__(**kwargs) + self.meter_name = None + self.meter_category = None + self.meter_sub_category = None + self.unit = None + self.meter_location = None + self.total_included_quantity = None + self.pretax_standard_rate = None + self.service_name = None + self.service_tier = None + + +class MeterDetailsResponse(msrest.serialization.Model): + """The properties of the meter detail. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar meter_name: The name of the meter, within the given meter category. + :vartype meter_name: str + :ivar meter_category: The category of the meter, for example, 'Cloud services', 'Networking', + etc.. + :vartype meter_category: str + :ivar meter_sub_category: The subcategory of the meter, for example, 'A6 Cloud services', + 'ExpressRoute (IXP)', etc.. + :vartype meter_sub_category: str + :ivar unit_of_measure: The unit in which the meter consumption is charged, for example, + 'Hours', 'GB', etc. + :vartype unit_of_measure: str + :ivar service_family: The service family. + :vartype service_family: str + """ + + _validation = { + 'meter_name': {'readonly': True}, + 'meter_category': {'readonly': True}, + 'meter_sub_category': {'readonly': True}, + 'unit_of_measure': {'readonly': True}, + 'service_family': {'readonly': True}, + } + + _attribute_map = { + 'meter_name': {'key': 'meterName', 'type': 'str'}, + 'meter_category': {'key': 'meterCategory', 'type': 'str'}, + 'meter_sub_category': {'key': 'meterSubCategory', 'type': 'str'}, + 'unit_of_measure': {'key': 'unitOfMeasure', 'type': 'str'}, + 'service_family': {'key': 'serviceFamily', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MeterDetailsResponse, self).__init__(**kwargs) + self.meter_name = None + self.meter_category = None + self.meter_sub_category = None + self.unit_of_measure = None + self.service_family = None + + +class ModernChargeSummary(ChargeSummary): + """Modern charge summary. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :param kind: Required. Specifies the kind of charge summary.Constant filled by server. + Possible values include: "legacy", "modern". + :type kind: str or ~azure.mgmt.consumption.models.ChargeSummaryKind + :ivar billing_period_id: The id of the billing period resource that the charge belongs to. + :vartype billing_period_id: str + :ivar usage_start: Usage start date. + :vartype usage_start: str + :ivar usage_end: Usage end date. + :vartype usage_end: str + :ivar azure_charges: Azure Charges. + :vartype azure_charges: ~azure.mgmt.consumption.models.Amount + :ivar charges_billed_separately: Charges Billed separately. + :vartype charges_billed_separately: ~azure.mgmt.consumption.models.Amount + :ivar marketplace_charges: Marketplace Charges. + :vartype marketplace_charges: ~azure.mgmt.consumption.models.Amount + :ivar billing_account_id: Billing Account Id. + :vartype billing_account_id: str + :ivar billing_profile_id: Billing Profile Id. + :vartype billing_profile_id: str + :ivar invoice_section_id: Invoice Section Id. + :vartype invoice_section_id: str + :ivar customer_id: Customer Id. + :vartype customer_id: str + :ivar is_invoiced: Is charge Invoiced. + :vartype is_invoiced: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'kind': {'required': True}, + 'billing_period_id': {'readonly': True}, + 'usage_start': {'readonly': True}, + 'usage_end': {'readonly': True}, + 'azure_charges': {'readonly': True}, + 'charges_billed_separately': {'readonly': True}, + 'marketplace_charges': {'readonly': True}, + 'billing_account_id': {'readonly': True}, + 'billing_profile_id': {'readonly': True}, + 'invoice_section_id': {'readonly': True}, + 'customer_id': {'readonly': True}, + 'is_invoiced': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'billing_period_id': {'key': 'properties.billingPeriodId', 'type': 'str'}, + 'usage_start': {'key': 'properties.usageStart', 'type': 'str'}, + 'usage_end': {'key': 'properties.usageEnd', 'type': 'str'}, + 'azure_charges': {'key': 'properties.azureCharges', 'type': 'Amount'}, + 'charges_billed_separately': {'key': 'properties.chargesBilledSeparately', 'type': 'Amount'}, + 'marketplace_charges': {'key': 'properties.marketplaceCharges', 'type': 'Amount'}, + 'billing_account_id': {'key': 'properties.billingAccountId', 'type': 'str'}, + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'invoice_section_id': {'key': 'properties.invoiceSectionId', 'type': 'str'}, + 'customer_id': {'key': 'properties.customerId', 'type': 'str'}, + 'is_invoiced': {'key': 'properties.isInvoiced', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(ModernChargeSummary, self).__init__(**kwargs) + self.kind = 'modern' # type: str + self.billing_period_id = None + self.usage_start = None + self.usage_end = None + self.azure_charges = None + self.charges_billed_separately = None + self.marketplace_charges = None + self.billing_account_id = None + self.billing_profile_id = None + self.invoice_section_id = None + self.customer_id = None + self.is_invoiced = None + + +class ModernReservationRecommendation(ReservationRecommendation): + """Modern reservation recommendation. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar location: Resource location. + :vartype location: str + :ivar sku: Resource sku. + :vartype sku: str + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: 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 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 + :ivar instance_flexibility_group: The instance Flexibility Group. + :vartype instance_flexibility_group: str + :ivar normalized_size: The normalized Size. + :vartype normalized_size: str + :ivar recommended_quantity_normalized: The recommended Quantity Normalized. + :vartype recommended_quantity_normalized: float + :ivar meter_id: The meter id (GUID). + :vartype meter_id: 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. + :vartype cost_with_no_reserved_instances: ~azure.mgmt.consumption.models.Amount + :ivar recommended_quantity: Recommended quality for reserved instances. + :vartype recommended_quantity: float + :ivar total_cost_with_reserved_instances: The total amount of cost with reserved instances. + :vartype total_cost_with_reserved_instances: ~azure.mgmt.consumption.models.Amount + :ivar net_savings: Total estimated savings with reserved instances. + :vartype net_savings: ~azure.mgmt.consumption.models.Amount + :ivar first_usage_date: The usage date for looking back. + :vartype first_usage_date: ~datetime.datetime + :ivar scope: Shared or single recommendation. + :vartype scope: str + :ivar sku_properties: List of sku properties. + :vartype sku_properties: list[~azure.mgmt.consumption.models.SkuProperty] + """ + + _validation = { + 'location': {'readonly': True}, + 'sku': {'readonly': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'kind': {'required': True}, + 'look_back_period': {'readonly': True}, + 'instance_flexibility_ratio': {'readonly': True}, + 'instance_flexibility_group': {'readonly': True}, + 'normalized_size': {'readonly': True}, + 'recommended_quantity_normalized': {'readonly': True}, + 'meter_id': {'readonly': True}, + 'term': {'readonly': True}, + 'cost_with_no_reserved_instances': {'readonly': True}, + 'recommended_quantity': {'readonly': True}, + 'total_cost_with_reserved_instances': {'readonly': True}, + 'net_savings': {'readonly': True}, + 'first_usage_date': {'readonly': True}, + 'scope': {'readonly': True}, + 'sku_properties': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', '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_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'}, + 'term': {'key': 'properties.term', 'type': 'str'}, + 'cost_with_no_reserved_instances': {'key': 'properties.costWithNoReservedInstances', 'type': 'Amount'}, + 'recommended_quantity': {'key': 'properties.recommendedQuantity', 'type': 'float'}, + 'total_cost_with_reserved_instances': {'key': 'properties.totalCostWithReservedInstances', 'type': 'Amount'}, + 'net_savings': {'key': 'properties.netSavings', 'type': 'Amount'}, + 'first_usage_date': {'key': 'properties.firstUsageDate', 'type': 'iso-8601'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + 'sku_properties': {'key': 'properties.skuProperties', 'type': '[SkuProperty]'}, + } + + def __init__( + self, + **kwargs + ): + super(ModernReservationRecommendation, self).__init__(**kwargs) + self.kind = 'modern' # type: str + self.look_back_period = None + self.instance_flexibility_ratio = None + self.instance_flexibility_group = None + self.normalized_size = None + self.recommended_quantity_normalized = None + self.meter_id = None + self.term = None + self.cost_with_no_reserved_instances = None + self.recommended_quantity = None + self.total_cost_with_reserved_instances = None + self.net_savings = None + self.first_usage_date = None + self.scope = None + self.sku_properties = None + + +class ModernReservationTransaction(Resource): + """Modern Reservation transaction resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar amount: The charge of the transaction. + :vartype amount: float + :ivar arm_sku_name: This is the ARM Sku name. It can be used to join with the serviceType field + in additional info in usage records. + :vartype arm_sku_name: str + :ivar billing_frequency: The billing frequency, which can be either one-time or recurring. + :vartype billing_frequency: str + :ivar billing_profile_id: Billing profile Id. + :vartype billing_profile_id: str + :ivar billing_profile_name: Billing profile name. + :vartype billing_profile_name: str + :ivar currency: The ISO currency in which the transaction is charged, for example, USD. + :vartype currency: str + :ivar description: The description of the transaction. + :vartype description: str + :ivar event_date: The date of the transaction. + :vartype event_date: ~datetime.datetime + :ivar event_type: The type of the transaction (Purchase, Cancel, etc.). + :vartype event_type: str + :ivar invoice: Invoice Number. + :vartype invoice: str + :ivar invoice_id: Invoice Id as on the invoice where the specific transaction appears. + :vartype invoice_id: str + :ivar invoice_section_id: Invoice Section Id. + :vartype invoice_section_id: str + :ivar invoice_section_name: Invoice Section Name. + :vartype invoice_section_name: str + :ivar purchasing_subscription_guid: The subscription guid that makes the transaction. + :vartype purchasing_subscription_guid: str + :ivar purchasing_subscription_name: The subscription name that makes the transaction. + :vartype purchasing_subscription_name: str + :ivar quantity: The quantity of the transaction. + :vartype quantity: float + :ivar region: The region of the transaction. + :vartype region: str + :ivar reservation_order_id: The reservation order ID is the identifier for a reservation + purchase. Each reservation order ID represents a single purchase transaction. A reservation + order contains reservations. The reservation order specifies the VM size and region for the + reservations. + :vartype reservation_order_id: str + :ivar reservation_order_name: The name of the reservation order. + :vartype reservation_order_name: str + :ivar term: This is the term of the transaction. + :vartype term: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'amount': {'readonly': True}, + 'arm_sku_name': {'readonly': True}, + 'billing_frequency': {'readonly': True}, + 'billing_profile_id': {'readonly': True}, + 'billing_profile_name': {'readonly': True}, + 'currency': {'readonly': True}, + 'description': {'readonly': True}, + 'event_date': {'readonly': True}, + 'event_type': {'readonly': True}, + 'invoice': {'readonly': True}, + 'invoice_id': {'readonly': True}, + 'invoice_section_id': {'readonly': True}, + 'invoice_section_name': {'readonly': True}, + 'purchasing_subscription_guid': {'readonly': True}, + 'purchasing_subscription_name': {'readonly': True}, + 'quantity': {'readonly': True}, + 'region': {'readonly': True}, + 'reservation_order_id': {'readonly': True}, + 'reservation_order_name': {'readonly': True}, + 'term': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'amount': {'key': 'properties.amount', 'type': 'float'}, + 'arm_sku_name': {'key': 'properties.armSkuName', 'type': 'str'}, + 'billing_frequency': {'key': 'properties.billingFrequency', 'type': 'str'}, + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'billing_profile_name': {'key': 'properties.billingProfileName', 'type': 'str'}, + 'currency': {'key': 'properties.currency', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'event_date': {'key': 'properties.eventDate', 'type': 'iso-8601'}, + 'event_type': {'key': 'properties.eventType', 'type': 'str'}, + 'invoice': {'key': 'properties.invoice', 'type': 'str'}, + 'invoice_id': {'key': 'properties.invoiceId', 'type': 'str'}, + 'invoice_section_id': {'key': 'properties.invoiceSectionId', 'type': 'str'}, + 'invoice_section_name': {'key': 'properties.invoiceSectionName', 'type': 'str'}, + 'purchasing_subscription_guid': {'key': 'properties.purchasingSubscriptionGuid', 'type': 'str'}, + 'purchasing_subscription_name': {'key': 'properties.purchasingSubscriptionName', 'type': 'str'}, + 'quantity': {'key': 'properties.quantity', 'type': 'float'}, + 'region': {'key': 'properties.region', 'type': 'str'}, + 'reservation_order_id': {'key': 'properties.reservationOrderId', 'type': 'str'}, + 'reservation_order_name': {'key': 'properties.reservationOrderName', 'type': 'str'}, + 'term': {'key': 'properties.term', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ModernReservationTransaction, self).__init__(**kwargs) + self.amount = None + self.arm_sku_name = None + self.billing_frequency = None + self.billing_profile_id = None + self.billing_profile_name = None + self.currency = None + self.description = None + self.event_date = None + self.event_type = None + self.invoice = None + self.invoice_id = None + self.invoice_section_id = None + self.invoice_section_name = None + self.purchasing_subscription_guid = None + self.purchasing_subscription_name = None + self.quantity = None + self.region = None + self.reservation_order_id = None + self.reservation_order_name = None + self.term = None + + +class ModernReservationTransactionsListResult(msrest.serialization.Model): + """Result of listing reservation recommendations. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of reservation recommendations. + :vartype value: list[~azure.mgmt.consumption.models.ModernReservationTransaction] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ModernReservationTransaction]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ModernReservationTransactionsListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class ModernUsageDetail(UsageDetail): + """Modern usage detail. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :param kind: Required. Specifies the kind of usage details.Constant filled by server. Possible + values include: "legacy", "modern". + :type kind: str or ~azure.mgmt.consumption.models.UsageDetailsKind + :ivar billing_account_id: Billing Account identifier. + :vartype billing_account_id: str + :ivar billing_account_name: Name of the Billing Account. + :vartype billing_account_name: str + :ivar billing_period_start_date: Billing Period Start Date as in the invoice. + :vartype billing_period_start_date: ~datetime.datetime + :ivar billing_period_end_date: Billing Period End Date as in the invoice. + :vartype billing_period_end_date: ~datetime.datetime + :ivar billing_profile_id: Identifier for the billing profile that groups costs across invoices + in the a singular billing currency across across the customers who have onboarded the Microsoft + customer agreement and the customers in CSP who have made entitlement purchases like SaaS, + Marketplace, RI, etc. + :vartype billing_profile_id: str + :ivar billing_profile_name: Name of the billing profile that groups costs across invoices in + the a singular billing currency across across the customers who have onboarded the Microsoft + customer agreement and the customers in CSP who have made entitlement purchases like SaaS, + Marketplace, RI, etc. + :vartype billing_profile_name: str + :ivar subscription_guid: Unique Microsoft generated identifier for the Azure Subscription. + :vartype subscription_guid: str + :ivar subscription_name: Name of the Azure Subscription. + :vartype subscription_name: str + :ivar date: Date for the usage record. + :vartype date: ~datetime.datetime + :ivar product: Name of the product that has accrued charges by consumption or purchase as + listed in the invoice. Not available for Marketplace. + :vartype product: str + :ivar meter_id: The meter id (GUID). Not available for marketplace. For reserved instance this + represents the primary meter for which the reservation was purchased. For the actual VM Size + for which the reservation is purchased see productOrderName. + :vartype meter_id: str + :ivar meter_name: Identifies the name of the meter against which consumption is measured. + :vartype meter_name: str + :ivar meter_region: Identifies the location of the datacenter for certain services that are + priced based on datacenter location. + :vartype meter_region: str + :ivar meter_category: Identifies the top-level service for the usage. + :vartype meter_category: str + :ivar meter_sub_category: Defines the type or sub-category of Azure service that can affect the + rate. + :vartype meter_sub_category: str + :ivar service_family: List the service family for the product purchased or charged (Example: + Storage ; Compute). + :vartype service_family: str + :ivar quantity: Measure the quantity purchased or consumed.The amount of the meter used during + the billing period. + :vartype quantity: float + :ivar unit_of_measure: Identifies the Unit that the service is charged in. For example, GB, + hours, 10,000 s. + :vartype unit_of_measure: str + :ivar instance_name: Instance Name. + :vartype instance_name: str + :ivar cost_in_usd: Estimated extendedCost or blended cost before tax in USD. + :vartype cost_in_usd: float + :ivar unit_price: Unit Price is the price applicable to you. (your EA or other contract price). + :vartype unit_price: float + :ivar billing_currency_code: The currency defining the billed cost. + :vartype billing_currency_code: str + :ivar resource_location: Name of the resource location. + :vartype resource_location: str + :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. + :vartype service_info1: str + :ivar service_info2: Service Info 2. + :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 + reservation discount is applied. + :vartype additional_info: str + :ivar invoice_section_id: Identifier of the project that is being charged in the invoice. Not + applicable for Microsoft Customer Agreements onboarded by partners. + :vartype invoice_section_id: str + :ivar invoice_section_name: Name of the project that is being charged in the invoice. Not + applicable for Microsoft Customer Agreements onboarded by partners. + :vartype invoice_section_name: str + :ivar cost_center: The cost center of this department if it is a department and a cost center + is provided. + :vartype cost_center: str + :ivar resource_group: Name of the Azure resource group used for cohesive lifecycle management + of resources. + :vartype resource_group: str + :ivar reservation_id: ARM resource id of the reservation. Only applies to records relevant to + reservations. + :vartype reservation_id: str + :ivar reservation_name: User provided display name of the reservation. Last known name for a + particular day is populated in the daily data. Only applies to records relevant to + reservations. + :vartype reservation_name: str + :ivar product_order_id: The identifier for the asset or Azure plan name that the subscription + belongs to. For example: Azure Plan. For reservations this is the Reservation Order ID. + :vartype product_order_id: str + :ivar product_order_name: Product Order Name. For reservations this is the SKU that was + purchased. + :vartype product_order_name: str + :ivar is_azure_credit_eligible: Determines if the cost is eligible to be paid for using Azure + credits. + :vartype is_azure_credit_eligible: bool + :ivar term: Term (in months). Displays the term for the validity of the offer. For example. In + case of reserved instances it displays 12 months for yearly term of reserved instance. For one + time purchases or recurring purchases, the terms displays 1 month; This is not applicable for + Azure consumption. + :vartype term: str + :ivar publisher_name: Name of the publisher of the service including Microsoft or Third Party + publishers. + :vartype publisher_name: str + :ivar publisher_type: Type of publisher that identifies if the publisher is first party, third + party reseller or third party agency. + :vartype publisher_type: str + :ivar charge_type: Indicates a charge represents credits, usage, a Marketplace purchase, a + reservation fee, or a refund. + :vartype charge_type: str + :ivar frequency: Indicates how frequently this charge will occur. OneTime for purchases which + only happen once, Monthly for fees which recur every month, and UsageBased for charges based on + how much a service is used. + :vartype frequency: str + :ivar cost_in_billing_currency: ExtendedCost or blended cost before tax in billed currency. + :vartype cost_in_billing_currency: float + :ivar cost_in_pricing_currency: ExtendedCost or blended cost before tax in pricing currency to + correlate with prices. + :vartype cost_in_pricing_currency: float + :ivar exchange_rate: Exchange rate used in conversion from pricing currency to billing + currency. + :vartype exchange_rate: str + :ivar exchange_rate_date: Date on which exchange rate used in conversion from pricing currency + to billing currency. + :vartype exchange_rate_date: ~datetime.datetime + :ivar invoice_id: Invoice ID as on the invoice where the specific transaction appears. + :vartype invoice_id: str + :ivar previous_invoice_id: Reference to an original invoice there is a refund (negative cost). + This is populated only when there is a refund. + :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. + :vartype product_identifier: str + :ivar resource_location_normalized: Resource Location Normalized. + :vartype resource_location_normalized: str + :ivar service_period_start_date: Start date for the rating period when the service usage was + rated for charges. The prices for Azure services are determined for the rating period. + :vartype service_period_start_date: ~datetime.datetime + :ivar service_period_end_date: End date for the period when the service usage was rated for + charges. The prices for Azure services are determined based on the rating period. + :vartype service_period_end_date: ~datetime.datetime + :ivar customer_tenant_id: Identifier of the customer's AAD tenant. + :vartype customer_tenant_id: str + :ivar customer_name: Name of the customer's AAD tenant. + :vartype customer_name: str + :ivar partner_tenant_id: Identifier for the partner's AAD tenant. + :vartype partner_tenant_id: str + :ivar partner_name: Name of the partner' AAD tenant. + :vartype partner_name: str + :ivar reseller_mpn_id: MPNId for the reseller associated with the subscription. + :vartype reseller_mpn_id: str + :ivar reseller_name: Reseller Name. + :vartype reseller_name: str + :ivar publisher_id: Publisher Id. + :vartype publisher_id: str + :ivar market_price: Market Price that's charged for the usage. + :vartype market_price: float + :ivar exchange_rate_pricing_to_billing: Exchange Rate from pricing currency to billing + currency. + :vartype exchange_rate_pricing_to_billing: float + :ivar payg_cost_in_billing_currency: The amount of PayG cost before tax in billing currency. + :vartype payg_cost_in_billing_currency: float + :ivar payg_cost_in_usd: The amount of PayG cost before tax in US Dollar currency. + :vartype payg_cost_in_usd: float + :ivar partner_earned_credit_rate: Rate of discount applied if there is a partner earned credit + (PEC) based on partner admin link access. + :vartype partner_earned_credit_rate: float + :ivar partner_earned_credit_applied: Flag to indicate if partner earned credit has been applied + or not. + :vartype partner_earned_credit_applied: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'kind': {'required': True}, + 'billing_account_id': {'readonly': True}, + 'billing_account_name': {'readonly': True}, + 'billing_period_start_date': {'readonly': True}, + 'billing_period_end_date': {'readonly': True}, + 'billing_profile_id': {'readonly': True}, + 'billing_profile_name': {'readonly': True}, + 'subscription_guid': {'readonly': True}, + 'subscription_name': {'readonly': True}, + 'date': {'readonly': True}, + 'product': {'readonly': True}, + 'meter_id': {'readonly': True}, + 'meter_name': {'readonly': True}, + 'meter_region': {'readonly': True}, + 'meter_category': {'readonly': True}, + 'meter_sub_category': {'readonly': True}, + 'service_family': {'readonly': True}, + 'quantity': {'readonly': True}, + 'unit_of_measure': {'readonly': True}, + 'instance_name': {'readonly': True}, + 'cost_in_usd': {'readonly': True}, + 'unit_price': {'readonly': True}, + 'billing_currency_code': {'readonly': True}, + 'resource_location': {'readonly': True}, + 'consumed_service': {'readonly': True}, + 'service_info1': {'readonly': True}, + 'service_info2': {'readonly': True}, + 'additional_info': {'readonly': True}, + 'invoice_section_id': {'readonly': True}, + 'invoice_section_name': {'readonly': True}, + 'cost_center': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'reservation_id': {'readonly': True}, + 'reservation_name': {'readonly': True}, + 'product_order_id': {'readonly': True}, + 'product_order_name': {'readonly': True}, + 'is_azure_credit_eligible': {'readonly': True}, + 'term': {'readonly': True}, + 'publisher_name': {'readonly': True}, + 'publisher_type': {'readonly': True}, + 'charge_type': {'readonly': True}, + 'frequency': {'readonly': True}, + 'cost_in_billing_currency': {'readonly': True}, + 'cost_in_pricing_currency': {'readonly': True}, + 'exchange_rate': {'readonly': True}, + 'exchange_rate_date': {'readonly': True}, + 'invoice_id': {'readonly': True}, + 'previous_invoice_id': {'readonly': True}, + 'pricing_currency_code': {'readonly': True}, + 'product_identifier': {'readonly': True}, + 'resource_location_normalized': {'readonly': True}, + 'service_period_start_date': {'readonly': True}, + 'service_period_end_date': {'readonly': True}, + 'customer_tenant_id': {'readonly': True}, + 'customer_name': {'readonly': True}, + 'partner_tenant_id': {'readonly': True}, + 'partner_name': {'readonly': True}, + 'reseller_mpn_id': {'readonly': True}, + 'reseller_name': {'readonly': True}, + 'publisher_id': {'readonly': True}, + 'market_price': {'readonly': True}, + 'exchange_rate_pricing_to_billing': {'readonly': True}, + 'payg_cost_in_billing_currency': {'readonly': True}, + 'payg_cost_in_usd': {'readonly': True}, + 'partner_earned_credit_rate': {'readonly': True}, + 'partner_earned_credit_applied': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'billing_account_id': {'key': 'properties.billingAccountId', 'type': 'str'}, + 'billing_account_name': {'key': 'properties.billingAccountName', 'type': 'str'}, + 'billing_period_start_date': {'key': 'properties.billingPeriodStartDate', 'type': 'iso-8601'}, + 'billing_period_end_date': {'key': 'properties.billingPeriodEndDate', 'type': 'iso-8601'}, + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'billing_profile_name': {'key': 'properties.billingProfileName', 'type': 'str'}, + 'subscription_guid': {'key': 'properties.subscriptionGuid', 'type': 'str'}, + 'subscription_name': {'key': 'properties.subscriptionName', 'type': 'str'}, + 'date': {'key': 'properties.date', 'type': 'iso-8601'}, + 'product': {'key': 'properties.product', 'type': 'str'}, + 'meter_id': {'key': 'properties.meterId', 'type': 'str'}, + 'meter_name': {'key': 'properties.meterName', 'type': 'str'}, + 'meter_region': {'key': 'properties.meterRegion', 'type': 'str'}, + 'meter_category': {'key': 'properties.meterCategory', 'type': 'str'}, + 'meter_sub_category': {'key': 'properties.meterSubCategory', 'type': 'str'}, + 'service_family': {'key': 'properties.serviceFamily', 'type': 'str'}, + 'quantity': {'key': 'properties.quantity', 'type': 'float'}, + 'unit_of_measure': {'key': 'properties.unitOfMeasure', 'type': 'str'}, + 'instance_name': {'key': 'properties.instanceName', 'type': 'str'}, + 'cost_in_usd': {'key': 'properties.costInUSD', 'type': 'float'}, + 'unit_price': {'key': 'properties.unitPrice', 'type': 'float'}, + 'billing_currency_code': {'key': 'properties.billingCurrencyCode', 'type': 'str'}, + 'resource_location': {'key': 'properties.resourceLocation', 'type': 'str'}, + 'consumed_service': {'key': 'properties.consumedService', 'type': 'str'}, + 'service_info1': {'key': 'properties.serviceInfo1', 'type': 'str'}, + 'service_info2': {'key': 'properties.serviceInfo2', 'type': 'str'}, + 'additional_info': {'key': 'properties.additionalInfo', 'type': 'str'}, + 'invoice_section_id': {'key': 'properties.invoiceSectionId', 'type': 'str'}, + 'invoice_section_name': {'key': 'properties.invoiceSectionName', 'type': 'str'}, + 'cost_center': {'key': 'properties.costCenter', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'reservation_id': {'key': 'properties.reservationId', 'type': 'str'}, + 'reservation_name': {'key': 'properties.reservationName', 'type': 'str'}, + 'product_order_id': {'key': 'properties.productOrderId', 'type': 'str'}, + 'product_order_name': {'key': 'properties.productOrderName', 'type': 'str'}, + 'is_azure_credit_eligible': {'key': 'properties.isAzureCreditEligible', 'type': 'bool'}, + 'term': {'key': 'properties.term', 'type': 'str'}, + 'publisher_name': {'key': 'properties.publisherName', 'type': 'str'}, + 'publisher_type': {'key': 'properties.publisherType', 'type': 'str'}, + 'charge_type': {'key': 'properties.chargeType', 'type': 'str'}, + 'frequency': {'key': 'properties.frequency', 'type': 'str'}, + 'cost_in_billing_currency': {'key': 'properties.costInBillingCurrency', 'type': 'float'}, + 'cost_in_pricing_currency': {'key': 'properties.costInPricingCurrency', 'type': 'float'}, + 'exchange_rate': {'key': 'properties.exchangeRate', 'type': 'str'}, + 'exchange_rate_date': {'key': 'properties.exchangeRateDate', 'type': 'iso-8601'}, + 'invoice_id': {'key': 'properties.invoiceId', 'type': 'str'}, + 'previous_invoice_id': {'key': 'properties.previousInvoiceId', 'type': 'str'}, + 'pricing_currency_code': {'key': 'properties.pricingCurrencyCode', 'type': 'str'}, + 'product_identifier': {'key': 'properties.productIdentifier', 'type': 'str'}, + 'resource_location_normalized': {'key': 'properties.resourceLocationNormalized', 'type': 'str'}, + 'service_period_start_date': {'key': 'properties.servicePeriodStartDate', 'type': 'iso-8601'}, + 'service_period_end_date': {'key': 'properties.servicePeriodEndDate', 'type': 'iso-8601'}, + 'customer_tenant_id': {'key': 'properties.customerTenantId', 'type': 'str'}, + 'customer_name': {'key': 'properties.customerName', 'type': 'str'}, + 'partner_tenant_id': {'key': 'properties.partnerTenantId', 'type': 'str'}, + 'partner_name': {'key': 'properties.partnerName', 'type': 'str'}, + 'reseller_mpn_id': {'key': 'properties.resellerMpnId', 'type': 'str'}, + 'reseller_name': {'key': 'properties.resellerName', 'type': 'str'}, + 'publisher_id': {'key': 'properties.publisherId', 'type': 'str'}, + 'market_price': {'key': 'properties.marketPrice', 'type': 'float'}, + 'exchange_rate_pricing_to_billing': {'key': 'properties.exchangeRatePricingToBilling', 'type': 'float'}, + 'payg_cost_in_billing_currency': {'key': 'properties.paygCostInBillingCurrency', 'type': 'float'}, + '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'}, + } + + def __init__( + self, + **kwargs + ): + super(ModernUsageDetail, self).__init__(**kwargs) + self.kind = 'modern' # type: str + self.billing_account_id = None + self.billing_account_name = None + self.billing_period_start_date = None + self.billing_period_end_date = None + self.billing_profile_id = None + self.billing_profile_name = None + self.subscription_guid = None + self.subscription_name = None + self.date = None + self.product = None + self.meter_id = None + self.meter_name = None + self.meter_region = None + self.meter_category = None + self.meter_sub_category = None + self.service_family = None + self.quantity = None + self.unit_of_measure = None + self.instance_name = None + self.cost_in_usd = None + self.unit_price = None + self.billing_currency_code = None + self.resource_location = None + self.consumed_service = None + self.service_info1 = None + self.service_info2 = None + self.additional_info = None + self.invoice_section_id = None + self.invoice_section_name = None + self.cost_center = None + self.resource_group = None + self.reservation_id = None + self.reservation_name = None + self.product_order_id = None + self.product_order_name = None + self.is_azure_credit_eligible = None + self.term = None + self.publisher_name = None + self.publisher_type = None + self.charge_type = None + self.frequency = None + self.cost_in_billing_currency = None + self.cost_in_pricing_currency = None + self.exchange_rate = None + self.exchange_rate_date = None + self.invoice_id = None + self.previous_invoice_id = None + self.pricing_currency_code = None + self.product_identifier = None + self.resource_location_normalized = None + self.service_period_start_date = None + self.service_period_end_date = None + self.customer_tenant_id = None + self.customer_name = None + self.partner_tenant_id = None + self.partner_name = None + self.reseller_mpn_id = None + self.reseller_name = None + self.publisher_id = None + self.market_price = None + self.exchange_rate_pricing_to_billing = None + self.payg_cost_in_billing_currency = None + self.payg_cost_in_usd = None + self.partner_earned_credit_rate = None + self.partner_earned_credit_applied = None + + +class Notification(msrest.serialization.Model): + """The notification associated with a budget. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. The notification is enabled or not. + :type enabled: bool + :param operator: Required. The comparison operator. Possible values include: "EqualTo", + "GreaterThan", "GreaterThanOrEqualTo". + :type operator: str or ~azure.mgmt.consumption.models.OperatorType + :param threshold: Required. Threshold value associated with a notification. Notification is + sent when the cost exceeded the threshold. It is always percent and has to be between 0 and + 1000. + :type threshold: float + :param contact_emails: Required. Email addresses to send the budget notification to when the + threshold is exceeded. + :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. + :type contact_groups: list[str] + :param threshold_type: The type of threshold. Possible values include: "Actual". + :type threshold_type: str or ~azure.mgmt.consumption.models.ThresholdType + """ + + _validation = { + 'enabled': {'required': True}, + 'operator': {'required': True}, + 'threshold': {'required': True}, + 'contact_emails': {'required': True, 'max_items': 50, 'min_items': 1}, + 'contact_groups': {'max_items': 50, 'min_items': 0}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'threshold': {'key': 'threshold', 'type': 'float'}, + 'contact_emails': {'key': 'contactEmails', 'type': '[str]'}, + 'contact_roles': {'key': 'contactRoles', 'type': '[str]'}, + 'contact_groups': {'key': 'contactGroups', 'type': '[str]'}, + 'threshold_type': {'key': 'thresholdType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Notification, self).__init__(**kwargs) + self.enabled = kwargs['enabled'] + self.operator = kwargs['operator'] + self.threshold = kwargs['threshold'] + 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) + + +class Operation(msrest.serialization.Model): + """A Consumption REST API operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Operation name: {provider}/{resource}/{operation}. + :vartype name: str + :param display: The object that represents the operation. + :type display: ~azure.mgmt.consumption.models.OperationDisplay + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__( + self, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = kwargs.get('display', None) + + +class OperationDisplay(msrest.serialization.Model): + """The object that represents the operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provider: Service provider: Microsoft.Consumption. + :vartype provider: str + :ivar resource: Resource on which the operation is performed: UsageDetail, etc. + :vartype resource: str + :ivar operation: Operation type: Read, write, delete, etc. + :vartype operation: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + + +class OperationListResult(msrest.serialization.Model): + """Result of listing consumption operations. It contains a list of operations and a URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of consumption operations supported by the Microsoft.Consumption resource + provider. + :vartype value: list[~azure.mgmt.consumption.models.Operation] + :ivar next_link: URL to get the next set of operation list results if there are any. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class PriceSheetProperties(msrest.serialization.Model): + """The properties of the price sheet. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar billing_period_id: The id of the billing period resource that the usage belongs to. + :vartype billing_period_id: str + :ivar meter_id: The meter id (GUID). + :vartype meter_id: str + :ivar meter_details: The details about the meter. By default this is not populated, unless it's + specified in $expand. + :vartype meter_details: ~azure.mgmt.consumption.models.MeterDetails + :ivar unit_of_measure: Unit of measure. + :vartype unit_of_measure: str + :ivar included_quantity: Included quality for an offer. + :vartype included_quantity: float + :ivar part_number: Part Number. + :vartype part_number: str + :ivar unit_price: Unit Price. + :vartype unit_price: float + :ivar currency_code: Currency Code. + :vartype currency_code: str + :ivar offer_id: Offer Id. + :vartype offer_id: str + """ + + _validation = { + 'billing_period_id': {'readonly': True}, + 'meter_id': {'readonly': True}, + 'meter_details': {'readonly': True}, + 'unit_of_measure': {'readonly': True}, + 'included_quantity': {'readonly': True}, + 'part_number': {'readonly': True}, + 'unit_price': {'readonly': True}, + 'currency_code': {'readonly': True}, + 'offer_id': {'readonly': True}, + } + + _attribute_map = { + 'billing_period_id': {'key': 'billingPeriodId', 'type': 'str'}, + 'meter_id': {'key': 'meterId', 'type': 'str'}, + 'meter_details': {'key': 'meterDetails', 'type': 'MeterDetails'}, + 'unit_of_measure': {'key': 'unitOfMeasure', 'type': 'str'}, + 'included_quantity': {'key': 'includedQuantity', 'type': 'float'}, + 'part_number': {'key': 'partNumber', 'type': 'str'}, + 'unit_price': {'key': 'unitPrice', 'type': 'float'}, + 'currency_code': {'key': 'currencyCode', 'type': 'str'}, + 'offer_id': {'key': 'offerId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PriceSheetProperties, self).__init__(**kwargs) + self.billing_period_id = None + self.meter_id = None + self.meter_details = None + self.unit_of_measure = None + self.included_quantity = None + self.part_number = None + self.unit_price = None + self.currency_code = None + self.offer_id = None + + +class PriceSheetResult(Resource): + """An pricesheet resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: 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 + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'pricesheets': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'pricesheets': {'key': 'properties.pricesheets', 'type': '[PriceSheetProperties]'}, + 'next_link': {'key': 'properties.nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PriceSheetResult, self).__init__(**kwargs) + self.pricesheets = None + self.next_link = None + + +class ReservationDetail(Resource): + """reservation detail resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar reservation_order_id: The reservation order ID is the identifier for a reservation + purchase. Each reservation order ID represents a single purchase transaction. A reservation + order contains reservations. The reservation order specifies the VM size and region for the + reservations. + :vartype reservation_order_id: str + :ivar instance_flexibility_ratio: The instance Flexibility Ratio. + :vartype instance_flexibility_ratio: str + :ivar instance_flexibility_group: The instance Flexibility Group. + :vartype instance_flexibility_group: str + :ivar reservation_id: The reservation ID is the identifier of a reservation within a + reservation order. Each reservation is the grouping for applying the benefit scope and also + specifies the number of instances to which the reservation benefit can be applied to. + :vartype reservation_id: str + :ivar sku_name: This is the ARM Sku name. It can be used to join with the serviceType field in + additional info in usage records. + :vartype sku_name: str + :ivar reserved_hours: This is the total hours reserved for the day. E.g. if reservation for 1 + instance was made on 1 PM, this will be 11 hours for that day and 24 hours from subsequent + days. + :vartype reserved_hours: float + :ivar usage_date: The date on which consumption occurred. + :vartype usage_date: ~datetime.datetime + :ivar used_hours: This is the total hours used by the instance. + :vartype used_hours: float + :ivar instance_id: This identifier is the name of the resource or the fully qualified Resource + ID. + :vartype instance_id: str + :ivar total_reserved_quantity: This is the total count of instances that are reserved for the + reservationId. + :vartype total_reserved_quantity: float + :ivar kind: The reservation kind. + :vartype kind: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'reservation_order_id': {'readonly': True}, + 'instance_flexibility_ratio': {'readonly': True}, + 'instance_flexibility_group': {'readonly': True}, + 'reservation_id': {'readonly': True}, + 'sku_name': {'readonly': True}, + 'reserved_hours': {'readonly': True}, + 'usage_date': {'readonly': True}, + 'used_hours': {'readonly': True}, + 'instance_id': {'readonly': True}, + 'total_reserved_quantity': {'readonly': True}, + 'kind': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'reservation_order_id': {'key': 'properties.reservationOrderId', 'type': 'str'}, + 'instance_flexibility_ratio': {'key': 'properties.instanceFlexibilityRatio', 'type': 'str'}, + 'instance_flexibility_group': {'key': 'properties.instanceFlexibilityGroup', 'type': 'str'}, + 'reservation_id': {'key': 'properties.reservationId', 'type': 'str'}, + 'sku_name': {'key': 'properties.skuName', 'type': 'str'}, + 'reserved_hours': {'key': 'properties.reservedHours', 'type': 'float'}, + 'usage_date': {'key': 'properties.usageDate', 'type': 'iso-8601'}, + 'used_hours': {'key': 'properties.usedHours', 'type': 'float'}, + 'instance_id': {'key': 'properties.instanceId', 'type': 'str'}, + 'total_reserved_quantity': {'key': 'properties.totalReservedQuantity', 'type': 'float'}, + 'kind': {'key': 'properties.kind', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ReservationDetail, self).__init__(**kwargs) + self.reservation_order_id = None + self.instance_flexibility_ratio = None + self.instance_flexibility_group = None + self.reservation_id = None + self.sku_name = None + self.reserved_hours = None + self.usage_date = None + self.used_hours = None + self.instance_id = None + self.total_reserved_quantity = None + self.kind = None + + +class ReservationDetailsListResult(msrest.serialization.Model): + """Result of listing reservation details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of reservation details. + :vartype value: list[~azure.mgmt.consumption.models.ReservationDetail] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ReservationDetail]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ReservationDetailsListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class ReservationRecommendationDetailsCalculatedSavingsProperties(msrest.serialization.Model): + """Details of estimated savings. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar on_demand_cost: The cost without reservation. + :vartype on_demand_cost: float + :ivar overage_cost: The difference between total reservation cost and reservation cost. + :vartype overage_cost: float + :ivar quantity: The quantity for calculated savings. + :vartype quantity: float + :ivar reservation_cost: The exact cost of the estimated usage using reservation. + :vartype reservation_cost: float + :ivar total_reservation_cost: The cost of the suggested quantity. + :vartype total_reservation_cost: float + :ivar savings: The amount saved by purchasing the recommended quantity of reservation. + :vartype savings: float + """ + + _validation = { + 'on_demand_cost': {'readonly': True}, + 'overage_cost': {'readonly': True}, + 'quantity': {'readonly': True}, + 'reservation_cost': {'readonly': True}, + 'total_reservation_cost': {'readonly': True}, + 'savings': {'readonly': True}, + } + + _attribute_map = { + 'on_demand_cost': {'key': 'onDemandCost', 'type': 'float'}, + 'overage_cost': {'key': 'overageCost', 'type': 'float'}, + 'quantity': {'key': 'quantity', 'type': 'float'}, + 'reservation_cost': {'key': 'reservationCost', 'type': 'float'}, + 'total_reservation_cost': {'key': 'totalReservationCost', 'type': 'float'}, + 'savings': {'key': 'savings', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(ReservationRecommendationDetailsCalculatedSavingsProperties, self).__init__(**kwargs) + self.on_demand_cost = None + self.overage_cost = None + self.quantity = None + self.reservation_cost = None + self.total_reservation_cost = None + self.savings = None + + +class ReservationRecommendationDetailsModel(Resource): + """Reservation recommendation details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar currency: An ISO 4217 currency code identifier for the costs and savings. + :vartype currency: str + :ivar resource: Resource specific properties. + :vartype resource: + ~azure.mgmt.consumption.models.ReservationRecommendationDetailsResourceProperties + :ivar resource_group: Resource Group. + :vartype resource_group: str + :ivar savings: Savings information for the recommendation. + :vartype savings: + ~azure.mgmt.consumption.models.ReservationRecommendationDetailsSavingsProperties + :ivar scope: Scope of the reservation, ex: Single or Shared. + :vartype scope: str + :ivar usage: Historical usage details used to calculate the estimated savings. + :vartype usage: ~azure.mgmt.consumption.models.ReservationRecommendationDetailsUsageProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'currency': {'readonly': True}, + 'resource': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'savings': {'readonly': True}, + 'scope': {'readonly': True}, + 'usage': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'currency': {'key': 'properties.currency', 'type': 'str'}, + 'resource': {'key': 'properties.resource', 'type': 'ReservationRecommendationDetailsResourceProperties'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'savings': {'key': 'properties.savings', 'type': 'ReservationRecommendationDetailsSavingsProperties'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + 'usage': {'key': 'properties.usage', 'type': 'ReservationRecommendationDetailsUsageProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(ReservationRecommendationDetailsModel, self).__init__(**kwargs) + self.currency = None + self.resource = None + self.resource_group = None + self.savings = None + self.scope = None + self.usage = None + + +class ReservationRecommendationDetailsResourceProperties(msrest.serialization.Model): + """Details of the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar applied_scopes: List of subscriptions for which the reservation is applied. + :vartype applied_scopes: list[str] + :ivar on_demand_rate: On demand rate of the resource. + :vartype on_demand_rate: float + :ivar product: Azure product ex: Standard_E8s_v3 etc. + :vartype product: str + :ivar region: Azure resource region ex:EastUS, WestUS etc. + :vartype region: str + :ivar reservation_rate: Reservation rate of the resource. + :vartype reservation_rate: float + :ivar resource_type: The azure resource type. + :vartype resource_type: str + """ + + _validation = { + 'applied_scopes': {'readonly': True}, + 'on_demand_rate': {'readonly': True}, + 'product': {'readonly': True}, + 'region': {'readonly': True}, + 'reservation_rate': {'readonly': True}, + 'resource_type': {'readonly': True}, + } + + _attribute_map = { + 'applied_scopes': {'key': 'appliedScopes', 'type': '[str]'}, + 'on_demand_rate': {'key': 'onDemandRate', 'type': 'float'}, + 'product': {'key': 'product', 'type': 'str'}, + 'region': {'key': 'region', 'type': 'str'}, + 'reservation_rate': {'key': 'reservationRate', 'type': 'float'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ReservationRecommendationDetailsResourceProperties, self).__init__(**kwargs) + self.applied_scopes = None + self.on_demand_rate = None + self.product = None + self.region = None + self.reservation_rate = None + self.resource_type = None + + +class ReservationRecommendationDetailsSavingsProperties(msrest.serialization.Model): + """Details of the estimated savings. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param calculated_savings: List of calculated savings. + :type calculated_savings: + list[~azure.mgmt.consumption.models.ReservationRecommendationDetailsCalculatedSavingsProperties] + :ivar look_back_period: Number of days of usage to look back used for computing the + recommendation. + :vartype look_back_period: int + :ivar recommended_quantity: Number of recommended units of the resource. + :vartype recommended_quantity: float + :ivar reservation_order_term: Term period of the reservation, ex: P1Y or P3Y. + :vartype reservation_order_term: str + :ivar savings_type: Type of savings, ex: instance. + :vartype savings_type: str + :ivar unit_of_measure: Measurement unit ex: hour etc. + :vartype unit_of_measure: str + """ + + _validation = { + 'look_back_period': {'readonly': True}, + 'recommended_quantity': {'readonly': True}, + 'reservation_order_term': {'readonly': True}, + 'savings_type': {'readonly': True}, + 'unit_of_measure': {'readonly': True}, + } + + _attribute_map = { + 'calculated_savings': {'key': 'calculatedSavings', 'type': '[ReservationRecommendationDetailsCalculatedSavingsProperties]'}, + 'look_back_period': {'key': 'lookBackPeriod', 'type': 'int'}, + 'recommended_quantity': {'key': 'recommendedQuantity', 'type': 'float'}, + 'reservation_order_term': {'key': 'reservationOrderTerm', 'type': 'str'}, + 'savings_type': {'key': 'savingsType', 'type': 'str'}, + 'unit_of_measure': {'key': 'unitOfMeasure', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ReservationRecommendationDetailsSavingsProperties, self).__init__(**kwargs) + self.calculated_savings = kwargs.get('calculated_savings', None) + self.look_back_period = None + self.recommended_quantity = None + self.reservation_order_term = None + self.savings_type = None + self.unit_of_measure = None + + +class ReservationRecommendationDetailsUsageProperties(msrest.serialization.Model): + """Details about historical usage data that has been used for computing the recommendation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar first_consumption_date: The first usage date used for looking back for computing the + recommendation. + :vartype first_consumption_date: str + :ivar last_consumption_date: The last usage date used for looking back for computing the + recommendation. + :vartype last_consumption_date: str + :ivar look_back_unit_type: What the usage data values represent ex: virtual machine instance. + :vartype look_back_unit_type: str + :ivar usage_data: The breakdown of historical resource usage. The values are in the order of + usage between the firstConsumptionDate and the lastConsumptionDate. + :vartype usage_data: list[float] + :ivar usage_grain: The grain of the values represented in the usage data ex: hourly. + :vartype usage_grain: str + """ + + _validation = { + 'first_consumption_date': {'readonly': True}, + 'last_consumption_date': {'readonly': True}, + 'look_back_unit_type': {'readonly': True}, + 'usage_data': {'readonly': True}, + 'usage_grain': {'readonly': True}, + } + + _attribute_map = { + 'first_consumption_date': {'key': 'firstConsumptionDate', 'type': 'str'}, + 'last_consumption_date': {'key': 'lastConsumptionDate', 'type': 'str'}, + 'look_back_unit_type': {'key': 'lookBackUnitType', 'type': 'str'}, + 'usage_data': {'key': 'usageData', 'type': '[float]'}, + 'usage_grain': {'key': 'usageGrain', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ReservationRecommendationDetailsUsageProperties, self).__init__(**kwargs) + self.first_consumption_date = None + self.last_consumption_date = None + self.look_back_unit_type = None + self.usage_data = None + self.usage_grain = None + + +class ReservationRecommendationsListResult(msrest.serialization.Model): + """Result of listing reservation recommendations. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of reservation recommendations. + :vartype value: list[~azure.mgmt.consumption.models.ReservationRecommendation] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ReservationRecommendation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ReservationRecommendationsListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class ReservationSummariesListResult(msrest.serialization.Model): + """Result of listing reservation summaries. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of reservation summaries. + :vartype value: list[~azure.mgmt.consumption.models.ReservationSummary] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ReservationSummary]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ReservationSummariesListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class ReservationSummary(Resource): + """reservation summary resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar reservation_order_id: The reservation order ID is the identifier for a reservation + purchase. Each reservation order ID represents a single purchase transaction. A reservation + order contains reservations. The reservation order specifies the VM size and region for the + reservations. + :vartype reservation_order_id: str + :ivar reservation_id: The reservation ID is the identifier of a reservation within a + reservation order. Each reservation is the grouping for applying the benefit scope and also + specifies the number of instances to which the reservation benefit can be applied to. + :vartype reservation_id: str + :ivar sku_name: This is the ARM Sku name. It can be used to join with the serviceType field in + additional info in usage records. + :vartype sku_name: str + :ivar reserved_hours: This is the total hours reserved. E.g. if reservation for 1 instance was + made on 1 PM, this will be 11 hours for that day and 24 hours from subsequent days. + :vartype reserved_hours: float + :ivar usage_date: Data corresponding to the utilization record. If the grain of data is + monthly, it will be first day of month. + :vartype usage_date: ~datetime.datetime + :ivar used_hours: Total used hours by the reservation. + :vartype used_hours: float + :ivar min_utilization_percentage: This is the minimum hourly utilization in the usage time (day + or month). E.g. if usage record corresponds to 12/10/2017 and on that for hour 4 and 5, + utilization was 10%, this field will return 10% for that day. + :vartype min_utilization_percentage: float + :ivar avg_utilization_percentage: This is average utilization for the entire time range. (day + or month depending on the grain). + :vartype avg_utilization_percentage: float + :ivar max_utilization_percentage: This is the maximum hourly utilization in the usage time (day + or month). E.g. if usage record corresponds to 12/10/2017 and on that for hour 4 and 5, + utilization was 100%, this field will return 100% for that day. + :vartype max_utilization_percentage: float + :ivar kind: The reservation kind. + :vartype kind: str + :ivar purchased_quantity: This is the purchased quantity for the reservationId. + :vartype purchased_quantity: float + :ivar remaining_quantity: This is the remaining quantity for the reservationId. + :vartype remaining_quantity: float + :ivar total_reserved_quantity: This is the total count of instances that are reserved for the + reservationId. + :vartype total_reserved_quantity: float + :ivar used_quantity: This is the used quantity for the reservationId. + :vartype used_quantity: float + :ivar utilized_percentage: This is the utilized percentage for the reservation Id. + :vartype utilized_percentage: float + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'reservation_order_id': {'readonly': True}, + 'reservation_id': {'readonly': True}, + 'sku_name': {'readonly': True}, + 'reserved_hours': {'readonly': True}, + 'usage_date': {'readonly': True}, + 'used_hours': {'readonly': True}, + 'min_utilization_percentage': {'readonly': True}, + 'avg_utilization_percentage': {'readonly': True}, + 'max_utilization_percentage': {'readonly': True}, + 'kind': {'readonly': True}, + 'purchased_quantity': {'readonly': True}, + 'remaining_quantity': {'readonly': True}, + 'total_reserved_quantity': {'readonly': True}, + 'used_quantity': {'readonly': True}, + 'utilized_percentage': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'reservation_order_id': {'key': 'properties.reservationOrderId', 'type': 'str'}, + 'reservation_id': {'key': 'properties.reservationId', 'type': 'str'}, + 'sku_name': {'key': 'properties.skuName', 'type': 'str'}, + 'reserved_hours': {'key': 'properties.reservedHours', 'type': 'float'}, + 'usage_date': {'key': 'properties.usageDate', 'type': 'iso-8601'}, + 'used_hours': {'key': 'properties.usedHours', 'type': 'float'}, + 'min_utilization_percentage': {'key': 'properties.minUtilizationPercentage', 'type': 'float'}, + 'avg_utilization_percentage': {'key': 'properties.avgUtilizationPercentage', 'type': 'float'}, + 'max_utilization_percentage': {'key': 'properties.maxUtilizationPercentage', 'type': 'float'}, + 'kind': {'key': 'properties.kind', 'type': 'str'}, + 'purchased_quantity': {'key': 'properties.purchasedQuantity', 'type': 'float'}, + 'remaining_quantity': {'key': 'properties.remainingQuantity', 'type': 'float'}, + 'total_reserved_quantity': {'key': 'properties.totalReservedQuantity', 'type': 'float'}, + 'used_quantity': {'key': 'properties.usedQuantity', 'type': 'float'}, + 'utilized_percentage': {'key': 'properties.utilizedPercentage', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(ReservationSummary, self).__init__(**kwargs) + self.reservation_order_id = None + self.reservation_id = None + self.sku_name = None + self.reserved_hours = None + self.usage_date = None + self.used_hours = None + self.min_utilization_percentage = None + self.avg_utilization_percentage = None + self.max_utilization_percentage = None + self.kind = None + self.purchased_quantity = None + self.remaining_quantity = None + self.total_reserved_quantity = None + self.used_quantity = None + self.utilized_percentage = None + + +class ReservationTransactionsListResult(msrest.serialization.Model): + """Result of listing reservation recommendations. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of reservation recommendations. + :vartype value: list[~azure.mgmt.consumption.models.ReservationTransaction] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ReservationTransaction]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ReservationTransactionsListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class SkuProperty(msrest.serialization.Model): + """The Sku property. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The name of sku property. + :vartype name: str + :ivar value: The value of sku property. + :vartype value: str + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuProperty, self).__init__(**kwargs) + self.name = None + self.value = None + + +class Tag(msrest.serialization.Model): + """The tag resource. + + :param key: Tag key. + :type key: str + """ + + _attribute_map = { + 'key': {'key': 'key', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Tag, self).__init__(**kwargs) + self.key = kwargs.get('key', None) + + +class TagsResult(ProxyResource): + """A resource listing all tags. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param e_tag: eTag of the resource. To handle concurrent update scenario, this field will be + used to determine whether the user is updating the latest version or not. + :type e_tag: str + :param tags: A set of tags. A list of Tag. + :type tags: list[~azure.mgmt.consumption.models.Tag] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'tags': {'key': 'properties.tags', 'type': '[Tag]'}, + } + + def __init__( + self, + **kwargs + ): + super(TagsResult, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class UsageDetailsListResult(msrest.serialization.Model): + """Result of listing usage details. It contains a list of available usage details in reverse chronological order by billing period. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of usage details. + :vartype value: list[~azure.mgmt.consumption.models.UsageDetail] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[UsageDetail]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UsageDetailsListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None 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 new file mode 100644 index 000000000000..538e12dfb7e8 --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/_models_py3.py @@ -0,0 +1,4247 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +import datetime +from typing import Dict, List, Optional, Union + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + +from ._consumption_management_client_enums import * + + +class Amount(msrest.serialization.Model): + """The amount plus currency . + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar currency: Amount currency. + :vartype currency: str + :ivar value: Amount. + :vartype value: float + """ + + _validation = { + 'currency': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'currency': {'key': 'currency', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(Amount, self).__init__(**kwargs) + self.currency = None + self.value = 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. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.tags = None + + +class Balance(Resource): + """A balance resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar currency: The ISO currency in which the meter is charged, for example, USD. + :vartype currency: str + :ivar beginning_balance: The beginning balance for the billing period. + :vartype beginning_balance: float + :ivar ending_balance: The ending balance for the billing period (for open periods this will be + updated daily). + :vartype ending_balance: float + :ivar new_purchases: Total new purchase amount. + :vartype new_purchases: float + :ivar adjustments: Total adjustment amount. + :vartype adjustments: float + :ivar utilized: Total Commitment usage. + :vartype utilized: float + :ivar service_overage: Overage for Azure services. + :vartype service_overage: float + :ivar charges_billed_separately: Charges Billed separately. + :vartype charges_billed_separately: float + :ivar total_overage: serviceOverage + chargesBilledSeparately. + :vartype total_overage: float + :ivar total_usage: Azure service commitment + total Overage. + :vartype total_usage: float + :ivar azure_marketplace_service_charges: Total charges for Azure Marketplace. + :vartype azure_marketplace_service_charges: float + :param billing_frequency: The billing frequency. Possible values include: "Month", "Quarter", + "Year". + :type billing_frequency: str or ~azure.mgmt.consumption.models.BillingFrequency + :ivar price_hidden: Price is hidden or not. + :vartype price_hidden: bool + :ivar new_purchases_details: List of new purchases. + :vartype new_purchases_details: + list[~azure.mgmt.consumption.models.BalancePropertiesNewPurchasesDetailsItem] + :ivar adjustment_details: List of Adjustments (Promo credit, SIE credit etc.). + :vartype adjustment_details: + list[~azure.mgmt.consumption.models.BalancePropertiesAdjustmentDetailsItem] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'currency': {'readonly': True}, + 'beginning_balance': {'readonly': True}, + 'ending_balance': {'readonly': True}, + 'new_purchases': {'readonly': True}, + 'adjustments': {'readonly': True}, + 'utilized': {'readonly': True}, + 'service_overage': {'readonly': True}, + 'charges_billed_separately': {'readonly': True}, + 'total_overage': {'readonly': True}, + 'total_usage': {'readonly': True}, + 'azure_marketplace_service_charges': {'readonly': True}, + 'price_hidden': {'readonly': True}, + 'new_purchases_details': {'readonly': True}, + 'adjustment_details': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'currency': {'key': 'properties.currency', 'type': 'str'}, + 'beginning_balance': {'key': 'properties.beginningBalance', 'type': 'float'}, + 'ending_balance': {'key': 'properties.endingBalance', 'type': 'float'}, + 'new_purchases': {'key': 'properties.newPurchases', 'type': 'float'}, + 'adjustments': {'key': 'properties.adjustments', 'type': 'float'}, + 'utilized': {'key': 'properties.utilized', 'type': 'float'}, + 'service_overage': {'key': 'properties.serviceOverage', 'type': 'float'}, + 'charges_billed_separately': {'key': 'properties.chargesBilledSeparately', 'type': 'float'}, + 'total_overage': {'key': 'properties.totalOverage', 'type': 'float'}, + 'total_usage': {'key': 'properties.totalUsage', 'type': 'float'}, + 'azure_marketplace_service_charges': {'key': 'properties.azureMarketplaceServiceCharges', 'type': 'float'}, + 'billing_frequency': {'key': 'properties.billingFrequency', 'type': 'str'}, + 'price_hidden': {'key': 'properties.priceHidden', 'type': 'bool'}, + 'new_purchases_details': {'key': 'properties.newPurchasesDetails', 'type': '[BalancePropertiesNewPurchasesDetailsItem]'}, + 'adjustment_details': {'key': 'properties.adjustmentDetails', 'type': '[BalancePropertiesAdjustmentDetailsItem]'}, + } + + def __init__( + self, + *, + billing_frequency: Optional[Union[str, "BillingFrequency"]] = None, + **kwargs + ): + super(Balance, self).__init__(**kwargs) + self.currency = None + self.beginning_balance = None + self.ending_balance = None + self.new_purchases = None + self.adjustments = None + self.utilized = None + self.service_overage = None + self.charges_billed_separately = None + self.total_overage = None + self.total_usage = None + self.azure_marketplace_service_charges = None + self.billing_frequency = billing_frequency + self.price_hidden = None + self.new_purchases_details = None + self.adjustment_details = None + + +class BalancePropertiesAdjustmentDetailsItem(msrest.serialization.Model): + """BalancePropertiesAdjustmentDetailsItem. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: the name of new adjustment. + :vartype name: str + :ivar value: the value of new adjustment. + :vartype value: float + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(BalancePropertiesAdjustmentDetailsItem, self).__init__(**kwargs) + self.name = None + self.value = None + + +class BalancePropertiesNewPurchasesDetailsItem(msrest.serialization.Model): + """BalancePropertiesNewPurchasesDetailsItem. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: the name of new purchase. + :vartype name: str + :ivar value: the value of new purchase. + :vartype value: float + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(BalancePropertiesNewPurchasesDetailsItem, self).__init__(**kwargs) + self.name = None + self.value = None + + +class ProxyResource(msrest.serialization.Model): + """The Resource model definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param e_tag: eTag of the resource. To handle concurrent update scenario, this field will be + used to determine whether the user is updating the latest version or not. + :type e_tag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + } + + def __init__( + self, + *, + e_tag: Optional[str] = None, + **kwargs + ): + super(ProxyResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.e_tag = e_tag + + +class Budget(ProxyResource): + """A budget resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param e_tag: eTag of the resource. To handle concurrent update scenario, this field will be + used to determine whether the user is updating the latest version or not. + :type e_tag: str + :param category: The category of the budget, whether the budget tracks cost or usage. Possible + values include: "Cost". + :type category: str or ~azure.mgmt.consumption.models.CategoryType + :param amount: The total amount of cost to track with the budget. + :type amount: float + :param time_grain: The time covered by a budget. Tracking of the amount will be reset based on + the time grain. BillingMonth, BillingQuarter, and BillingAnnual are only supported by WD + customers. Possible values include: "Monthly", "Quarterly", "Annually", "BillingMonth", + "BillingQuarter", "BillingAnnual". + :type time_grain: str or ~azure.mgmt.consumption.models.TimeGrainType + :param time_period: Has start and end date of the budget. The start date must be first of the + month and should be less than the end date. Budget start date must be on or after June 1, 2017. + 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. + :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] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'current_spend': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'category': {'key': 'properties.category', 'type': 'str'}, + 'amount': {'key': 'properties.amount', 'type': 'float'}, + 'time_grain': {'key': 'properties.timeGrain', 'type': 'str'}, + 'time_period': {'key': 'properties.timePeriod', 'type': 'BudgetTimePeriod'}, + 'filter': {'key': 'properties.filter', 'type': 'BudgetFilter'}, + 'current_spend': {'key': 'properties.currentSpend', 'type': 'CurrentSpend'}, + 'notifications': {'key': 'properties.notifications', 'type': '{Notification}'}, + } + + def __init__( + self, + *, + e_tag: Optional[str] = None, + category: Optional[Union[str, "CategoryType"]] = None, + amount: Optional[float] = None, + time_grain: Optional[Union[str, "TimeGrainType"]] = None, + time_period: Optional["BudgetTimePeriod"] = None, + filter: Optional["BudgetFilter"] = None, + notifications: Optional[Dict[str, "Notification"]] = None, + **kwargs + ): + super(Budget, self).__init__(e_tag=e_tag, **kwargs) + self.category = category + self.amount = amount + self.time_grain = time_grain + self.time_period = time_period + self.filter = filter + self.current_spend = None + self.notifications = notifications + + +class BudgetComparisonExpression(msrest.serialization.Model): + """The comparison expression to be used in the budgets. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the column to use in comparison. + :type name: str + :param operator: Required. The operator to use for comparison. Possible values include: "In". + :type operator: str or ~azure.mgmt.consumption.models.BudgetOperatorType + :param values: Required. Array of values to use for comparison. + :type values: list[str] + """ + + _validation = { + 'name': {'required': True}, + 'operator': {'required': True}, + 'values': {'required': True, 'min_items': 1}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + } + + def __init__( + self, + *, + name: str, + operator: Union[str, "BudgetOperatorType"], + values: List[str], + **kwargs + ): + super(BudgetComparisonExpression, self).__init__(**kwargs) + self.name = name + self.operator = operator + self.values = values + + +class BudgetFilter(msrest.serialization.Model): + """May be used to filter budgets by resource group, resource, or meter. + + :param and_property: The logical "AND" expression. Must have at least 2 items. + :type and_property: list[~azure.mgmt.consumption.models.BudgetFilterProperties] + :param not_property: The logical "NOT" expression. + :type not_property: ~azure.mgmt.consumption.models.BudgetFilterProperties + :param dimensions: Has comparison expression for a dimension. + :type dimensions: ~azure.mgmt.consumption.models.BudgetComparisonExpression + :param tags: A set of tags. Has comparison expression for a tag. + :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'}, + 'dimensions': {'key': 'dimensions', 'type': 'BudgetComparisonExpression'}, + 'tags': {'key': 'tags', 'type': 'BudgetComparisonExpression'}, + } + + def __init__( + self, + *, + and_property: Optional[List["BudgetFilterProperties"]] = None, + not_property: Optional["BudgetFilterProperties"] = None, + dimensions: Optional["BudgetComparisonExpression"] = None, + tags: Optional["BudgetComparisonExpression"] = None, + **kwargs + ): + super(BudgetFilter, self).__init__(**kwargs) + self.and_property = and_property + self.not_property = not_property + self.dimensions = dimensions + self.tags = tags + + +class BudgetFilterProperties(msrest.serialization.Model): + """The Dimensions or Tags to filter a budget by. + + :param dimensions: Has comparison expression for a dimension. + :type dimensions: ~azure.mgmt.consumption.models.BudgetComparisonExpression + :param tags: A set of tags. Has comparison expression for a tag. + :type tags: ~azure.mgmt.consumption.models.BudgetComparisonExpression + """ + + _attribute_map = { + 'dimensions': {'key': 'dimensions', 'type': 'BudgetComparisonExpression'}, + 'tags': {'key': 'tags', 'type': 'BudgetComparisonExpression'}, + } + + def __init__( + self, + *, + dimensions: Optional["BudgetComparisonExpression"] = None, + tags: Optional["BudgetComparisonExpression"] = None, + **kwargs + ): + super(BudgetFilterProperties, self).__init__(**kwargs) + self.dimensions = dimensions + self.tags = tags + + +class BudgetsListResult(msrest.serialization.Model): + """Result of listing budgets. It contains a list of available budgets in the scope provided. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of budgets. + :vartype value: list[~azure.mgmt.consumption.models.Budget] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Budget]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BudgetsListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class BudgetTimePeriod(msrest.serialization.Model): + """The start and end date for a budget. + + All required parameters must be populated in order to send to Azure. + + :param start_date: Required. The start date for the budget. + :type start_date: ~datetime.datetime + :param end_date: The end date for the budget. If not provided, we default this to 10 years from + the start date. + :type end_date: ~datetime.datetime + """ + + _validation = { + 'start_date': {'required': True}, + } + + _attribute_map = { + 'start_date': {'key': 'startDate', 'type': 'iso-8601'}, + 'end_date': {'key': 'endDate', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + start_date: datetime.datetime, + end_date: Optional[datetime.datetime] = None, + **kwargs + ): + super(BudgetTimePeriod, self).__init__(**kwargs) + self.start_date = start_date + self.end_date = end_date + + +class ChargesListResult(msrest.serialization.Model): + """Result of listing charge summary. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of charge summary. + :vartype value: list[~azure.mgmt.consumption.models.ChargeSummary] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ChargeSummary]'}, + } + + def __init__( + self, + **kwargs + ): + super(ChargesListResult, self).__init__(**kwargs) + self.value = None + + +class ChargeSummary(Resource): + """A charge summary resource. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: LegacyChargeSummary, ModernChargeSummary. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :param kind: Required. Specifies the kind of charge summary.Constant filled by server. + Possible values include: "legacy", "modern". + :type kind: str or ~azure.mgmt.consumption.models.ChargeSummaryKind + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'legacy': 'LegacyChargeSummary', 'modern': 'ModernChargeSummary'} + } + + def __init__( + self, + **kwargs + ): + super(ChargeSummary, self).__init__(**kwargs) + self.kind = 'ChargeSummary' # type: str + + +class CreditBalanceSummary(msrest.serialization.Model): + """Summary of credit balances. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar estimated_balance: Estimated balance. + :vartype estimated_balance: ~azure.mgmt.consumption.models.Amount + :ivar current_balance: Current balance. + :vartype current_balance: ~azure.mgmt.consumption.models.Amount + """ + + _validation = { + 'estimated_balance': {'readonly': True}, + 'current_balance': {'readonly': True}, + } + + _attribute_map = { + 'estimated_balance': {'key': 'estimatedBalance', 'type': 'Amount'}, + 'current_balance': {'key': 'currentBalance', 'type': 'Amount'}, + } + + def __init__( + self, + **kwargs + ): + super(CreditBalanceSummary, self).__init__(**kwargs) + self.estimated_balance = None + self.current_balance = None + + +class CreditSummary(Resource): + """A credit summary resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar balance_summary: Summary of balances associated with this credit summary. + :vartype balance_summary: ~azure.mgmt.consumption.models.CreditBalanceSummary + :ivar pending_credit_adjustments: Pending credit adjustments. + :vartype pending_credit_adjustments: ~azure.mgmt.consumption.models.Amount + :ivar expired_credit: Expired credit. + :vartype expired_credit: ~azure.mgmt.consumption.models.Amount + :ivar pending_eligible_charges: Pending eligible charges. + :vartype pending_eligible_charges: ~azure.mgmt.consumption.models.Amount + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'balance_summary': {'readonly': True}, + 'pending_credit_adjustments': {'readonly': True}, + 'expired_credit': {'readonly': True}, + 'pending_eligible_charges': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', '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'}, + } + + def __init__( + self, + **kwargs + ): + super(CreditSummary, self).__init__(**kwargs) + self.balance_summary = None + self.pending_credit_adjustments = None + self.expired_credit = None + self.pending_eligible_charges = None + + +class CurrentSpend(msrest.serialization.Model): + """The current amount of 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 total amount of cost which is being tracked by the budget. + :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(CurrentSpend, self).__init__(**kwargs) + self.amount = None + self.unit = None + + +class ErrorDetails(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(ErrorDetails, self).__init__(**kwargs) + self.code = None + self.message = None + + +class ErrorResponse(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.ErrorDetails + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetails'}, + } + + def __init__( + self, + *, + error: Optional["ErrorDetails"] = None, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class Events(msrest.serialization.Model): + """Result of listing event summary. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of event summary. + :vartype value: list[~azure.mgmt.consumption.models.EventSummary] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EventSummary]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Events, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class EventSummary(Resource): + """An event summary resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar transaction_date: Transaction date. + :vartype transaction_date: ~datetime.datetime + :ivar description: Transaction description. + :vartype description: str + :ivar new_credit: New Credit. + :vartype new_credit: ~azure.mgmt.consumption.models.Amount + :ivar adjustments: Adjustments amount. + :vartype adjustments: ~azure.mgmt.consumption.models.Amount + :ivar credit_expired: Credit expired. + :vartype credit_expired: ~azure.mgmt.consumption.models.Amount + :ivar charges: Charges amount. + :vartype charges: ~azure.mgmt.consumption.models.Amount + :ivar closed_balance: Closed balance. + :vartype closed_balance: ~azure.mgmt.consumption.models.Amount + :param event_type: The type of 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. + :vartype invoice_number: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'transaction_date': {'readonly': True}, + 'description': {'readonly': True}, + 'new_credit': {'readonly': True}, + 'adjustments': {'readonly': True}, + 'credit_expired': {'readonly': True}, + 'charges': {'readonly': True}, + 'closed_balance': {'readonly': True}, + 'invoice_number': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'transaction_date': {'key': 'properties.transactionDate', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'new_credit': {'key': 'properties.newCredit', 'type': 'Amount'}, + 'adjustments': {'key': 'properties.adjustments', 'type': 'Amount'}, + 'credit_expired': {'key': 'properties.creditExpired', 'type': 'Amount'}, + 'charges': {'key': 'properties.charges', 'type': 'Amount'}, + 'closed_balance': {'key': 'properties.closedBalance', 'type': 'Amount'}, + 'event_type': {'key': 'properties.eventType', 'type': 'str'}, + 'invoice_number': {'key': 'properties.invoiceNumber', 'type': 'str'}, + } + + def __init__( + self, + *, + event_type: Optional[Union[str, "EventType"]] = None, + **kwargs + ): + super(EventSummary, self).__init__(**kwargs) + self.transaction_date = None + self.description = None + self.new_credit = None + self.adjustments = None + self.credit_expired = None + self.charges = None + self.closed_balance = None + self.event_type = event_type + self.invoice_number = None + + +class Forecast(Resource): + """A forecast resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: 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". + :type grain: str or ~azure.mgmt.consumption.models.Grain + :ivar charge: The amount of charge. + :vartype charge: float + :ivar currency: The ISO currency in which the meter is charged, for example, USD. + :vartype currency: str + :param charge_type: The type of the charge. Could be actual or forecast. Possible values + include: "Actual", "Forecast". + :type charge_type: str or ~azure.mgmt.consumption.models.ChargeType + :ivar confidence_levels: The details about the forecast confidence levels. This is populated + only when chargeType is Forecast. + :vartype confidence_levels: + list[~azure.mgmt.consumption.models.ForecastPropertiesConfidenceLevelsItem] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'usage_date': {'readonly': True}, + 'charge': {'readonly': True}, + 'currency': {'readonly': True}, + 'confidence_levels': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'usage_date': {'key': 'properties.usageDate', 'type': 'str'}, + 'grain': {'key': 'properties.grain', 'type': 'str'}, + 'charge': {'key': 'properties.charge', 'type': 'float'}, + 'currency': {'key': 'properties.currency', 'type': 'str'}, + 'charge_type': {'key': 'properties.chargeType', 'type': 'str'}, + 'confidence_levels': {'key': 'properties.confidenceLevels', 'type': '[ForecastPropertiesConfidenceLevelsItem]'}, + } + + def __init__( + self, + *, + grain: Optional[Union[str, "Grain"]] = None, + charge_type: Optional[Union[str, "ChargeType"]] = None, + **kwargs + ): + super(Forecast, self).__init__(**kwargs) + self.usage_date = None + self.grain = grain + self.charge = None + self.currency = None + self.charge_type = charge_type + self.confidence_levels = None + + +class ForecastPropertiesConfidenceLevelsItem(msrest.serialization.Model): + """ForecastPropertiesConfidenceLevelsItem. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar percentage: The percentage level of the confidence. + :vartype percentage: float + :param bound: The boundary of the percentage, values could be 'Upper' or 'Lower'. Possible + values include: "Upper", "Lower". + :type bound: str or ~azure.mgmt.consumption.models.Bound + :ivar value: The amount of forecast within the percentage level. + :vartype value: float + """ + + _validation = { + 'percentage': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'percentage': {'key': 'percentage', 'type': 'float'}, + 'bound': {'key': 'bound', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'float'}, + } + + def __init__( + self, + *, + bound: Optional[Union[str, "Bound"]] = None, + **kwargs + ): + super(ForecastPropertiesConfidenceLevelsItem, self).__init__(**kwargs) + self.percentage = None + self.bound = bound + self.value = None + + +class ForecastsListResult(msrest.serialization.Model): + """Result of listing forecasts. It contains a list of available forecasts. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of forecasts. + :vartype value: list[~azure.mgmt.consumption.models.Forecast] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Forecast]'}, + } + + def __init__( + self, + **kwargs + ): + super(ForecastsListResult, self).__init__(**kwargs) + self.value = None + + +class LegacyChargeSummary(ChargeSummary): + """Legacy charge summary. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :param kind: Required. Specifies the kind of charge summary.Constant filled by server. + Possible values include: "legacy", "modern". + :type kind: str or ~azure.mgmt.consumption.models.ChargeSummaryKind + :ivar billing_period_id: The id of the billing period resource that the charge belongs to. + :vartype billing_period_id: str + :ivar usage_start: Usage start date. + :vartype usage_start: str + :ivar usage_end: Usage end date. + :vartype usage_end: str + :ivar azure_charges: Azure Charges. + :vartype azure_charges: float + :ivar charges_billed_separately: Charges Billed separately. + :vartype charges_billed_separately: float + :ivar marketplace_charges: Marketplace Charges. + :vartype marketplace_charges: float + :ivar currency: Currency Code. + :vartype currency: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'kind': {'required': True}, + 'billing_period_id': {'readonly': True}, + 'usage_start': {'readonly': True}, + 'usage_end': {'readonly': True}, + 'azure_charges': {'readonly': True}, + 'charges_billed_separately': {'readonly': True}, + 'marketplace_charges': {'readonly': True}, + 'currency': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'billing_period_id': {'key': 'properties.billingPeriodId', 'type': 'str'}, + 'usage_start': {'key': 'properties.usageStart', 'type': 'str'}, + 'usage_end': {'key': 'properties.usageEnd', 'type': 'str'}, + 'azure_charges': {'key': 'properties.azureCharges', 'type': 'float'}, + 'charges_billed_separately': {'key': 'properties.chargesBilledSeparately', 'type': 'float'}, + 'marketplace_charges': {'key': 'properties.marketplaceCharges', 'type': 'float'}, + 'currency': {'key': 'properties.currency', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LegacyChargeSummary, self).__init__(**kwargs) + self.kind = 'legacy' # type: str + self.billing_period_id = None + self.usage_start = None + self.usage_end = None + self.azure_charges = None + self.charges_billed_separately = None + self.marketplace_charges = None + self.currency = None + + +class ResourceAttributes(msrest.serialization.Model): + """The Resource model definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar location: Resource location. + :vartype location: str + :ivar sku: Resource sku. + :vartype sku: str + """ + + _validation = { + 'location': {'readonly': True}, + 'sku': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceAttributes, self).__init__(**kwargs) + self.location = None + self.sku = None + + +class ReservationRecommendation(Resource, ResourceAttributes): + """A reservation recommendation resource. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: LegacyReservationRecommendation, ModernReservationRecommendation. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar location: Resource location. + :vartype location: str + :ivar sku: Resource sku. + :vartype sku: str + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: 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 + """ + + _validation = { + 'location': {'readonly': True}, + 'sku': {'readonly': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'legacy': 'LegacyReservationRecommendation', 'modern': 'ModernReservationRecommendation'} + } + + def __init__( + self, + **kwargs + ): + super(ReservationRecommendation, self).__init__(**kwargs) + self.location = None + self.sku = None + self.kind = 'ReservationRecommendation' # type: str + self.id = None + self.name = None + self.type = None + self.tags = None + self.kind = 'ReservationRecommendation' # type: str + + +class LegacyReservationRecommendation(ReservationRecommendation): + """Legacy reservation recommendation. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar location: Resource location. + :vartype location: str + :ivar sku: Resource sku. + :vartype sku: str + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: 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 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 + :ivar instance_flexibility_group: The instance Flexibility Group. + :vartype instance_flexibility_group: str + :ivar normalized_size: The normalized Size. + :vartype normalized_size: str + :ivar recommended_quantity_normalized: The recommended Quantity Normalized. + :vartype recommended_quantity_normalized: float + :ivar meter_id: The meter id (GUID). + :vartype meter_id: 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. + :vartype cost_with_no_reserved_instances: float + :ivar recommended_quantity: Recommended quality for reserved instances. + :vartype recommended_quantity: float + :ivar total_cost_with_reserved_instances: The total amount of cost with reserved instances. + :vartype total_cost_with_reserved_instances: float + :ivar net_savings: Total estimated savings with reserved instances. + :vartype net_savings: float + :ivar first_usage_date: The usage date for looking back. + :vartype first_usage_date: ~datetime.datetime + :ivar scope: Shared or single recommendation. + :vartype scope: str + :ivar sku_properties: List of sku properties. + :vartype sku_properties: list[~azure.mgmt.consumption.models.SkuProperty] + """ + + _validation = { + 'location': {'readonly': True}, + 'sku': {'readonly': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'kind': {'required': True}, + 'look_back_period': {'readonly': True}, + 'instance_flexibility_ratio': {'readonly': True}, + 'instance_flexibility_group': {'readonly': True}, + 'normalized_size': {'readonly': True}, + 'recommended_quantity_normalized': {'readonly': True}, + 'meter_id': {'readonly': True}, + 'term': {'readonly': True}, + 'cost_with_no_reserved_instances': {'readonly': True}, + 'recommended_quantity': {'readonly': True}, + 'total_cost_with_reserved_instances': {'readonly': True}, + 'net_savings': {'readonly': True}, + 'first_usage_date': {'readonly': True}, + 'scope': {'readonly': True}, + 'sku_properties': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', '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_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'}, + 'term': {'key': 'properties.term', 'type': 'str'}, + 'cost_with_no_reserved_instances': {'key': 'properties.costWithNoReservedInstances', 'type': 'float'}, + 'recommended_quantity': {'key': 'properties.recommendedQuantity', 'type': 'float'}, + 'total_cost_with_reserved_instances': {'key': 'properties.totalCostWithReservedInstances', 'type': 'float'}, + 'net_savings': {'key': 'properties.netSavings', 'type': 'float'}, + 'first_usage_date': {'key': 'properties.firstUsageDate', 'type': 'iso-8601'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + 'sku_properties': {'key': 'properties.skuProperties', 'type': '[SkuProperty]'}, + } + + def __init__( + self, + **kwargs + ): + super(LegacyReservationRecommendation, self).__init__(**kwargs) + self.kind = 'legacy' # type: str + self.look_back_period = None + self.instance_flexibility_ratio = None + self.instance_flexibility_group = None + self.normalized_size = None + self.recommended_quantity_normalized = None + self.meter_id = None + self.term = None + self.cost_with_no_reserved_instances = None + self.recommended_quantity = None + self.total_cost_with_reserved_instances = None + self.net_savings = None + self.first_usage_date = None + self.scope = None + self.sku_properties = None + + +class ReservationTransaction(Resource): + """Reservation transaction resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar event_date: The date of the transaction. + :vartype event_date: ~datetime.datetime + :ivar reservation_order_id: The reservation order ID is the identifier for a reservation + purchase. Each reservation order ID represents a single purchase transaction. A reservation + order contains reservations. The reservation order specifies the VM size and region for the + reservations. + :vartype reservation_order_id: str + :ivar description: The description of the transaction. + :vartype description: str + :ivar event_type: The type of the transaction (Purchase, Cancel, etc.). + :vartype event_type: str + :ivar quantity: The quantity of the transaction. + :vartype quantity: float + :ivar amount: The charge of the transaction. + :vartype amount: float + :ivar currency: The ISO currency in which the transaction is charged, for example, USD. + :vartype currency: str + :ivar reservation_order_name: The name of the reservation order. + :vartype reservation_order_name: str + :ivar purchasing_enrollment: The purchasing enrollment. + :vartype purchasing_enrollment: str + :ivar purchasing_subscription_guid: The subscription guid that makes the transaction. + :vartype purchasing_subscription_guid: str + :ivar purchasing_subscription_name: The subscription name that makes the transaction. + :vartype purchasing_subscription_name: str + :ivar arm_sku_name: This is the ARM Sku name. It can be used to join with the serviceType field + in additional info in usage records. + :vartype arm_sku_name: str + :ivar term: This is the term of the transaction. + :vartype term: str + :ivar region: The region of the transaction. + :vartype region: str + :ivar account_name: The name of the account that makes the transaction. + :vartype account_name: str + :ivar account_owner_email: The email of the account owner that makes the transaction. + :vartype account_owner_email: str + :ivar department_name: The department name. + :vartype department_name: str + :ivar cost_center: The cost center of this department if it is a department and a cost center + is provided. + :vartype cost_center: str + :ivar current_enrollment: The current enrollment. + :vartype current_enrollment: str + :ivar billing_frequency: The billing frequency, which can be either one-time or recurring. + :vartype billing_frequency: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'event_date': {'readonly': True}, + 'reservation_order_id': {'readonly': True}, + 'description': {'readonly': True}, + 'event_type': {'readonly': True}, + 'quantity': {'readonly': True}, + 'amount': {'readonly': True}, + 'currency': {'readonly': True}, + 'reservation_order_name': {'readonly': True}, + 'purchasing_enrollment': {'readonly': True}, + 'purchasing_subscription_guid': {'readonly': True}, + 'purchasing_subscription_name': {'readonly': True}, + 'arm_sku_name': {'readonly': True}, + 'term': {'readonly': True}, + 'region': {'readonly': True}, + 'account_name': {'readonly': True}, + 'account_owner_email': {'readonly': True}, + 'department_name': {'readonly': True}, + 'cost_center': {'readonly': True}, + 'current_enrollment': {'readonly': True}, + 'billing_frequency': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'event_date': {'key': 'properties.eventDate', 'type': 'iso-8601'}, + 'reservation_order_id': {'key': 'properties.reservationOrderId', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'event_type': {'key': 'properties.eventType', 'type': 'str'}, + 'quantity': {'key': 'properties.quantity', 'type': 'float'}, + 'amount': {'key': 'properties.amount', 'type': 'float'}, + 'currency': {'key': 'properties.currency', 'type': 'str'}, + 'reservation_order_name': {'key': 'properties.reservationOrderName', 'type': 'str'}, + 'purchasing_enrollment': {'key': 'properties.purchasingEnrollment', 'type': 'str'}, + 'purchasing_subscription_guid': {'key': 'properties.purchasingSubscriptionGuid', 'type': 'str'}, + 'purchasing_subscription_name': {'key': 'properties.purchasingSubscriptionName', 'type': 'str'}, + 'arm_sku_name': {'key': 'properties.armSkuName', 'type': 'str'}, + 'term': {'key': 'properties.term', 'type': 'str'}, + 'region': {'key': 'properties.region', 'type': 'str'}, + 'account_name': {'key': 'properties.accountName', 'type': 'str'}, + 'account_owner_email': {'key': 'properties.accountOwnerEmail', 'type': 'str'}, + 'department_name': {'key': 'properties.departmentName', 'type': 'str'}, + 'cost_center': {'key': 'properties.costCenter', 'type': 'str'}, + 'current_enrollment': {'key': 'properties.currentEnrollment', 'type': 'str'}, + 'billing_frequency': {'key': 'properties.billingFrequency', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ReservationTransaction, self).__init__(**kwargs) + self.event_date = None + self.reservation_order_id = None + self.description = None + self.event_type = None + self.quantity = None + self.amount = None + self.currency = None + self.reservation_order_name = None + self.purchasing_enrollment = None + self.purchasing_subscription_guid = None + self.purchasing_subscription_name = None + self.arm_sku_name = None + self.term = None + self.region = None + self.account_name = None + self.account_owner_email = None + self.department_name = None + self.cost_center = None + self.current_enrollment = None + self.billing_frequency = None + + +class LegacyReservationTransaction(ReservationTransaction): + """Legacy Reservation transaction resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar event_date: The date of the transaction. + :vartype event_date: ~datetime.datetime + :ivar reservation_order_id: The reservation order ID is the identifier for a reservation + purchase. Each reservation order ID represents a single purchase transaction. A reservation + order contains reservations. The reservation order specifies the VM size and region for the + reservations. + :vartype reservation_order_id: str + :ivar description: The description of the transaction. + :vartype description: str + :ivar event_type: The type of the transaction (Purchase, Cancel, etc.). + :vartype event_type: str + :ivar quantity: The quantity of the transaction. + :vartype quantity: float + :ivar amount: The charge of the transaction. + :vartype amount: float + :ivar currency: The ISO currency in which the transaction is charged, for example, USD. + :vartype currency: str + :ivar reservation_order_name: The name of the reservation order. + :vartype reservation_order_name: str + :ivar purchasing_enrollment: The purchasing enrollment. + :vartype purchasing_enrollment: str + :ivar purchasing_subscription_guid: The subscription guid that makes the transaction. + :vartype purchasing_subscription_guid: str + :ivar purchasing_subscription_name: The subscription name that makes the transaction. + :vartype purchasing_subscription_name: str + :ivar arm_sku_name: This is the ARM Sku name. It can be used to join with the serviceType field + in additional info in usage records. + :vartype arm_sku_name: str + :ivar term: This is the term of the transaction. + :vartype term: str + :ivar region: The region of the transaction. + :vartype region: str + :ivar account_name: The name of the account that makes the transaction. + :vartype account_name: str + :ivar account_owner_email: The email of the account owner that makes the transaction. + :vartype account_owner_email: str + :ivar department_name: The department name. + :vartype department_name: str + :ivar cost_center: The cost center of this department if it is a department and a cost center + is provided. + :vartype cost_center: str + :ivar current_enrollment: The current enrollment. + :vartype current_enrollment: str + :ivar billing_frequency: The billing frequency, which can be either one-time or recurring. + :vartype billing_frequency: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'event_date': {'readonly': True}, + 'reservation_order_id': {'readonly': True}, + 'description': {'readonly': True}, + 'event_type': {'readonly': True}, + 'quantity': {'readonly': True}, + 'amount': {'readonly': True}, + 'currency': {'readonly': True}, + 'reservation_order_name': {'readonly': True}, + 'purchasing_enrollment': {'readonly': True}, + 'purchasing_subscription_guid': {'readonly': True}, + 'purchasing_subscription_name': {'readonly': True}, + 'arm_sku_name': {'readonly': True}, + 'term': {'readonly': True}, + 'region': {'readonly': True}, + 'account_name': {'readonly': True}, + 'account_owner_email': {'readonly': True}, + 'department_name': {'readonly': True}, + 'cost_center': {'readonly': True}, + 'current_enrollment': {'readonly': True}, + 'billing_frequency': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'event_date': {'key': 'properties.eventDate', 'type': 'iso-8601'}, + 'reservation_order_id': {'key': 'properties.reservationOrderId', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'event_type': {'key': 'properties.eventType', 'type': 'str'}, + 'quantity': {'key': 'properties.quantity', 'type': 'float'}, + 'amount': {'key': 'properties.amount', 'type': 'float'}, + 'currency': {'key': 'properties.currency', 'type': 'str'}, + 'reservation_order_name': {'key': 'properties.reservationOrderName', 'type': 'str'}, + 'purchasing_enrollment': {'key': 'properties.purchasingEnrollment', 'type': 'str'}, + 'purchasing_subscription_guid': {'key': 'properties.purchasingSubscriptionGuid', 'type': 'str'}, + 'purchasing_subscription_name': {'key': 'properties.purchasingSubscriptionName', 'type': 'str'}, + 'arm_sku_name': {'key': 'properties.armSkuName', 'type': 'str'}, + 'term': {'key': 'properties.term', 'type': 'str'}, + 'region': {'key': 'properties.region', 'type': 'str'}, + 'account_name': {'key': 'properties.accountName', 'type': 'str'}, + 'account_owner_email': {'key': 'properties.accountOwnerEmail', 'type': 'str'}, + 'department_name': {'key': 'properties.departmentName', 'type': 'str'}, + 'cost_center': {'key': 'properties.costCenter', 'type': 'str'}, + 'current_enrollment': {'key': 'properties.currentEnrollment', 'type': 'str'}, + 'billing_frequency': {'key': 'properties.billingFrequency', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LegacyReservationTransaction, self).__init__(**kwargs) + + +class UsageDetail(Resource): + """An usage detail resource. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: LegacyUsageDetail, ModernUsageDetail. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :param kind: Required. Specifies the kind of usage details.Constant filled by server. Possible + values include: "legacy", "modern". + :type kind: str or ~azure.mgmt.consumption.models.UsageDetailsKind + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'legacy': 'LegacyUsageDetail', 'modern': 'ModernUsageDetail'} + } + + def __init__( + self, + **kwargs + ): + super(UsageDetail, self).__init__(**kwargs) + self.kind = 'UsageDetail' # type: str + + +class LegacyUsageDetail(UsageDetail): + """Legacy usage detail. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :param kind: Required. Specifies the kind of usage details.Constant filled by server. Possible + values include: "legacy", "modern". + :type kind: str or ~azure.mgmt.consumption.models.UsageDetailsKind + :ivar billing_account_id: Billing Account identifier. + :vartype billing_account_id: str + :ivar billing_account_name: Billing Account Name. + :vartype billing_account_name: str + :ivar billing_period_start_date: The billing period start date. + :vartype billing_period_start_date: ~datetime.datetime + :ivar billing_period_end_date: The billing period end date. + :vartype billing_period_end_date: ~datetime.datetime + :ivar billing_profile_id: Billing Profile identifier. + :vartype billing_profile_id: str + :ivar billing_profile_name: Billing Profile Name. + :vartype billing_profile_name: str + :ivar account_owner_id: Account Owner Id. + :vartype account_owner_id: str + :ivar account_name: Account Name. + :vartype account_name: str + :ivar subscription_id: Subscription guid. + :vartype subscription_id: str + :ivar subscription_name: Subscription name. + :vartype subscription_name: str + :ivar date: Date for the usage record. + :vartype date: ~datetime.datetime + :ivar product: Product name for the consumed service or purchase. Not available for + Marketplace. + :vartype product: str + :ivar part_number: Part Number of the service used. Can be used to join with the price sheet. + Not available for marketplace. + :vartype part_number: str + :ivar meter_id: The meter id (GUID). Not available for marketplace. For reserved instance this + represents the primary meter for which the reservation was purchased. For the actual VM Size + for which the reservation is purchased see productOrderName. + :vartype meter_id: str + :ivar meter_details: The details about the meter. By default this is not populated, unless it's + specified in $expand. + :vartype meter_details: ~azure.mgmt.consumption.models.MeterDetailsResponse + :ivar quantity: The usage quantity. + :vartype quantity: float + :ivar effective_price: Effective Price that's charged for the usage. + :vartype effective_price: float + :ivar cost: The amount of cost before tax. + :vartype cost: float + :ivar unit_price: Unit Price is the price applicable to you. (your EA or other contract price). + :vartype unit_price: float + :ivar billing_currency: Billing Currency. + :vartype billing_currency: str + :ivar resource_location: Resource Location. + :vartype resource_location: str + :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. + :vartype resource_id: str + :ivar resource_name: Resource Name. + :vartype resource_name: str + :ivar service_info1: Service Info 1. + :vartype service_info1: str + :ivar service_info2: Service Info 2. + :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 + as the actual VM Size (ServiceType) or the ratio in which the reservation discount is applied. + :vartype additional_info: str + :ivar invoice_section: Invoice Section Name. + :vartype invoice_section: str + :ivar cost_center: The cost center of this department if it is a department and a cost center + is provided. + :vartype cost_center: str + :ivar resource_group: Resource Group Name. + :vartype resource_group: str + :ivar reservation_id: ARM resource id of the reservation. Only applies to records relevant to + reservations. + :vartype reservation_id: str + :ivar reservation_name: User provided display name of the reservation. Last known name for a + particular day is populated in the daily data. Only applies to records relevant to + reservations. + :vartype reservation_name: str + :ivar product_order_id: Product Order Id. For reservations this is the Reservation Order ID. + :vartype product_order_id: str + :ivar product_order_name: Product Order Name. For reservations this is the SKU that was + purchased. + :vartype product_order_name: str + :ivar offer_id: Offer Id. Ex: MS-AZR-0017P, MS-AZR-0148P. + :vartype offer_id: str + :ivar is_azure_credit_eligible: Is Azure Credit Eligible. + :vartype is_azure_credit_eligible: bool + :ivar term: Term (in months). 1 month for monthly recurring purchase. 12 months for a 1 year + reservation. 36 months for a 3 year reservation. + :vartype term: str + :ivar publisher_name: Publisher Name. + :vartype publisher_name: str + :ivar publisher_type: Publisher Type. + :vartype publisher_type: str + :ivar plan_name: Plan Name. + :vartype plan_name: str + :ivar charge_type: Indicates a charge represents credits, usage, a Marketplace purchase, a + reservation fee, or a refund. + :vartype charge_type: str + :ivar frequency: Indicates how frequently this charge will occur. OneTime for purchases which + only happen once, Monthly for fees which recur every month, and UsageBased for charges based on + how much a service is used. + :vartype frequency: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'kind': {'required': True}, + 'billing_account_id': {'readonly': True}, + 'billing_account_name': {'readonly': True}, + 'billing_period_start_date': {'readonly': True}, + 'billing_period_end_date': {'readonly': True}, + 'billing_profile_id': {'readonly': True}, + 'billing_profile_name': {'readonly': True}, + 'account_owner_id': {'readonly': True}, + 'account_name': {'readonly': True}, + 'subscription_id': {'readonly': True}, + 'subscription_name': {'readonly': True}, + 'date': {'readonly': True}, + 'product': {'readonly': True}, + 'part_number': {'readonly': True}, + 'meter_id': {'readonly': True}, + 'meter_details': {'readonly': True}, + 'quantity': {'readonly': True}, + 'effective_price': {'readonly': True}, + 'cost': {'readonly': True}, + 'unit_price': {'readonly': True}, + 'billing_currency': {'readonly': True}, + 'resource_location': {'readonly': True}, + 'consumed_service': {'readonly': True}, + 'resource_id': {'readonly': True}, + 'resource_name': {'readonly': True}, + 'service_info1': {'readonly': True}, + 'service_info2': {'readonly': True}, + 'additional_info': {'readonly': True}, + 'invoice_section': {'readonly': True}, + 'cost_center': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'reservation_id': {'readonly': True}, + 'reservation_name': {'readonly': True}, + 'product_order_id': {'readonly': True}, + 'product_order_name': {'readonly': True}, + 'offer_id': {'readonly': True}, + 'is_azure_credit_eligible': {'readonly': True}, + 'term': {'readonly': True}, + 'publisher_name': {'readonly': True}, + 'publisher_type': {'readonly': True}, + 'plan_name': {'readonly': True}, + 'charge_type': {'readonly': True}, + 'frequency': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'billing_account_id': {'key': 'properties.billingAccountId', 'type': 'str'}, + 'billing_account_name': {'key': 'properties.billingAccountName', 'type': 'str'}, + 'billing_period_start_date': {'key': 'properties.billingPeriodStartDate', 'type': 'iso-8601'}, + 'billing_period_end_date': {'key': 'properties.billingPeriodEndDate', 'type': 'iso-8601'}, + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'billing_profile_name': {'key': 'properties.billingProfileName', 'type': 'str'}, + 'account_owner_id': {'key': 'properties.accountOwnerId', 'type': 'str'}, + 'account_name': {'key': 'properties.accountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + 'subscription_name': {'key': 'properties.subscriptionName', 'type': 'str'}, + 'date': {'key': 'properties.date', 'type': 'iso-8601'}, + 'product': {'key': 'properties.product', 'type': 'str'}, + 'part_number': {'key': 'properties.partNumber', 'type': 'str'}, + 'meter_id': {'key': 'properties.meterId', 'type': 'str'}, + 'meter_details': {'key': 'properties.meterDetails', 'type': 'MeterDetailsResponse'}, + 'quantity': {'key': 'properties.quantity', 'type': 'float'}, + 'effective_price': {'key': 'properties.effectivePrice', 'type': 'float'}, + 'cost': {'key': 'properties.cost', 'type': 'float'}, + 'unit_price': {'key': 'properties.unitPrice', 'type': 'float'}, + 'billing_currency': {'key': 'properties.billingCurrency', 'type': 'str'}, + 'resource_location': {'key': 'properties.resourceLocation', 'type': 'str'}, + 'consumed_service': {'key': 'properties.consumedService', 'type': 'str'}, + 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, + 'resource_name': {'key': 'properties.resourceName', 'type': 'str'}, + 'service_info1': {'key': 'properties.serviceInfo1', 'type': 'str'}, + 'service_info2': {'key': 'properties.serviceInfo2', 'type': 'str'}, + 'additional_info': {'key': 'properties.additionalInfo', 'type': 'str'}, + 'invoice_section': {'key': 'properties.invoiceSection', 'type': 'str'}, + 'cost_center': {'key': 'properties.costCenter', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'reservation_id': {'key': 'properties.reservationId', 'type': 'str'}, + 'reservation_name': {'key': 'properties.reservationName', 'type': 'str'}, + 'product_order_id': {'key': 'properties.productOrderId', 'type': 'str'}, + 'product_order_name': {'key': 'properties.productOrderName', 'type': 'str'}, + 'offer_id': {'key': 'properties.offerId', 'type': 'str'}, + 'is_azure_credit_eligible': {'key': 'properties.isAzureCreditEligible', 'type': 'bool'}, + 'term': {'key': 'properties.term', 'type': 'str'}, + 'publisher_name': {'key': 'properties.publisherName', 'type': 'str'}, + 'publisher_type': {'key': 'properties.publisherType', 'type': 'str'}, + 'plan_name': {'key': 'properties.planName', 'type': 'str'}, + 'charge_type': {'key': 'properties.chargeType', 'type': 'str'}, + 'frequency': {'key': 'properties.frequency', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LegacyUsageDetail, self).__init__(**kwargs) + self.kind = 'legacy' # type: str + self.billing_account_id = None + self.billing_account_name = None + self.billing_period_start_date = None + self.billing_period_end_date = None + self.billing_profile_id = None + self.billing_profile_name = None + self.account_owner_id = None + self.account_name = None + self.subscription_id = None + self.subscription_name = None + self.date = None + self.product = None + self.part_number = None + self.meter_id = None + self.meter_details = None + self.quantity = None + self.effective_price = None + self.cost = None + self.unit_price = None + self.billing_currency = None + self.resource_location = None + self.consumed_service = None + self.resource_id = None + self.resource_name = None + self.service_info1 = None + self.service_info2 = None + self.additional_info = None + self.invoice_section = None + self.cost_center = None + self.resource_group = None + self.reservation_id = None + self.reservation_name = None + self.product_order_id = None + self.product_order_name = None + self.offer_id = None + self.is_azure_credit_eligible = None + self.term = None + self.publisher_name = None + self.publisher_type = None + self.plan_name = None + self.charge_type = None + self.frequency = None + + +class Lots(msrest.serialization.Model): + """Result of listing lot summary. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of lot summary. + :vartype value: list[~azure.mgmt.consumption.models.LotSummary] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[LotSummary]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Lots, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class LotSummary(Resource): + """A lot summary resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar original_amount: Original amount. + :vartype original_amount: ~azure.mgmt.consumption.models.Amount + :ivar closed_balance: Closed balance. + :vartype closed_balance: ~azure.mgmt.consumption.models.Amount + :ivar source: Lot source. Possible values include: "PurchasedCredit", "PromotionalCredit". + :vartype source: str or ~azure.mgmt.consumption.models.LotSource + :ivar start_date: Start date. + :vartype start_date: ~datetime.datetime + :ivar expiration_date: Expiration date. + :vartype expiration_date: ~datetime.datetime + :ivar po_number: PO number. + :vartype po_number: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'original_amount': {'readonly': True}, + 'closed_balance': {'readonly': True}, + 'source': {'readonly': True}, + 'start_date': {'readonly': True}, + 'expiration_date': {'readonly': True}, + 'po_number': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'original_amount': {'key': 'properties.originalAmount', 'type': 'Amount'}, + 'closed_balance': {'key': 'properties.closedBalance', 'type': 'Amount'}, + 'source': {'key': 'properties.source', 'type': 'str'}, + 'start_date': {'key': 'properties.startDate', 'type': 'iso-8601'}, + 'expiration_date': {'key': 'properties.expirationDate', 'type': 'iso-8601'}, + 'po_number': {'key': 'properties.poNumber', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LotSummary, self).__init__(**kwargs) + self.original_amount = None + self.closed_balance = None + self.source = None + self.start_date = None + self.expiration_date = None + self.po_number = None + + +class ManagementGroupAggregatedCostResult(Resource): + """A management group aggregated cost resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar billing_period_id: The id of the billing period resource that the aggregated cost belongs + to. + :vartype billing_period_id: str + :ivar usage_start: The start of the date time range covered by aggregated cost. + :vartype usage_start: ~datetime.datetime + :ivar usage_end: The end of the date time range covered by the aggregated cost. + :vartype usage_end: ~datetime.datetime + :ivar azure_charges: Azure Charges. + :vartype azure_charges: float + :ivar marketplace_charges: Marketplace Charges. + :vartype marketplace_charges: float + :ivar charges_billed_separately: Charges Billed Separately. + :vartype charges_billed_separately: float + :ivar currency: The ISO currency in which the meter is charged, for example, USD. + :vartype currency: str + :param children: Children of a management group. + :type children: list[~azure.mgmt.consumption.models.ManagementGroupAggregatedCostResult] + :param included_subscriptions: List of subscription Guids included in the calculation of + aggregated cost. + :type included_subscriptions: list[str] + :param excluded_subscriptions: List of subscription Guids excluded from the calculation of + aggregated cost. + :type excluded_subscriptions: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'billing_period_id': {'readonly': True}, + 'usage_start': {'readonly': True}, + 'usage_end': {'readonly': True}, + 'azure_charges': {'readonly': True}, + 'marketplace_charges': {'readonly': True}, + 'charges_billed_separately': {'readonly': True}, + 'currency': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'billing_period_id': {'key': 'properties.billingPeriodId', 'type': 'str'}, + 'usage_start': {'key': 'properties.usageStart', 'type': 'iso-8601'}, + 'usage_end': {'key': 'properties.usageEnd', 'type': 'iso-8601'}, + 'azure_charges': {'key': 'properties.azureCharges', 'type': 'float'}, + 'marketplace_charges': {'key': 'properties.marketplaceCharges', 'type': 'float'}, + 'charges_billed_separately': {'key': 'properties.chargesBilledSeparately', 'type': 'float'}, + 'currency': {'key': 'properties.currency', 'type': 'str'}, + 'children': {'key': 'properties.children', 'type': '[ManagementGroupAggregatedCostResult]'}, + 'included_subscriptions': {'key': 'properties.includedSubscriptions', 'type': '[str]'}, + 'excluded_subscriptions': {'key': 'properties.excludedSubscriptions', 'type': '[str]'}, + } + + def __init__( + self, + *, + children: Optional[List["ManagementGroupAggregatedCostResult"]] = None, + included_subscriptions: Optional[List[str]] = None, + excluded_subscriptions: Optional[List[str]] = None, + **kwargs + ): + super(ManagementGroupAggregatedCostResult, self).__init__(**kwargs) + self.billing_period_id = None + self.usage_start = None + self.usage_end = None + self.azure_charges = None + self.marketplace_charges = None + self.charges_billed_separately = None + self.currency = None + self.children = children + self.included_subscriptions = included_subscriptions + self.excluded_subscriptions = excluded_subscriptions + + +class Marketplace(Resource): + """An marketplace resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar billing_period_id: The id of the billing period resource that the usage belongs to. + :vartype billing_period_id: str + :ivar usage_start: The start of the date time range covered by the usage detail. + :vartype usage_start: ~datetime.datetime + :ivar usage_end: The end of the date time range covered by the usage detail. + :vartype usage_end: ~datetime.datetime + :ivar resource_rate: The marketplace resource rate. + :vartype resource_rate: float + :ivar offer_name: The type of offer. + :vartype offer_name: str + :ivar resource_group: The name of resource group. + :vartype resource_group: 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. + :vartype instance_name: str + :ivar instance_id: The uri of the resource instance that the usage is about. + :vartype instance_id: str + :ivar currency: The ISO currency in which the meter is charged, for example, USD. + :vartype currency: str + :ivar consumed_quantity: The quantity of usage. + :vartype consumed_quantity: float + :ivar unit_of_measure: The unit of measure. + :vartype unit_of_measure: str + :ivar pretax_cost: The amount of cost before tax. + :vartype pretax_cost: float + :ivar is_estimated: The estimated usage is subject to change. + :vartype is_estimated: bool + :ivar meter_id: The meter id (GUID). + :vartype meter_id: str + :ivar subscription_guid: Subscription guid. + :vartype subscription_guid: str + :ivar subscription_name: Subscription name. + :vartype subscription_name: str + :ivar account_name: Account name. + :vartype account_name: str + :ivar department_name: Department name. + :vartype department_name: str + :ivar consumed_service: Consumed service name. + :vartype consumed_service: str + :ivar cost_center: The cost center of this department if it is a department and a costcenter + exists. + :vartype cost_center: str + :ivar additional_properties: Additional details of this usage item. By default this is not + populated, unless it's specified in $expand. + :vartype additional_properties: str + :ivar publisher_name: The name of publisher. + :vartype publisher_name: str + :ivar plan_name: The name of plan. + :vartype plan_name: str + :ivar is_recurring_charge: Flag indicating whether this is a recurring charge or not. + :vartype is_recurring_charge: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'billing_period_id': {'readonly': True}, + 'usage_start': {'readonly': True}, + 'usage_end': {'readonly': True}, + 'resource_rate': {'readonly': True}, + 'offer_name': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'order_number': {'readonly': True}, + 'instance_name': {'readonly': True}, + 'instance_id': {'readonly': True}, + 'currency': {'readonly': True}, + 'consumed_quantity': {'readonly': True}, + 'unit_of_measure': {'readonly': True}, + 'pretax_cost': {'readonly': True}, + 'is_estimated': {'readonly': True}, + 'meter_id': {'readonly': True}, + 'subscription_guid': {'readonly': True}, + 'subscription_name': {'readonly': True}, + 'account_name': {'readonly': True}, + 'department_name': {'readonly': True}, + 'consumed_service': {'readonly': True}, + 'cost_center': {'readonly': True}, + 'additional_properties': {'readonly': True}, + 'publisher_name': {'readonly': True}, + 'plan_name': {'readonly': True}, + 'is_recurring_charge': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'billing_period_id': {'key': 'properties.billingPeriodId', 'type': 'str'}, + 'usage_start': {'key': 'properties.usageStart', 'type': 'iso-8601'}, + 'usage_end': {'key': 'properties.usageEnd', 'type': 'iso-8601'}, + 'resource_rate': {'key': 'properties.resourceRate', 'type': 'float'}, + 'offer_name': {'key': 'properties.offerName', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'order_number': {'key': 'properties.orderNumber', 'type': 'str'}, + 'instance_name': {'key': 'properties.instanceName', 'type': 'str'}, + 'instance_id': {'key': 'properties.instanceId', 'type': 'str'}, + 'currency': {'key': 'properties.currency', 'type': 'str'}, + 'consumed_quantity': {'key': 'properties.consumedQuantity', 'type': 'float'}, + 'unit_of_measure': {'key': 'properties.unitOfMeasure', 'type': 'str'}, + 'pretax_cost': {'key': 'properties.pretaxCost', 'type': 'float'}, + 'is_estimated': {'key': 'properties.isEstimated', 'type': 'bool'}, + 'meter_id': {'key': 'properties.meterId', 'type': 'str'}, + 'subscription_guid': {'key': 'properties.subscriptionGuid', 'type': 'str'}, + 'subscription_name': {'key': 'properties.subscriptionName', 'type': 'str'}, + 'account_name': {'key': 'properties.accountName', 'type': 'str'}, + 'department_name': {'key': 'properties.departmentName', 'type': 'str'}, + 'consumed_service': {'key': 'properties.consumedService', 'type': 'str'}, + 'cost_center': {'key': 'properties.costCenter', 'type': 'str'}, + 'additional_properties': {'key': 'properties.additionalProperties', 'type': 'str'}, + 'publisher_name': {'key': 'properties.publisherName', 'type': 'str'}, + 'plan_name': {'key': 'properties.planName', 'type': 'str'}, + 'is_recurring_charge': {'key': 'properties.isRecurringCharge', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(Marketplace, self).__init__(**kwargs) + self.billing_period_id = None + self.usage_start = None + self.usage_end = None + self.resource_rate = None + self.offer_name = None + self.resource_group = None + self.order_number = None + self.instance_name = None + self.instance_id = None + self.currency = None + self.consumed_quantity = None + self.unit_of_measure = None + self.pretax_cost = None + self.is_estimated = None + self.meter_id = None + self.subscription_guid = None + self.subscription_name = None + self.account_name = None + self.department_name = None + self.consumed_service = None + self.cost_center = None + self.additional_properties = None + self.publisher_name = None + self.plan_name = None + self.is_recurring_charge = None + + +class MarketplacesListResult(msrest.serialization.Model): + """Result of listing marketplaces. It contains a list of available marketplaces in reverse chronological order by billing period. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of marketplaces. + :vartype value: list[~azure.mgmt.consumption.models.Marketplace] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Marketplace]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MarketplacesListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class MeterDetails(msrest.serialization.Model): + """The properties of the meter detail. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar meter_name: The name of the meter, within the given meter category. + :vartype meter_name: str + :ivar meter_category: The category of the meter, for example, 'Cloud services', 'Networking', + etc.. + :vartype meter_category: str + :ivar meter_sub_category: The subcategory of the meter, for example, 'A6 Cloud services', + 'ExpressRoute (IXP)', etc.. + :vartype meter_sub_category: str + :ivar unit: The unit in which the meter consumption is charged, for example, 'Hours', 'GB', + etc. + :vartype unit: str + :ivar meter_location: The location in which the Azure service is available. + :vartype meter_location: str + :ivar total_included_quantity: The total included quantity associated with the offer. + :vartype total_included_quantity: float + :ivar pretax_standard_rate: The pretax listing price. + :vartype pretax_standard_rate: float + :ivar service_name: The name of the service. + :vartype service_name: str + :ivar service_tier: The service tier. + :vartype service_tier: str + """ + + _validation = { + 'meter_name': {'readonly': True}, + 'meter_category': {'readonly': True}, + 'meter_sub_category': {'readonly': True}, + 'unit': {'readonly': True}, + 'meter_location': {'readonly': True}, + 'total_included_quantity': {'readonly': True}, + 'pretax_standard_rate': {'readonly': True}, + 'service_name': {'readonly': True}, + 'service_tier': {'readonly': True}, + } + + _attribute_map = { + 'meter_name': {'key': 'meterName', 'type': 'str'}, + 'meter_category': {'key': 'meterCategory', 'type': 'str'}, + 'meter_sub_category': {'key': 'meterSubCategory', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'meter_location': {'key': 'meterLocation', 'type': 'str'}, + 'total_included_quantity': {'key': 'totalIncludedQuantity', 'type': 'float'}, + 'pretax_standard_rate': {'key': 'pretaxStandardRate', 'type': 'float'}, + 'service_name': {'key': 'serviceName', 'type': 'str'}, + 'service_tier': {'key': 'serviceTier', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MeterDetails, self).__init__(**kwargs) + self.meter_name = None + self.meter_category = None + self.meter_sub_category = None + self.unit = None + self.meter_location = None + self.total_included_quantity = None + self.pretax_standard_rate = None + self.service_name = None + self.service_tier = None + + +class MeterDetailsResponse(msrest.serialization.Model): + """The properties of the meter detail. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar meter_name: The name of the meter, within the given meter category. + :vartype meter_name: str + :ivar meter_category: The category of the meter, for example, 'Cloud services', 'Networking', + etc.. + :vartype meter_category: str + :ivar meter_sub_category: The subcategory of the meter, for example, 'A6 Cloud services', + 'ExpressRoute (IXP)', etc.. + :vartype meter_sub_category: str + :ivar unit_of_measure: The unit in which the meter consumption is charged, for example, + 'Hours', 'GB', etc. + :vartype unit_of_measure: str + :ivar service_family: The service family. + :vartype service_family: str + """ + + _validation = { + 'meter_name': {'readonly': True}, + 'meter_category': {'readonly': True}, + 'meter_sub_category': {'readonly': True}, + 'unit_of_measure': {'readonly': True}, + 'service_family': {'readonly': True}, + } + + _attribute_map = { + 'meter_name': {'key': 'meterName', 'type': 'str'}, + 'meter_category': {'key': 'meterCategory', 'type': 'str'}, + 'meter_sub_category': {'key': 'meterSubCategory', 'type': 'str'}, + 'unit_of_measure': {'key': 'unitOfMeasure', 'type': 'str'}, + 'service_family': {'key': 'serviceFamily', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MeterDetailsResponse, self).__init__(**kwargs) + self.meter_name = None + self.meter_category = None + self.meter_sub_category = None + self.unit_of_measure = None + self.service_family = None + + +class ModernChargeSummary(ChargeSummary): + """Modern charge summary. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :param kind: Required. Specifies the kind of charge summary.Constant filled by server. + Possible values include: "legacy", "modern". + :type kind: str or ~azure.mgmt.consumption.models.ChargeSummaryKind + :ivar billing_period_id: The id of the billing period resource that the charge belongs to. + :vartype billing_period_id: str + :ivar usage_start: Usage start date. + :vartype usage_start: str + :ivar usage_end: Usage end date. + :vartype usage_end: str + :ivar azure_charges: Azure Charges. + :vartype azure_charges: ~azure.mgmt.consumption.models.Amount + :ivar charges_billed_separately: Charges Billed separately. + :vartype charges_billed_separately: ~azure.mgmt.consumption.models.Amount + :ivar marketplace_charges: Marketplace Charges. + :vartype marketplace_charges: ~azure.mgmt.consumption.models.Amount + :ivar billing_account_id: Billing Account Id. + :vartype billing_account_id: str + :ivar billing_profile_id: Billing Profile Id. + :vartype billing_profile_id: str + :ivar invoice_section_id: Invoice Section Id. + :vartype invoice_section_id: str + :ivar customer_id: Customer Id. + :vartype customer_id: str + :ivar is_invoiced: Is charge Invoiced. + :vartype is_invoiced: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'kind': {'required': True}, + 'billing_period_id': {'readonly': True}, + 'usage_start': {'readonly': True}, + 'usage_end': {'readonly': True}, + 'azure_charges': {'readonly': True}, + 'charges_billed_separately': {'readonly': True}, + 'marketplace_charges': {'readonly': True}, + 'billing_account_id': {'readonly': True}, + 'billing_profile_id': {'readonly': True}, + 'invoice_section_id': {'readonly': True}, + 'customer_id': {'readonly': True}, + 'is_invoiced': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'billing_period_id': {'key': 'properties.billingPeriodId', 'type': 'str'}, + 'usage_start': {'key': 'properties.usageStart', 'type': 'str'}, + 'usage_end': {'key': 'properties.usageEnd', 'type': 'str'}, + 'azure_charges': {'key': 'properties.azureCharges', 'type': 'Amount'}, + 'charges_billed_separately': {'key': 'properties.chargesBilledSeparately', 'type': 'Amount'}, + 'marketplace_charges': {'key': 'properties.marketplaceCharges', 'type': 'Amount'}, + 'billing_account_id': {'key': 'properties.billingAccountId', 'type': 'str'}, + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'invoice_section_id': {'key': 'properties.invoiceSectionId', 'type': 'str'}, + 'customer_id': {'key': 'properties.customerId', 'type': 'str'}, + 'is_invoiced': {'key': 'properties.isInvoiced', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(ModernChargeSummary, self).__init__(**kwargs) + self.kind = 'modern' # type: str + self.billing_period_id = None + self.usage_start = None + self.usage_end = None + self.azure_charges = None + self.charges_billed_separately = None + self.marketplace_charges = None + self.billing_account_id = None + self.billing_profile_id = None + self.invoice_section_id = None + self.customer_id = None + self.is_invoiced = None + + +class ModernReservationRecommendation(ReservationRecommendation): + """Modern reservation recommendation. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar location: Resource location. + :vartype location: str + :ivar sku: Resource sku. + :vartype sku: str + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: 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 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 + :ivar instance_flexibility_group: The instance Flexibility Group. + :vartype instance_flexibility_group: str + :ivar normalized_size: The normalized Size. + :vartype normalized_size: str + :ivar recommended_quantity_normalized: The recommended Quantity Normalized. + :vartype recommended_quantity_normalized: float + :ivar meter_id: The meter id (GUID). + :vartype meter_id: 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. + :vartype cost_with_no_reserved_instances: ~azure.mgmt.consumption.models.Amount + :ivar recommended_quantity: Recommended quality for reserved instances. + :vartype recommended_quantity: float + :ivar total_cost_with_reserved_instances: The total amount of cost with reserved instances. + :vartype total_cost_with_reserved_instances: ~azure.mgmt.consumption.models.Amount + :ivar net_savings: Total estimated savings with reserved instances. + :vartype net_savings: ~azure.mgmt.consumption.models.Amount + :ivar first_usage_date: The usage date for looking back. + :vartype first_usage_date: ~datetime.datetime + :ivar scope: Shared or single recommendation. + :vartype scope: str + :ivar sku_properties: List of sku properties. + :vartype sku_properties: list[~azure.mgmt.consumption.models.SkuProperty] + """ + + _validation = { + 'location': {'readonly': True}, + 'sku': {'readonly': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'kind': {'required': True}, + 'look_back_period': {'readonly': True}, + 'instance_flexibility_ratio': {'readonly': True}, + 'instance_flexibility_group': {'readonly': True}, + 'normalized_size': {'readonly': True}, + 'recommended_quantity_normalized': {'readonly': True}, + 'meter_id': {'readonly': True}, + 'term': {'readonly': True}, + 'cost_with_no_reserved_instances': {'readonly': True}, + 'recommended_quantity': {'readonly': True}, + 'total_cost_with_reserved_instances': {'readonly': True}, + 'net_savings': {'readonly': True}, + 'first_usage_date': {'readonly': True}, + 'scope': {'readonly': True}, + 'sku_properties': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', '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_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'}, + 'term': {'key': 'properties.term', 'type': 'str'}, + 'cost_with_no_reserved_instances': {'key': 'properties.costWithNoReservedInstances', 'type': 'Amount'}, + 'recommended_quantity': {'key': 'properties.recommendedQuantity', 'type': 'float'}, + 'total_cost_with_reserved_instances': {'key': 'properties.totalCostWithReservedInstances', 'type': 'Amount'}, + 'net_savings': {'key': 'properties.netSavings', 'type': 'Amount'}, + 'first_usage_date': {'key': 'properties.firstUsageDate', 'type': 'iso-8601'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + 'sku_properties': {'key': 'properties.skuProperties', 'type': '[SkuProperty]'}, + } + + def __init__( + self, + **kwargs + ): + super(ModernReservationRecommendation, self).__init__(**kwargs) + self.kind = 'modern' # type: str + self.look_back_period = None + self.instance_flexibility_ratio = None + self.instance_flexibility_group = None + self.normalized_size = None + self.recommended_quantity_normalized = None + self.meter_id = None + self.term = None + self.cost_with_no_reserved_instances = None + self.recommended_quantity = None + self.total_cost_with_reserved_instances = None + self.net_savings = None + self.first_usage_date = None + self.scope = None + self.sku_properties = None + + +class ModernReservationTransaction(Resource): + """Modern Reservation transaction resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar amount: The charge of the transaction. + :vartype amount: float + :ivar arm_sku_name: This is the ARM Sku name. It can be used to join with the serviceType field + in additional info in usage records. + :vartype arm_sku_name: str + :ivar billing_frequency: The billing frequency, which can be either one-time or recurring. + :vartype billing_frequency: str + :ivar billing_profile_id: Billing profile Id. + :vartype billing_profile_id: str + :ivar billing_profile_name: Billing profile name. + :vartype billing_profile_name: str + :ivar currency: The ISO currency in which the transaction is charged, for example, USD. + :vartype currency: str + :ivar description: The description of the transaction. + :vartype description: str + :ivar event_date: The date of the transaction. + :vartype event_date: ~datetime.datetime + :ivar event_type: The type of the transaction (Purchase, Cancel, etc.). + :vartype event_type: str + :ivar invoice: Invoice Number. + :vartype invoice: str + :ivar invoice_id: Invoice Id as on the invoice where the specific transaction appears. + :vartype invoice_id: str + :ivar invoice_section_id: Invoice Section Id. + :vartype invoice_section_id: str + :ivar invoice_section_name: Invoice Section Name. + :vartype invoice_section_name: str + :ivar purchasing_subscription_guid: The subscription guid that makes the transaction. + :vartype purchasing_subscription_guid: str + :ivar purchasing_subscription_name: The subscription name that makes the transaction. + :vartype purchasing_subscription_name: str + :ivar quantity: The quantity of the transaction. + :vartype quantity: float + :ivar region: The region of the transaction. + :vartype region: str + :ivar reservation_order_id: The reservation order ID is the identifier for a reservation + purchase. Each reservation order ID represents a single purchase transaction. A reservation + order contains reservations. The reservation order specifies the VM size and region for the + reservations. + :vartype reservation_order_id: str + :ivar reservation_order_name: The name of the reservation order. + :vartype reservation_order_name: str + :ivar term: This is the term of the transaction. + :vartype term: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'amount': {'readonly': True}, + 'arm_sku_name': {'readonly': True}, + 'billing_frequency': {'readonly': True}, + 'billing_profile_id': {'readonly': True}, + 'billing_profile_name': {'readonly': True}, + 'currency': {'readonly': True}, + 'description': {'readonly': True}, + 'event_date': {'readonly': True}, + 'event_type': {'readonly': True}, + 'invoice': {'readonly': True}, + 'invoice_id': {'readonly': True}, + 'invoice_section_id': {'readonly': True}, + 'invoice_section_name': {'readonly': True}, + 'purchasing_subscription_guid': {'readonly': True}, + 'purchasing_subscription_name': {'readonly': True}, + 'quantity': {'readonly': True}, + 'region': {'readonly': True}, + 'reservation_order_id': {'readonly': True}, + 'reservation_order_name': {'readonly': True}, + 'term': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'amount': {'key': 'properties.amount', 'type': 'float'}, + 'arm_sku_name': {'key': 'properties.armSkuName', 'type': 'str'}, + 'billing_frequency': {'key': 'properties.billingFrequency', 'type': 'str'}, + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'billing_profile_name': {'key': 'properties.billingProfileName', 'type': 'str'}, + 'currency': {'key': 'properties.currency', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'event_date': {'key': 'properties.eventDate', 'type': 'iso-8601'}, + 'event_type': {'key': 'properties.eventType', 'type': 'str'}, + 'invoice': {'key': 'properties.invoice', 'type': 'str'}, + 'invoice_id': {'key': 'properties.invoiceId', 'type': 'str'}, + 'invoice_section_id': {'key': 'properties.invoiceSectionId', 'type': 'str'}, + 'invoice_section_name': {'key': 'properties.invoiceSectionName', 'type': 'str'}, + 'purchasing_subscription_guid': {'key': 'properties.purchasingSubscriptionGuid', 'type': 'str'}, + 'purchasing_subscription_name': {'key': 'properties.purchasingSubscriptionName', 'type': 'str'}, + 'quantity': {'key': 'properties.quantity', 'type': 'float'}, + 'region': {'key': 'properties.region', 'type': 'str'}, + 'reservation_order_id': {'key': 'properties.reservationOrderId', 'type': 'str'}, + 'reservation_order_name': {'key': 'properties.reservationOrderName', 'type': 'str'}, + 'term': {'key': 'properties.term', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ModernReservationTransaction, self).__init__(**kwargs) + self.amount = None + self.arm_sku_name = None + self.billing_frequency = None + self.billing_profile_id = None + self.billing_profile_name = None + self.currency = None + self.description = None + self.event_date = None + self.event_type = None + self.invoice = None + self.invoice_id = None + self.invoice_section_id = None + self.invoice_section_name = None + self.purchasing_subscription_guid = None + self.purchasing_subscription_name = None + self.quantity = None + self.region = None + self.reservation_order_id = None + self.reservation_order_name = None + self.term = None + + +class ModernReservationTransactionsListResult(msrest.serialization.Model): + """Result of listing reservation recommendations. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of reservation recommendations. + :vartype value: list[~azure.mgmt.consumption.models.ModernReservationTransaction] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ModernReservationTransaction]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ModernReservationTransactionsListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class ModernUsageDetail(UsageDetail): + """Modern usage detail. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :param kind: Required. Specifies the kind of usage details.Constant filled by server. Possible + values include: "legacy", "modern". + :type kind: str or ~azure.mgmt.consumption.models.UsageDetailsKind + :ivar billing_account_id: Billing Account identifier. + :vartype billing_account_id: str + :ivar billing_account_name: Name of the Billing Account. + :vartype billing_account_name: str + :ivar billing_period_start_date: Billing Period Start Date as in the invoice. + :vartype billing_period_start_date: ~datetime.datetime + :ivar billing_period_end_date: Billing Period End Date as in the invoice. + :vartype billing_period_end_date: ~datetime.datetime + :ivar billing_profile_id: Identifier for the billing profile that groups costs across invoices + in the a singular billing currency across across the customers who have onboarded the Microsoft + customer agreement and the customers in CSP who have made entitlement purchases like SaaS, + Marketplace, RI, etc. + :vartype billing_profile_id: str + :ivar billing_profile_name: Name of the billing profile that groups costs across invoices in + the a singular billing currency across across the customers who have onboarded the Microsoft + customer agreement and the customers in CSP who have made entitlement purchases like SaaS, + Marketplace, RI, etc. + :vartype billing_profile_name: str + :ivar subscription_guid: Unique Microsoft generated identifier for the Azure Subscription. + :vartype subscription_guid: str + :ivar subscription_name: Name of the Azure Subscription. + :vartype subscription_name: str + :ivar date: Date for the usage record. + :vartype date: ~datetime.datetime + :ivar product: Name of the product that has accrued charges by consumption or purchase as + listed in the invoice. Not available for Marketplace. + :vartype product: str + :ivar meter_id: The meter id (GUID). Not available for marketplace. For reserved instance this + represents the primary meter for which the reservation was purchased. For the actual VM Size + for which the reservation is purchased see productOrderName. + :vartype meter_id: str + :ivar meter_name: Identifies the name of the meter against which consumption is measured. + :vartype meter_name: str + :ivar meter_region: Identifies the location of the datacenter for certain services that are + priced based on datacenter location. + :vartype meter_region: str + :ivar meter_category: Identifies the top-level service for the usage. + :vartype meter_category: str + :ivar meter_sub_category: Defines the type or sub-category of Azure service that can affect the + rate. + :vartype meter_sub_category: str + :ivar service_family: List the service family for the product purchased or charged (Example: + Storage ; Compute). + :vartype service_family: str + :ivar quantity: Measure the quantity purchased or consumed.The amount of the meter used during + the billing period. + :vartype quantity: float + :ivar unit_of_measure: Identifies the Unit that the service is charged in. For example, GB, + hours, 10,000 s. + :vartype unit_of_measure: str + :ivar instance_name: Instance Name. + :vartype instance_name: str + :ivar cost_in_usd: Estimated extendedCost or blended cost before tax in USD. + :vartype cost_in_usd: float + :ivar unit_price: Unit Price is the price applicable to you. (your EA or other contract price). + :vartype unit_price: float + :ivar billing_currency_code: The currency defining the billed cost. + :vartype billing_currency_code: str + :ivar resource_location: Name of the resource location. + :vartype resource_location: str + :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. + :vartype service_info1: str + :ivar service_info2: Service Info 2. + :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 + reservation discount is applied. + :vartype additional_info: str + :ivar invoice_section_id: Identifier of the project that is being charged in the invoice. Not + applicable for Microsoft Customer Agreements onboarded by partners. + :vartype invoice_section_id: str + :ivar invoice_section_name: Name of the project that is being charged in the invoice. Not + applicable for Microsoft Customer Agreements onboarded by partners. + :vartype invoice_section_name: str + :ivar cost_center: The cost center of this department if it is a department and a cost center + is provided. + :vartype cost_center: str + :ivar resource_group: Name of the Azure resource group used for cohesive lifecycle management + of resources. + :vartype resource_group: str + :ivar reservation_id: ARM resource id of the reservation. Only applies to records relevant to + reservations. + :vartype reservation_id: str + :ivar reservation_name: User provided display name of the reservation. Last known name for a + particular day is populated in the daily data. Only applies to records relevant to + reservations. + :vartype reservation_name: str + :ivar product_order_id: The identifier for the asset or Azure plan name that the subscription + belongs to. For example: Azure Plan. For reservations this is the Reservation Order ID. + :vartype product_order_id: str + :ivar product_order_name: Product Order Name. For reservations this is the SKU that was + purchased. + :vartype product_order_name: str + :ivar is_azure_credit_eligible: Determines if the cost is eligible to be paid for using Azure + credits. + :vartype is_azure_credit_eligible: bool + :ivar term: Term (in months). Displays the term for the validity of the offer. For example. In + case of reserved instances it displays 12 months for yearly term of reserved instance. For one + time purchases or recurring purchases, the terms displays 1 month; This is not applicable for + Azure consumption. + :vartype term: str + :ivar publisher_name: Name of the publisher of the service including Microsoft or Third Party + publishers. + :vartype publisher_name: str + :ivar publisher_type: Type of publisher that identifies if the publisher is first party, third + party reseller or third party agency. + :vartype publisher_type: str + :ivar charge_type: Indicates a charge represents credits, usage, a Marketplace purchase, a + reservation fee, or a refund. + :vartype charge_type: str + :ivar frequency: Indicates how frequently this charge will occur. OneTime for purchases which + only happen once, Monthly for fees which recur every month, and UsageBased for charges based on + how much a service is used. + :vartype frequency: str + :ivar cost_in_billing_currency: ExtendedCost or blended cost before tax in billed currency. + :vartype cost_in_billing_currency: float + :ivar cost_in_pricing_currency: ExtendedCost or blended cost before tax in pricing currency to + correlate with prices. + :vartype cost_in_pricing_currency: float + :ivar exchange_rate: Exchange rate used in conversion from pricing currency to billing + currency. + :vartype exchange_rate: str + :ivar exchange_rate_date: Date on which exchange rate used in conversion from pricing currency + to billing currency. + :vartype exchange_rate_date: ~datetime.datetime + :ivar invoice_id: Invoice ID as on the invoice where the specific transaction appears. + :vartype invoice_id: str + :ivar previous_invoice_id: Reference to an original invoice there is a refund (negative cost). + This is populated only when there is a refund. + :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. + :vartype product_identifier: str + :ivar resource_location_normalized: Resource Location Normalized. + :vartype resource_location_normalized: str + :ivar service_period_start_date: Start date for the rating period when the service usage was + rated for charges. The prices for Azure services are determined for the rating period. + :vartype service_period_start_date: ~datetime.datetime + :ivar service_period_end_date: End date for the period when the service usage was rated for + charges. The prices for Azure services are determined based on the rating period. + :vartype service_period_end_date: ~datetime.datetime + :ivar customer_tenant_id: Identifier of the customer's AAD tenant. + :vartype customer_tenant_id: str + :ivar customer_name: Name of the customer's AAD tenant. + :vartype customer_name: str + :ivar partner_tenant_id: Identifier for the partner's AAD tenant. + :vartype partner_tenant_id: str + :ivar partner_name: Name of the partner' AAD tenant. + :vartype partner_name: str + :ivar reseller_mpn_id: MPNId for the reseller associated with the subscription. + :vartype reseller_mpn_id: str + :ivar reseller_name: Reseller Name. + :vartype reseller_name: str + :ivar publisher_id: Publisher Id. + :vartype publisher_id: str + :ivar market_price: Market Price that's charged for the usage. + :vartype market_price: float + :ivar exchange_rate_pricing_to_billing: Exchange Rate from pricing currency to billing + currency. + :vartype exchange_rate_pricing_to_billing: float + :ivar payg_cost_in_billing_currency: The amount of PayG cost before tax in billing currency. + :vartype payg_cost_in_billing_currency: float + :ivar payg_cost_in_usd: The amount of PayG cost before tax in US Dollar currency. + :vartype payg_cost_in_usd: float + :ivar partner_earned_credit_rate: Rate of discount applied if there is a partner earned credit + (PEC) based on partner admin link access. + :vartype partner_earned_credit_rate: float + :ivar partner_earned_credit_applied: Flag to indicate if partner earned credit has been applied + or not. + :vartype partner_earned_credit_applied: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'kind': {'required': True}, + 'billing_account_id': {'readonly': True}, + 'billing_account_name': {'readonly': True}, + 'billing_period_start_date': {'readonly': True}, + 'billing_period_end_date': {'readonly': True}, + 'billing_profile_id': {'readonly': True}, + 'billing_profile_name': {'readonly': True}, + 'subscription_guid': {'readonly': True}, + 'subscription_name': {'readonly': True}, + 'date': {'readonly': True}, + 'product': {'readonly': True}, + 'meter_id': {'readonly': True}, + 'meter_name': {'readonly': True}, + 'meter_region': {'readonly': True}, + 'meter_category': {'readonly': True}, + 'meter_sub_category': {'readonly': True}, + 'service_family': {'readonly': True}, + 'quantity': {'readonly': True}, + 'unit_of_measure': {'readonly': True}, + 'instance_name': {'readonly': True}, + 'cost_in_usd': {'readonly': True}, + 'unit_price': {'readonly': True}, + 'billing_currency_code': {'readonly': True}, + 'resource_location': {'readonly': True}, + 'consumed_service': {'readonly': True}, + 'service_info1': {'readonly': True}, + 'service_info2': {'readonly': True}, + 'additional_info': {'readonly': True}, + 'invoice_section_id': {'readonly': True}, + 'invoice_section_name': {'readonly': True}, + 'cost_center': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'reservation_id': {'readonly': True}, + 'reservation_name': {'readonly': True}, + 'product_order_id': {'readonly': True}, + 'product_order_name': {'readonly': True}, + 'is_azure_credit_eligible': {'readonly': True}, + 'term': {'readonly': True}, + 'publisher_name': {'readonly': True}, + 'publisher_type': {'readonly': True}, + 'charge_type': {'readonly': True}, + 'frequency': {'readonly': True}, + 'cost_in_billing_currency': {'readonly': True}, + 'cost_in_pricing_currency': {'readonly': True}, + 'exchange_rate': {'readonly': True}, + 'exchange_rate_date': {'readonly': True}, + 'invoice_id': {'readonly': True}, + 'previous_invoice_id': {'readonly': True}, + 'pricing_currency_code': {'readonly': True}, + 'product_identifier': {'readonly': True}, + 'resource_location_normalized': {'readonly': True}, + 'service_period_start_date': {'readonly': True}, + 'service_period_end_date': {'readonly': True}, + 'customer_tenant_id': {'readonly': True}, + 'customer_name': {'readonly': True}, + 'partner_tenant_id': {'readonly': True}, + 'partner_name': {'readonly': True}, + 'reseller_mpn_id': {'readonly': True}, + 'reseller_name': {'readonly': True}, + 'publisher_id': {'readonly': True}, + 'market_price': {'readonly': True}, + 'exchange_rate_pricing_to_billing': {'readonly': True}, + 'payg_cost_in_billing_currency': {'readonly': True}, + 'payg_cost_in_usd': {'readonly': True}, + 'partner_earned_credit_rate': {'readonly': True}, + 'partner_earned_credit_applied': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'billing_account_id': {'key': 'properties.billingAccountId', 'type': 'str'}, + 'billing_account_name': {'key': 'properties.billingAccountName', 'type': 'str'}, + 'billing_period_start_date': {'key': 'properties.billingPeriodStartDate', 'type': 'iso-8601'}, + 'billing_period_end_date': {'key': 'properties.billingPeriodEndDate', 'type': 'iso-8601'}, + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'billing_profile_name': {'key': 'properties.billingProfileName', 'type': 'str'}, + 'subscription_guid': {'key': 'properties.subscriptionGuid', 'type': 'str'}, + 'subscription_name': {'key': 'properties.subscriptionName', 'type': 'str'}, + 'date': {'key': 'properties.date', 'type': 'iso-8601'}, + 'product': {'key': 'properties.product', 'type': 'str'}, + 'meter_id': {'key': 'properties.meterId', 'type': 'str'}, + 'meter_name': {'key': 'properties.meterName', 'type': 'str'}, + 'meter_region': {'key': 'properties.meterRegion', 'type': 'str'}, + 'meter_category': {'key': 'properties.meterCategory', 'type': 'str'}, + 'meter_sub_category': {'key': 'properties.meterSubCategory', 'type': 'str'}, + 'service_family': {'key': 'properties.serviceFamily', 'type': 'str'}, + 'quantity': {'key': 'properties.quantity', 'type': 'float'}, + 'unit_of_measure': {'key': 'properties.unitOfMeasure', 'type': 'str'}, + 'instance_name': {'key': 'properties.instanceName', 'type': 'str'}, + 'cost_in_usd': {'key': 'properties.costInUSD', 'type': 'float'}, + 'unit_price': {'key': 'properties.unitPrice', 'type': 'float'}, + 'billing_currency_code': {'key': 'properties.billingCurrencyCode', 'type': 'str'}, + 'resource_location': {'key': 'properties.resourceLocation', 'type': 'str'}, + 'consumed_service': {'key': 'properties.consumedService', 'type': 'str'}, + 'service_info1': {'key': 'properties.serviceInfo1', 'type': 'str'}, + 'service_info2': {'key': 'properties.serviceInfo2', 'type': 'str'}, + 'additional_info': {'key': 'properties.additionalInfo', 'type': 'str'}, + 'invoice_section_id': {'key': 'properties.invoiceSectionId', 'type': 'str'}, + 'invoice_section_name': {'key': 'properties.invoiceSectionName', 'type': 'str'}, + 'cost_center': {'key': 'properties.costCenter', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'reservation_id': {'key': 'properties.reservationId', 'type': 'str'}, + 'reservation_name': {'key': 'properties.reservationName', 'type': 'str'}, + 'product_order_id': {'key': 'properties.productOrderId', 'type': 'str'}, + 'product_order_name': {'key': 'properties.productOrderName', 'type': 'str'}, + 'is_azure_credit_eligible': {'key': 'properties.isAzureCreditEligible', 'type': 'bool'}, + 'term': {'key': 'properties.term', 'type': 'str'}, + 'publisher_name': {'key': 'properties.publisherName', 'type': 'str'}, + 'publisher_type': {'key': 'properties.publisherType', 'type': 'str'}, + 'charge_type': {'key': 'properties.chargeType', 'type': 'str'}, + 'frequency': {'key': 'properties.frequency', 'type': 'str'}, + 'cost_in_billing_currency': {'key': 'properties.costInBillingCurrency', 'type': 'float'}, + 'cost_in_pricing_currency': {'key': 'properties.costInPricingCurrency', 'type': 'float'}, + 'exchange_rate': {'key': 'properties.exchangeRate', 'type': 'str'}, + 'exchange_rate_date': {'key': 'properties.exchangeRateDate', 'type': 'iso-8601'}, + 'invoice_id': {'key': 'properties.invoiceId', 'type': 'str'}, + 'previous_invoice_id': {'key': 'properties.previousInvoiceId', 'type': 'str'}, + 'pricing_currency_code': {'key': 'properties.pricingCurrencyCode', 'type': 'str'}, + 'product_identifier': {'key': 'properties.productIdentifier', 'type': 'str'}, + 'resource_location_normalized': {'key': 'properties.resourceLocationNormalized', 'type': 'str'}, + 'service_period_start_date': {'key': 'properties.servicePeriodStartDate', 'type': 'iso-8601'}, + 'service_period_end_date': {'key': 'properties.servicePeriodEndDate', 'type': 'iso-8601'}, + 'customer_tenant_id': {'key': 'properties.customerTenantId', 'type': 'str'}, + 'customer_name': {'key': 'properties.customerName', 'type': 'str'}, + 'partner_tenant_id': {'key': 'properties.partnerTenantId', 'type': 'str'}, + 'partner_name': {'key': 'properties.partnerName', 'type': 'str'}, + 'reseller_mpn_id': {'key': 'properties.resellerMpnId', 'type': 'str'}, + 'reseller_name': {'key': 'properties.resellerName', 'type': 'str'}, + 'publisher_id': {'key': 'properties.publisherId', 'type': 'str'}, + 'market_price': {'key': 'properties.marketPrice', 'type': 'float'}, + 'exchange_rate_pricing_to_billing': {'key': 'properties.exchangeRatePricingToBilling', 'type': 'float'}, + 'payg_cost_in_billing_currency': {'key': 'properties.paygCostInBillingCurrency', 'type': 'float'}, + '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'}, + } + + def __init__( + self, + **kwargs + ): + super(ModernUsageDetail, self).__init__(**kwargs) + self.kind = 'modern' # type: str + self.billing_account_id = None + self.billing_account_name = None + self.billing_period_start_date = None + self.billing_period_end_date = None + self.billing_profile_id = None + self.billing_profile_name = None + self.subscription_guid = None + self.subscription_name = None + self.date = None + self.product = None + self.meter_id = None + self.meter_name = None + self.meter_region = None + self.meter_category = None + self.meter_sub_category = None + self.service_family = None + self.quantity = None + self.unit_of_measure = None + self.instance_name = None + self.cost_in_usd = None + self.unit_price = None + self.billing_currency_code = None + self.resource_location = None + self.consumed_service = None + self.service_info1 = None + self.service_info2 = None + self.additional_info = None + self.invoice_section_id = None + self.invoice_section_name = None + self.cost_center = None + self.resource_group = None + self.reservation_id = None + self.reservation_name = None + self.product_order_id = None + self.product_order_name = None + self.is_azure_credit_eligible = None + self.term = None + self.publisher_name = None + self.publisher_type = None + self.charge_type = None + self.frequency = None + self.cost_in_billing_currency = None + self.cost_in_pricing_currency = None + self.exchange_rate = None + self.exchange_rate_date = None + self.invoice_id = None + self.previous_invoice_id = None + self.pricing_currency_code = None + self.product_identifier = None + self.resource_location_normalized = None + self.service_period_start_date = None + self.service_period_end_date = None + self.customer_tenant_id = None + self.customer_name = None + self.partner_tenant_id = None + self.partner_name = None + self.reseller_mpn_id = None + self.reseller_name = None + self.publisher_id = None + self.market_price = None + self.exchange_rate_pricing_to_billing = None + self.payg_cost_in_billing_currency = None + self.payg_cost_in_usd = None + self.partner_earned_credit_rate = None + self.partner_earned_credit_applied = None + + +class Notification(msrest.serialization.Model): + """The notification associated with a budget. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. The notification is enabled or not. + :type enabled: bool + :param operator: Required. The comparison operator. Possible values include: "EqualTo", + "GreaterThan", "GreaterThanOrEqualTo". + :type operator: str or ~azure.mgmt.consumption.models.OperatorType + :param threshold: Required. Threshold value associated with a notification. Notification is + sent when the cost exceeded the threshold. It is always percent and has to be between 0 and + 1000. + :type threshold: float + :param contact_emails: Required. Email addresses to send the budget notification to when the + threshold is exceeded. + :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. + :type contact_groups: list[str] + :param threshold_type: The type of threshold. Possible values include: "Actual". + :type threshold_type: str or ~azure.mgmt.consumption.models.ThresholdType + """ + + _validation = { + 'enabled': {'required': True}, + 'operator': {'required': True}, + 'threshold': {'required': True}, + 'contact_emails': {'required': True, 'max_items': 50, 'min_items': 1}, + 'contact_groups': {'max_items': 50, 'min_items': 0}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'threshold': {'key': 'threshold', 'type': 'float'}, + 'contact_emails': {'key': 'contactEmails', 'type': '[str]'}, + 'contact_roles': {'key': 'contactRoles', 'type': '[str]'}, + 'contact_groups': {'key': 'contactGroups', 'type': '[str]'}, + 'threshold_type': {'key': 'thresholdType', 'type': 'str'}, + } + + def __init__( + self, + *, + enabled: bool, + operator: Union[str, "OperatorType"], + threshold: float, + contact_emails: List[str], + contact_roles: Optional[List[str]] = None, + contact_groups: Optional[List[str]] = None, + threshold_type: Optional[Union[str, "ThresholdType"]] = None, + **kwargs + ): + super(Notification, self).__init__(**kwargs) + self.enabled = enabled + self.operator = operator + self.threshold = threshold + self.contact_emails = contact_emails + self.contact_roles = contact_roles + self.contact_groups = contact_groups + self.threshold_type = threshold_type + + +class Operation(msrest.serialization.Model): + """A Consumption REST API operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Operation name: {provider}/{resource}/{operation}. + :vartype name: str + :param display: The object that represents the operation. + :type display: ~azure.mgmt.consumption.models.OperationDisplay + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__( + self, + *, + display: Optional["OperationDisplay"] = None, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = display + + +class OperationDisplay(msrest.serialization.Model): + """The object that represents the operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provider: Service provider: Microsoft.Consumption. + :vartype provider: str + :ivar resource: Resource on which the operation is performed: UsageDetail, etc. + :vartype resource: str + :ivar operation: Operation type: Read, write, delete, etc. + :vartype operation: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + + +class OperationListResult(msrest.serialization.Model): + """Result of listing consumption operations. It contains a list of operations and a URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of consumption operations supported by the Microsoft.Consumption resource + provider. + :vartype value: list[~azure.mgmt.consumption.models.Operation] + :ivar next_link: URL to get the next set of operation list results if there are any. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class PriceSheetProperties(msrest.serialization.Model): + """The properties of the price sheet. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar billing_period_id: The id of the billing period resource that the usage belongs to. + :vartype billing_period_id: str + :ivar meter_id: The meter id (GUID). + :vartype meter_id: str + :ivar meter_details: The details about the meter. By default this is not populated, unless it's + specified in $expand. + :vartype meter_details: ~azure.mgmt.consumption.models.MeterDetails + :ivar unit_of_measure: Unit of measure. + :vartype unit_of_measure: str + :ivar included_quantity: Included quality for an offer. + :vartype included_quantity: float + :ivar part_number: Part Number. + :vartype part_number: str + :ivar unit_price: Unit Price. + :vartype unit_price: float + :ivar currency_code: Currency Code. + :vartype currency_code: str + :ivar offer_id: Offer Id. + :vartype offer_id: str + """ + + _validation = { + 'billing_period_id': {'readonly': True}, + 'meter_id': {'readonly': True}, + 'meter_details': {'readonly': True}, + 'unit_of_measure': {'readonly': True}, + 'included_quantity': {'readonly': True}, + 'part_number': {'readonly': True}, + 'unit_price': {'readonly': True}, + 'currency_code': {'readonly': True}, + 'offer_id': {'readonly': True}, + } + + _attribute_map = { + 'billing_period_id': {'key': 'billingPeriodId', 'type': 'str'}, + 'meter_id': {'key': 'meterId', 'type': 'str'}, + 'meter_details': {'key': 'meterDetails', 'type': 'MeterDetails'}, + 'unit_of_measure': {'key': 'unitOfMeasure', 'type': 'str'}, + 'included_quantity': {'key': 'includedQuantity', 'type': 'float'}, + 'part_number': {'key': 'partNumber', 'type': 'str'}, + 'unit_price': {'key': 'unitPrice', 'type': 'float'}, + 'currency_code': {'key': 'currencyCode', 'type': 'str'}, + 'offer_id': {'key': 'offerId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PriceSheetProperties, self).__init__(**kwargs) + self.billing_period_id = None + self.meter_id = None + self.meter_details = None + self.unit_of_measure = None + self.included_quantity = None + self.part_number = None + self.unit_price = None + self.currency_code = None + self.offer_id = None + + +class PriceSheetResult(Resource): + """An pricesheet resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: 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 + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'pricesheets': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'pricesheets': {'key': 'properties.pricesheets', 'type': '[PriceSheetProperties]'}, + 'next_link': {'key': 'properties.nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PriceSheetResult, self).__init__(**kwargs) + self.pricesheets = None + self.next_link = None + + +class ReservationDetail(Resource): + """reservation detail resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar reservation_order_id: The reservation order ID is the identifier for a reservation + purchase. Each reservation order ID represents a single purchase transaction. A reservation + order contains reservations. The reservation order specifies the VM size and region for the + reservations. + :vartype reservation_order_id: str + :ivar instance_flexibility_ratio: The instance Flexibility Ratio. + :vartype instance_flexibility_ratio: str + :ivar instance_flexibility_group: The instance Flexibility Group. + :vartype instance_flexibility_group: str + :ivar reservation_id: The reservation ID is the identifier of a reservation within a + reservation order. Each reservation is the grouping for applying the benefit scope and also + specifies the number of instances to which the reservation benefit can be applied to. + :vartype reservation_id: str + :ivar sku_name: This is the ARM Sku name. It can be used to join with the serviceType field in + additional info in usage records. + :vartype sku_name: str + :ivar reserved_hours: This is the total hours reserved for the day. E.g. if reservation for 1 + instance was made on 1 PM, this will be 11 hours for that day and 24 hours from subsequent + days. + :vartype reserved_hours: float + :ivar usage_date: The date on which consumption occurred. + :vartype usage_date: ~datetime.datetime + :ivar used_hours: This is the total hours used by the instance. + :vartype used_hours: float + :ivar instance_id: This identifier is the name of the resource or the fully qualified Resource + ID. + :vartype instance_id: str + :ivar total_reserved_quantity: This is the total count of instances that are reserved for the + reservationId. + :vartype total_reserved_quantity: float + :ivar kind: The reservation kind. + :vartype kind: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'reservation_order_id': {'readonly': True}, + 'instance_flexibility_ratio': {'readonly': True}, + 'instance_flexibility_group': {'readonly': True}, + 'reservation_id': {'readonly': True}, + 'sku_name': {'readonly': True}, + 'reserved_hours': {'readonly': True}, + 'usage_date': {'readonly': True}, + 'used_hours': {'readonly': True}, + 'instance_id': {'readonly': True}, + 'total_reserved_quantity': {'readonly': True}, + 'kind': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'reservation_order_id': {'key': 'properties.reservationOrderId', 'type': 'str'}, + 'instance_flexibility_ratio': {'key': 'properties.instanceFlexibilityRatio', 'type': 'str'}, + 'instance_flexibility_group': {'key': 'properties.instanceFlexibilityGroup', 'type': 'str'}, + 'reservation_id': {'key': 'properties.reservationId', 'type': 'str'}, + 'sku_name': {'key': 'properties.skuName', 'type': 'str'}, + 'reserved_hours': {'key': 'properties.reservedHours', 'type': 'float'}, + 'usage_date': {'key': 'properties.usageDate', 'type': 'iso-8601'}, + 'used_hours': {'key': 'properties.usedHours', 'type': 'float'}, + 'instance_id': {'key': 'properties.instanceId', 'type': 'str'}, + 'total_reserved_quantity': {'key': 'properties.totalReservedQuantity', 'type': 'float'}, + 'kind': {'key': 'properties.kind', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ReservationDetail, self).__init__(**kwargs) + self.reservation_order_id = None + self.instance_flexibility_ratio = None + self.instance_flexibility_group = None + self.reservation_id = None + self.sku_name = None + self.reserved_hours = None + self.usage_date = None + self.used_hours = None + self.instance_id = None + self.total_reserved_quantity = None + self.kind = None + + +class ReservationDetailsListResult(msrest.serialization.Model): + """Result of listing reservation details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of reservation details. + :vartype value: list[~azure.mgmt.consumption.models.ReservationDetail] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ReservationDetail]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ReservationDetailsListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class ReservationRecommendationDetailsCalculatedSavingsProperties(msrest.serialization.Model): + """Details of estimated savings. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar on_demand_cost: The cost without reservation. + :vartype on_demand_cost: float + :ivar overage_cost: The difference between total reservation cost and reservation cost. + :vartype overage_cost: float + :ivar quantity: The quantity for calculated savings. + :vartype quantity: float + :ivar reservation_cost: The exact cost of the estimated usage using reservation. + :vartype reservation_cost: float + :ivar total_reservation_cost: The cost of the suggested quantity. + :vartype total_reservation_cost: float + :ivar savings: The amount saved by purchasing the recommended quantity of reservation. + :vartype savings: float + """ + + _validation = { + 'on_demand_cost': {'readonly': True}, + 'overage_cost': {'readonly': True}, + 'quantity': {'readonly': True}, + 'reservation_cost': {'readonly': True}, + 'total_reservation_cost': {'readonly': True}, + 'savings': {'readonly': True}, + } + + _attribute_map = { + 'on_demand_cost': {'key': 'onDemandCost', 'type': 'float'}, + 'overage_cost': {'key': 'overageCost', 'type': 'float'}, + 'quantity': {'key': 'quantity', 'type': 'float'}, + 'reservation_cost': {'key': 'reservationCost', 'type': 'float'}, + 'total_reservation_cost': {'key': 'totalReservationCost', 'type': 'float'}, + 'savings': {'key': 'savings', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(ReservationRecommendationDetailsCalculatedSavingsProperties, self).__init__(**kwargs) + self.on_demand_cost = None + self.overage_cost = None + self.quantity = None + self.reservation_cost = None + self.total_reservation_cost = None + self.savings = None + + +class ReservationRecommendationDetailsModel(Resource): + """Reservation recommendation details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar currency: An ISO 4217 currency code identifier for the costs and savings. + :vartype currency: str + :ivar resource: Resource specific properties. + :vartype resource: + ~azure.mgmt.consumption.models.ReservationRecommendationDetailsResourceProperties + :ivar resource_group: Resource Group. + :vartype resource_group: str + :ivar savings: Savings information for the recommendation. + :vartype savings: + ~azure.mgmt.consumption.models.ReservationRecommendationDetailsSavingsProperties + :ivar scope: Scope of the reservation, ex: Single or Shared. + :vartype scope: str + :ivar usage: Historical usage details used to calculate the estimated savings. + :vartype usage: ~azure.mgmt.consumption.models.ReservationRecommendationDetailsUsageProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'currency': {'readonly': True}, + 'resource': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'savings': {'readonly': True}, + 'scope': {'readonly': True}, + 'usage': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'currency': {'key': 'properties.currency', 'type': 'str'}, + 'resource': {'key': 'properties.resource', 'type': 'ReservationRecommendationDetailsResourceProperties'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'savings': {'key': 'properties.savings', 'type': 'ReservationRecommendationDetailsSavingsProperties'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + 'usage': {'key': 'properties.usage', 'type': 'ReservationRecommendationDetailsUsageProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(ReservationRecommendationDetailsModel, self).__init__(**kwargs) + self.currency = None + self.resource = None + self.resource_group = None + self.savings = None + self.scope = None + self.usage = None + + +class ReservationRecommendationDetailsResourceProperties(msrest.serialization.Model): + """Details of the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar applied_scopes: List of subscriptions for which the reservation is applied. + :vartype applied_scopes: list[str] + :ivar on_demand_rate: On demand rate of the resource. + :vartype on_demand_rate: float + :ivar product: Azure product ex: Standard_E8s_v3 etc. + :vartype product: str + :ivar region: Azure resource region ex:EastUS, WestUS etc. + :vartype region: str + :ivar reservation_rate: Reservation rate of the resource. + :vartype reservation_rate: float + :ivar resource_type: The azure resource type. + :vartype resource_type: str + """ + + _validation = { + 'applied_scopes': {'readonly': True}, + 'on_demand_rate': {'readonly': True}, + 'product': {'readonly': True}, + 'region': {'readonly': True}, + 'reservation_rate': {'readonly': True}, + 'resource_type': {'readonly': True}, + } + + _attribute_map = { + 'applied_scopes': {'key': 'appliedScopes', 'type': '[str]'}, + 'on_demand_rate': {'key': 'onDemandRate', 'type': 'float'}, + 'product': {'key': 'product', 'type': 'str'}, + 'region': {'key': 'region', 'type': 'str'}, + 'reservation_rate': {'key': 'reservationRate', 'type': 'float'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ReservationRecommendationDetailsResourceProperties, self).__init__(**kwargs) + self.applied_scopes = None + self.on_demand_rate = None + self.product = None + self.region = None + self.reservation_rate = None + self.resource_type = None + + +class ReservationRecommendationDetailsSavingsProperties(msrest.serialization.Model): + """Details of the estimated savings. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param calculated_savings: List of calculated savings. + :type calculated_savings: + list[~azure.mgmt.consumption.models.ReservationRecommendationDetailsCalculatedSavingsProperties] + :ivar look_back_period: Number of days of usage to look back used for computing the + recommendation. + :vartype look_back_period: int + :ivar recommended_quantity: Number of recommended units of the resource. + :vartype recommended_quantity: float + :ivar reservation_order_term: Term period of the reservation, ex: P1Y or P3Y. + :vartype reservation_order_term: str + :ivar savings_type: Type of savings, ex: instance. + :vartype savings_type: str + :ivar unit_of_measure: Measurement unit ex: hour etc. + :vartype unit_of_measure: str + """ + + _validation = { + 'look_back_period': {'readonly': True}, + 'recommended_quantity': {'readonly': True}, + 'reservation_order_term': {'readonly': True}, + 'savings_type': {'readonly': True}, + 'unit_of_measure': {'readonly': True}, + } + + _attribute_map = { + 'calculated_savings': {'key': 'calculatedSavings', 'type': '[ReservationRecommendationDetailsCalculatedSavingsProperties]'}, + 'look_back_period': {'key': 'lookBackPeriod', 'type': 'int'}, + 'recommended_quantity': {'key': 'recommendedQuantity', 'type': 'float'}, + 'reservation_order_term': {'key': 'reservationOrderTerm', 'type': 'str'}, + 'savings_type': {'key': 'savingsType', 'type': 'str'}, + 'unit_of_measure': {'key': 'unitOfMeasure', 'type': 'str'}, + } + + def __init__( + self, + *, + calculated_savings: Optional[List["ReservationRecommendationDetailsCalculatedSavingsProperties"]] = None, + **kwargs + ): + super(ReservationRecommendationDetailsSavingsProperties, self).__init__(**kwargs) + self.calculated_savings = calculated_savings + self.look_back_period = None + self.recommended_quantity = None + self.reservation_order_term = None + self.savings_type = None + self.unit_of_measure = None + + +class ReservationRecommendationDetailsUsageProperties(msrest.serialization.Model): + """Details about historical usage data that has been used for computing the recommendation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar first_consumption_date: The first usage date used for looking back for computing the + recommendation. + :vartype first_consumption_date: str + :ivar last_consumption_date: The last usage date used for looking back for computing the + recommendation. + :vartype last_consumption_date: str + :ivar look_back_unit_type: What the usage data values represent ex: virtual machine instance. + :vartype look_back_unit_type: str + :ivar usage_data: The breakdown of historical resource usage. The values are in the order of + usage between the firstConsumptionDate and the lastConsumptionDate. + :vartype usage_data: list[float] + :ivar usage_grain: The grain of the values represented in the usage data ex: hourly. + :vartype usage_grain: str + """ + + _validation = { + 'first_consumption_date': {'readonly': True}, + 'last_consumption_date': {'readonly': True}, + 'look_back_unit_type': {'readonly': True}, + 'usage_data': {'readonly': True}, + 'usage_grain': {'readonly': True}, + } + + _attribute_map = { + 'first_consumption_date': {'key': 'firstConsumptionDate', 'type': 'str'}, + 'last_consumption_date': {'key': 'lastConsumptionDate', 'type': 'str'}, + 'look_back_unit_type': {'key': 'lookBackUnitType', 'type': 'str'}, + 'usage_data': {'key': 'usageData', 'type': '[float]'}, + 'usage_grain': {'key': 'usageGrain', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ReservationRecommendationDetailsUsageProperties, self).__init__(**kwargs) + self.first_consumption_date = None + self.last_consumption_date = None + self.look_back_unit_type = None + self.usage_data = None + self.usage_grain = None + + +class ReservationRecommendationsListResult(msrest.serialization.Model): + """Result of listing reservation recommendations. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of reservation recommendations. + :vartype value: list[~azure.mgmt.consumption.models.ReservationRecommendation] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ReservationRecommendation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ReservationRecommendationsListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class ReservationSummariesListResult(msrest.serialization.Model): + """Result of listing reservation summaries. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of reservation summaries. + :vartype value: list[~azure.mgmt.consumption.models.ReservationSummary] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ReservationSummary]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ReservationSummariesListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class ReservationSummary(Resource): + """reservation summary resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar reservation_order_id: The reservation order ID is the identifier for a reservation + purchase. Each reservation order ID represents a single purchase transaction. A reservation + order contains reservations. The reservation order specifies the VM size and region for the + reservations. + :vartype reservation_order_id: str + :ivar reservation_id: The reservation ID is the identifier of a reservation within a + reservation order. Each reservation is the grouping for applying the benefit scope and also + specifies the number of instances to which the reservation benefit can be applied to. + :vartype reservation_id: str + :ivar sku_name: This is the ARM Sku name. It can be used to join with the serviceType field in + additional info in usage records. + :vartype sku_name: str + :ivar reserved_hours: This is the total hours reserved. E.g. if reservation for 1 instance was + made on 1 PM, this will be 11 hours for that day and 24 hours from subsequent days. + :vartype reserved_hours: float + :ivar usage_date: Data corresponding to the utilization record. If the grain of data is + monthly, it will be first day of month. + :vartype usage_date: ~datetime.datetime + :ivar used_hours: Total used hours by the reservation. + :vartype used_hours: float + :ivar min_utilization_percentage: This is the minimum hourly utilization in the usage time (day + or month). E.g. if usage record corresponds to 12/10/2017 and on that for hour 4 and 5, + utilization was 10%, this field will return 10% for that day. + :vartype min_utilization_percentage: float + :ivar avg_utilization_percentage: This is average utilization for the entire time range. (day + or month depending on the grain). + :vartype avg_utilization_percentage: float + :ivar max_utilization_percentage: This is the maximum hourly utilization in the usage time (day + or month). E.g. if usage record corresponds to 12/10/2017 and on that for hour 4 and 5, + utilization was 100%, this field will return 100% for that day. + :vartype max_utilization_percentage: float + :ivar kind: The reservation kind. + :vartype kind: str + :ivar purchased_quantity: This is the purchased quantity for the reservationId. + :vartype purchased_quantity: float + :ivar remaining_quantity: This is the remaining quantity for the reservationId. + :vartype remaining_quantity: float + :ivar total_reserved_quantity: This is the total count of instances that are reserved for the + reservationId. + :vartype total_reserved_quantity: float + :ivar used_quantity: This is the used quantity for the reservationId. + :vartype used_quantity: float + :ivar utilized_percentage: This is the utilized percentage for the reservation Id. + :vartype utilized_percentage: float + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'reservation_order_id': {'readonly': True}, + 'reservation_id': {'readonly': True}, + 'sku_name': {'readonly': True}, + 'reserved_hours': {'readonly': True}, + 'usage_date': {'readonly': True}, + 'used_hours': {'readonly': True}, + 'min_utilization_percentage': {'readonly': True}, + 'avg_utilization_percentage': {'readonly': True}, + 'max_utilization_percentage': {'readonly': True}, + 'kind': {'readonly': True}, + 'purchased_quantity': {'readonly': True}, + 'remaining_quantity': {'readonly': True}, + 'total_reserved_quantity': {'readonly': True}, + 'used_quantity': {'readonly': True}, + 'utilized_percentage': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'reservation_order_id': {'key': 'properties.reservationOrderId', 'type': 'str'}, + 'reservation_id': {'key': 'properties.reservationId', 'type': 'str'}, + 'sku_name': {'key': 'properties.skuName', 'type': 'str'}, + 'reserved_hours': {'key': 'properties.reservedHours', 'type': 'float'}, + 'usage_date': {'key': 'properties.usageDate', 'type': 'iso-8601'}, + 'used_hours': {'key': 'properties.usedHours', 'type': 'float'}, + 'min_utilization_percentage': {'key': 'properties.minUtilizationPercentage', 'type': 'float'}, + 'avg_utilization_percentage': {'key': 'properties.avgUtilizationPercentage', 'type': 'float'}, + 'max_utilization_percentage': {'key': 'properties.maxUtilizationPercentage', 'type': 'float'}, + 'kind': {'key': 'properties.kind', 'type': 'str'}, + 'purchased_quantity': {'key': 'properties.purchasedQuantity', 'type': 'float'}, + 'remaining_quantity': {'key': 'properties.remainingQuantity', 'type': 'float'}, + 'total_reserved_quantity': {'key': 'properties.totalReservedQuantity', 'type': 'float'}, + 'used_quantity': {'key': 'properties.usedQuantity', 'type': 'float'}, + 'utilized_percentage': {'key': 'properties.utilizedPercentage', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(ReservationSummary, self).__init__(**kwargs) + self.reservation_order_id = None + self.reservation_id = None + self.sku_name = None + self.reserved_hours = None + self.usage_date = None + self.used_hours = None + self.min_utilization_percentage = None + self.avg_utilization_percentage = None + self.max_utilization_percentage = None + self.kind = None + self.purchased_quantity = None + self.remaining_quantity = None + self.total_reserved_quantity = None + self.used_quantity = None + self.utilized_percentage = None + + +class ReservationTransactionsListResult(msrest.serialization.Model): + """Result of listing reservation recommendations. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of reservation recommendations. + :vartype value: list[~azure.mgmt.consumption.models.ReservationTransaction] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ReservationTransaction]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ReservationTransactionsListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class SkuProperty(msrest.serialization.Model): + """The Sku property. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The name of sku property. + :vartype name: str + :ivar value: The value of sku property. + :vartype value: str + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuProperty, self).__init__(**kwargs) + self.name = None + self.value = None + + +class Tag(msrest.serialization.Model): + """The tag resource. + + :param key: Tag key. + :type key: str + """ + + _attribute_map = { + 'key': {'key': 'key', 'type': 'str'}, + } + + def __init__( + self, + *, + key: Optional[str] = None, + **kwargs + ): + super(Tag, self).__init__(**kwargs) + self.key = key + + +class TagsResult(ProxyResource): + """A resource listing all tags. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param e_tag: eTag of the resource. To handle concurrent update scenario, this field will be + used to determine whether the user is updating the latest version or not. + :type e_tag: str + :param tags: A set of tags. A list of Tag. + :type tags: list[~azure.mgmt.consumption.models.Tag] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'tags': {'key': 'properties.tags', 'type': '[Tag]'}, + } + + def __init__( + self, + *, + e_tag: Optional[str] = None, + tags: Optional[List["Tag"]] = None, + **kwargs + ): + super(TagsResult, self).__init__(e_tag=e_tag, **kwargs) + self.tags = tags + + +class UsageDetailsListResult(msrest.serialization.Model): + """Result of listing usage details. It contains a list of available usage details in reverse chronological order by billing period. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of usage details. + :vartype value: list[~azure.mgmt.consumption.models.UsageDetail] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[UsageDetail]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UsageDetailsListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/balance.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/balance.py deleted file mode 100644 index 88be1e0fa0a5..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/balance.py +++ /dev/null @@ -1,128 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource import Resource - - -class Balance(Resource): - """A balance resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar currency: The ISO currency in which the meter is charged, for - example, USD. - :vartype currency: str - :ivar beginning_balance: The beginning balance for the billing period. - :vartype beginning_balance: decimal.Decimal - :ivar ending_balance: The ending balance for the billing period (for open - periods this will be updated daily). - :vartype ending_balance: decimal.Decimal - :ivar new_purchases: Total new purchase amount. - :vartype new_purchases: decimal.Decimal - :ivar adjustments: Total adjustment amount. - :vartype adjustments: decimal.Decimal - :ivar utilized: Total Commitment usage. - :vartype utilized: decimal.Decimal - :ivar service_overage: Overage for Azure services. - :vartype service_overage: decimal.Decimal - :ivar charges_billed_separately: Charges Billed separately. - :vartype charges_billed_separately: decimal.Decimal - :ivar total_overage: serviceOverage + chargesBilledSeparately. - :vartype total_overage: decimal.Decimal - :ivar total_usage: Azure service commitment + total Overage. - :vartype total_usage: decimal.Decimal - :ivar azure_marketplace_service_charges: Total charges for Azure - Marketplace. - :vartype azure_marketplace_service_charges: decimal.Decimal - :param billing_frequency: The billing frequency. Possible values include: - 'Month', 'Quarter', 'Year' - :type billing_frequency: str or - ~azure.mgmt.consumption.models.BillingFrequency - :ivar price_hidden: Price is hidden or not. - :vartype price_hidden: bool - :ivar new_purchases_details: List of new purchases. - :vartype new_purchases_details: - list[~azure.mgmt.consumption.models.BalancePropertiesNewPurchasesDetailsItem] - :ivar adjustment_details: List of Adjustments (Promo credit, SIE credit - etc.). - :vartype adjustment_details: - list[~azure.mgmt.consumption.models.BalancePropertiesAdjustmentDetailsItem] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'tags': {'readonly': True}, - 'currency': {'readonly': True}, - 'beginning_balance': {'readonly': True}, - 'ending_balance': {'readonly': True}, - 'new_purchases': {'readonly': True}, - 'adjustments': {'readonly': True}, - 'utilized': {'readonly': True}, - 'service_overage': {'readonly': True}, - 'charges_billed_separately': {'readonly': True}, - 'total_overage': {'readonly': True}, - 'total_usage': {'readonly': True}, - 'azure_marketplace_service_charges': {'readonly': True}, - 'price_hidden': {'readonly': True}, - 'new_purchases_details': {'readonly': True}, - 'adjustment_details': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'currency': {'key': 'properties.currency', 'type': 'str'}, - 'beginning_balance': {'key': 'properties.beginningBalance', 'type': 'decimal'}, - 'ending_balance': {'key': 'properties.endingBalance', 'type': 'decimal'}, - 'new_purchases': {'key': 'properties.newPurchases', 'type': 'decimal'}, - 'adjustments': {'key': 'properties.adjustments', 'type': 'decimal'}, - 'utilized': {'key': 'properties.utilized', 'type': 'decimal'}, - 'service_overage': {'key': 'properties.serviceOverage', 'type': 'decimal'}, - 'charges_billed_separately': {'key': 'properties.chargesBilledSeparately', 'type': 'decimal'}, - 'total_overage': {'key': 'properties.totalOverage', 'type': 'decimal'}, - 'total_usage': {'key': 'properties.totalUsage', 'type': 'decimal'}, - 'azure_marketplace_service_charges': {'key': 'properties.azureMarketplaceServiceCharges', 'type': 'decimal'}, - 'billing_frequency': {'key': 'properties.billingFrequency', 'type': 'str'}, - 'price_hidden': {'key': 'properties.priceHidden', 'type': 'bool'}, - 'new_purchases_details': {'key': 'properties.newPurchasesDetails', 'type': '[BalancePropertiesNewPurchasesDetailsItem]'}, - 'adjustment_details': {'key': 'properties.adjustmentDetails', 'type': '[BalancePropertiesAdjustmentDetailsItem]'}, - } - - def __init__(self, **kwargs): - super(Balance, self).__init__(**kwargs) - self.currency = None - self.beginning_balance = None - self.ending_balance = None - self.new_purchases = None - self.adjustments = None - self.utilized = None - self.service_overage = None - self.charges_billed_separately = None - self.total_overage = None - self.total_usage = None - self.azure_marketplace_service_charges = None - self.billing_frequency = kwargs.get('billing_frequency', None) - self.price_hidden = None - self.new_purchases_details = None - self.adjustment_details = None diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/balance_properties_adjustment_details_item.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/balance_properties_adjustment_details_item.py deleted file mode 100644 index a0b9af41285c..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/balance_properties_adjustment_details_item.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class BalancePropertiesAdjustmentDetailsItem(Model): - """BalancePropertiesAdjustmentDetailsItem. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name: the name of new adjustment. - :vartype name: str - :ivar value: the value of new adjustment. - :vartype value: decimal.Decimal - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'decimal'}, - } - - def __init__(self, **kwargs): - super(BalancePropertiesAdjustmentDetailsItem, self).__init__(**kwargs) - self.name = None - self.value = None diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/balance_properties_adjustment_details_item_py3.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/balance_properties_adjustment_details_item_py3.py deleted file mode 100644 index 0fc6b3b377fc..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/balance_properties_adjustment_details_item_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class BalancePropertiesAdjustmentDetailsItem(Model): - """BalancePropertiesAdjustmentDetailsItem. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name: the name of new adjustment. - :vartype name: str - :ivar value: the value of new adjustment. - :vartype value: decimal.Decimal - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'decimal'}, - } - - def __init__(self, **kwargs) -> None: - super(BalancePropertiesAdjustmentDetailsItem, self).__init__(**kwargs) - self.name = None - self.value = None diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/balance_properties_new_purchases_details_item.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/balance_properties_new_purchases_details_item.py deleted file mode 100644 index c50e5ad24216..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/balance_properties_new_purchases_details_item.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class BalancePropertiesNewPurchasesDetailsItem(Model): - """BalancePropertiesNewPurchasesDetailsItem. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name: the name of new purchase. - :vartype name: str - :ivar value: the value of new purchase. - :vartype value: decimal.Decimal - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'decimal'}, - } - - def __init__(self, **kwargs): - super(BalancePropertiesNewPurchasesDetailsItem, self).__init__(**kwargs) - self.name = None - self.value = None diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/balance_properties_new_purchases_details_item_py3.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/balance_properties_new_purchases_details_item_py3.py deleted file mode 100644 index 278a07609ebf..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/balance_properties_new_purchases_details_item_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class BalancePropertiesNewPurchasesDetailsItem(Model): - """BalancePropertiesNewPurchasesDetailsItem. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name: the name of new purchase. - :vartype name: str - :ivar value: the value of new purchase. - :vartype value: decimal.Decimal - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'decimal'}, - } - - def __init__(self, **kwargs) -> None: - super(BalancePropertiesNewPurchasesDetailsItem, self).__init__(**kwargs) - self.name = None - self.value = None diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/balance_py3.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/balance_py3.py deleted file mode 100644 index 8208ab5e2150..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/balance_py3.py +++ /dev/null @@ -1,128 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource_py3 import Resource - - -class Balance(Resource): - """A balance resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar currency: The ISO currency in which the meter is charged, for - example, USD. - :vartype currency: str - :ivar beginning_balance: The beginning balance for the billing period. - :vartype beginning_balance: decimal.Decimal - :ivar ending_balance: The ending balance for the billing period (for open - periods this will be updated daily). - :vartype ending_balance: decimal.Decimal - :ivar new_purchases: Total new purchase amount. - :vartype new_purchases: decimal.Decimal - :ivar adjustments: Total adjustment amount. - :vartype adjustments: decimal.Decimal - :ivar utilized: Total Commitment usage. - :vartype utilized: decimal.Decimal - :ivar service_overage: Overage for Azure services. - :vartype service_overage: decimal.Decimal - :ivar charges_billed_separately: Charges Billed separately. - :vartype charges_billed_separately: decimal.Decimal - :ivar total_overage: serviceOverage + chargesBilledSeparately. - :vartype total_overage: decimal.Decimal - :ivar total_usage: Azure service commitment + total Overage. - :vartype total_usage: decimal.Decimal - :ivar azure_marketplace_service_charges: Total charges for Azure - Marketplace. - :vartype azure_marketplace_service_charges: decimal.Decimal - :param billing_frequency: The billing frequency. Possible values include: - 'Month', 'Quarter', 'Year' - :type billing_frequency: str or - ~azure.mgmt.consumption.models.BillingFrequency - :ivar price_hidden: Price is hidden or not. - :vartype price_hidden: bool - :ivar new_purchases_details: List of new purchases. - :vartype new_purchases_details: - list[~azure.mgmt.consumption.models.BalancePropertiesNewPurchasesDetailsItem] - :ivar adjustment_details: List of Adjustments (Promo credit, SIE credit - etc.). - :vartype adjustment_details: - list[~azure.mgmt.consumption.models.BalancePropertiesAdjustmentDetailsItem] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'tags': {'readonly': True}, - 'currency': {'readonly': True}, - 'beginning_balance': {'readonly': True}, - 'ending_balance': {'readonly': True}, - 'new_purchases': {'readonly': True}, - 'adjustments': {'readonly': True}, - 'utilized': {'readonly': True}, - 'service_overage': {'readonly': True}, - 'charges_billed_separately': {'readonly': True}, - 'total_overage': {'readonly': True}, - 'total_usage': {'readonly': True}, - 'azure_marketplace_service_charges': {'readonly': True}, - 'price_hidden': {'readonly': True}, - 'new_purchases_details': {'readonly': True}, - 'adjustment_details': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'currency': {'key': 'properties.currency', 'type': 'str'}, - 'beginning_balance': {'key': 'properties.beginningBalance', 'type': 'decimal'}, - 'ending_balance': {'key': 'properties.endingBalance', 'type': 'decimal'}, - 'new_purchases': {'key': 'properties.newPurchases', 'type': 'decimal'}, - 'adjustments': {'key': 'properties.adjustments', 'type': 'decimal'}, - 'utilized': {'key': 'properties.utilized', 'type': 'decimal'}, - 'service_overage': {'key': 'properties.serviceOverage', 'type': 'decimal'}, - 'charges_billed_separately': {'key': 'properties.chargesBilledSeparately', 'type': 'decimal'}, - 'total_overage': {'key': 'properties.totalOverage', 'type': 'decimal'}, - 'total_usage': {'key': 'properties.totalUsage', 'type': 'decimal'}, - 'azure_marketplace_service_charges': {'key': 'properties.azureMarketplaceServiceCharges', 'type': 'decimal'}, - 'billing_frequency': {'key': 'properties.billingFrequency', 'type': 'str'}, - 'price_hidden': {'key': 'properties.priceHidden', 'type': 'bool'}, - 'new_purchases_details': {'key': 'properties.newPurchasesDetails', 'type': '[BalancePropertiesNewPurchasesDetailsItem]'}, - 'adjustment_details': {'key': 'properties.adjustmentDetails', 'type': '[BalancePropertiesAdjustmentDetailsItem]'}, - } - - def __init__(self, *, billing_frequency=None, **kwargs) -> None: - super(Balance, self).__init__(**kwargs) - self.currency = None - self.beginning_balance = None - self.ending_balance = None - self.new_purchases = None - self.adjustments = None - self.utilized = None - self.service_overage = None - self.charges_billed_separately = None - self.total_overage = None - self.total_usage = None - self.azure_marketplace_service_charges = None - self.billing_frequency = billing_frequency - self.price_hidden = None - self.new_purchases_details = None - self.adjustment_details = None diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/budget.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/budget.py deleted file mode 100644 index 320d185716fc..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/budget.py +++ /dev/null @@ -1,94 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .proxy_resource import ProxyResource - - -class Budget(ProxyResource): - """A budget resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param e_tag: eTag of the resource. To handle concurrent update scenario, - this field will be used to determine whether the user is updating the - latest version or not. - :type e_tag: str - :param category: Required. The category of the budget, whether the budget - tracks cost or usage. Possible values include: 'Cost', 'Usage' - :type category: str or ~azure.mgmt.consumption.models.CategoryType - :param amount: Required. The total amount of cost to track with the budget - :type amount: decimal.Decimal - :param time_grain: Required. The time covered by a budget. Tracking of the - amount will be reset based on the time grain. Possible values include: - 'Monthly', 'Quarterly', 'Annually' - :type time_grain: str or ~azure.mgmt.consumption.models.TimeGrainType - :param time_period: Required. Has start and end date of the budget. The - start date must be first of the month and should be less than the end - date. Budget start date must be on or after June 1, 2017. Future start - date should not be more than three 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 filters: May be used to filter budgets by resource group, resource, - or meter. - :type filters: ~azure.mgmt.consumption.models.Filters - :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] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'category': {'required': True}, - 'amount': {'required': True}, - 'time_grain': {'required': True}, - 'time_period': {'required': True}, - 'current_spend': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'e_tag': {'key': 'eTag', 'type': 'str'}, - 'category': {'key': 'properties.category', 'type': 'str'}, - 'amount': {'key': 'properties.amount', 'type': 'decimal'}, - 'time_grain': {'key': 'properties.timeGrain', 'type': 'str'}, - 'time_period': {'key': 'properties.timePeriod', 'type': 'BudgetTimePeriod'}, - 'filters': {'key': 'properties.filters', 'type': 'Filters'}, - 'current_spend': {'key': 'properties.currentSpend', 'type': 'CurrentSpend'}, - 'notifications': {'key': 'properties.notifications', 'type': '{Notification}'}, - } - - def __init__(self, **kwargs): - super(Budget, self).__init__(**kwargs) - self.category = kwargs.get('category', None) - self.amount = kwargs.get('amount', None) - self.time_grain = kwargs.get('time_grain', None) - self.time_period = kwargs.get('time_period', None) - self.filters = kwargs.get('filters', None) - self.current_spend = None - self.notifications = kwargs.get('notifications', None) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/budget_paged.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/budget_paged.py deleted file mode 100644 index 2668382253e2..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/budget_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class BudgetPaged(Paged): - """ - A paging container for iterating over a list of :class:`Budget ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Budget]'} - } - - def __init__(self, *args, **kwargs): - - super(BudgetPaged, self).__init__(*args, **kwargs) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/budget_py3.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/budget_py3.py deleted file mode 100644 index 522ea98b4572..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/budget_py3.py +++ /dev/null @@ -1,94 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .proxy_resource_py3 import ProxyResource - - -class Budget(ProxyResource): - """A budget resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param e_tag: eTag of the resource. To handle concurrent update scenario, - this field will be used to determine whether the user is updating the - latest version or not. - :type e_tag: str - :param category: Required. The category of the budget, whether the budget - tracks cost or usage. Possible values include: 'Cost', 'Usage' - :type category: str or ~azure.mgmt.consumption.models.CategoryType - :param amount: Required. The total amount of cost to track with the budget - :type amount: decimal.Decimal - :param time_grain: Required. The time covered by a budget. Tracking of the - amount will be reset based on the time grain. Possible values include: - 'Monthly', 'Quarterly', 'Annually' - :type time_grain: str or ~azure.mgmt.consumption.models.TimeGrainType - :param time_period: Required. Has start and end date of the budget. The - start date must be first of the month and should be less than the end - date. Budget start date must be on or after June 1, 2017. Future start - date should not be more than three 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 filters: May be used to filter budgets by resource group, resource, - or meter. - :type filters: ~azure.mgmt.consumption.models.Filters - :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] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'category': {'required': True}, - 'amount': {'required': True}, - 'time_grain': {'required': True}, - 'time_period': {'required': True}, - 'current_spend': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'e_tag': {'key': 'eTag', 'type': 'str'}, - 'category': {'key': 'properties.category', 'type': 'str'}, - 'amount': {'key': 'properties.amount', 'type': 'decimal'}, - 'time_grain': {'key': 'properties.timeGrain', 'type': 'str'}, - 'time_period': {'key': 'properties.timePeriod', 'type': 'BudgetTimePeriod'}, - 'filters': {'key': 'properties.filters', 'type': 'Filters'}, - 'current_spend': {'key': 'properties.currentSpend', 'type': 'CurrentSpend'}, - 'notifications': {'key': 'properties.notifications', 'type': '{Notification}'}, - } - - def __init__(self, *, category, amount, time_grain, time_period, e_tag: str=None, filters=None, notifications=None, **kwargs) -> None: - super(Budget, self).__init__(e_tag=e_tag, **kwargs) - self.category = category - self.amount = amount - self.time_grain = time_grain - self.time_period = time_period - self.filters = filters - self.current_spend = None - self.notifications = notifications diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/budget_time_period.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/budget_time_period.py deleted file mode 100644 index a0fe9658a07f..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/budget_time_period.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class BudgetTimePeriod(Model): - """The start and end date for a budget. - - All required parameters must be populated in order to send to Azure. - - :param start_date: Required. The start date for the budget. - :type start_date: datetime - :param end_date: The end date for the budget. If not provided, we default - this to 10 years from the start date. - :type end_date: datetime - """ - - _validation = { - 'start_date': {'required': True}, - } - - _attribute_map = { - 'start_date': {'key': 'startDate', 'type': 'iso-8601'}, - 'end_date': {'key': 'endDate', 'type': 'iso-8601'}, - } - - def __init__(self, **kwargs): - super(BudgetTimePeriod, self).__init__(**kwargs) - self.start_date = kwargs.get('start_date', None) - self.end_date = kwargs.get('end_date', None) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/budget_time_period_py3.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/budget_time_period_py3.py deleted file mode 100644 index de0258c1d63f..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/budget_time_period_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class BudgetTimePeriod(Model): - """The start and end date for a budget. - - All required parameters must be populated in order to send to Azure. - - :param start_date: Required. The start date for the budget. - :type start_date: datetime - :param end_date: The end date for the budget. If not provided, we default - this to 10 years from the start date. - :type end_date: datetime - """ - - _validation = { - 'start_date': {'required': True}, - } - - _attribute_map = { - 'start_date': {'key': 'startDate', 'type': 'iso-8601'}, - 'end_date': {'key': 'endDate', 'type': 'iso-8601'}, - } - - def __init__(self, *, start_date, end_date=None, **kwargs) -> None: - super(BudgetTimePeriod, self).__init__(**kwargs) - self.start_date = start_date - self.end_date = end_date diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/charge_summary.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/charge_summary.py deleted file mode 100644 index d3a3bbaaa8b0..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/charge_summary.py +++ /dev/null @@ -1,82 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource import Resource - - -class ChargeSummary(Resource): - """A charge summary resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar billing_period_id: The id of the billing period resource that the - charge belongs to. - :vartype billing_period_id: str - :ivar usage_start: Usage start date. - :vartype usage_start: str - :ivar usage_end: Usage end date. - :vartype usage_end: str - :ivar azure_charges: Azure Charges. - :vartype azure_charges: decimal.Decimal - :ivar charges_billed_separately: Charges Billed separately. - :vartype charges_billed_separately: decimal.Decimal - :ivar marketplace_charges: Marketplace Charges. - :vartype marketplace_charges: decimal.Decimal - :ivar currency: Currency Code - :vartype currency: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'tags': {'readonly': True}, - 'billing_period_id': {'readonly': True}, - 'usage_start': {'readonly': True}, - 'usage_end': {'readonly': True}, - 'azure_charges': {'readonly': True}, - 'charges_billed_separately': {'readonly': True}, - 'marketplace_charges': {'readonly': True}, - 'currency': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'billing_period_id': {'key': 'properties.billingPeriodId', 'type': 'str'}, - 'usage_start': {'key': 'properties.usageStart', 'type': 'str'}, - 'usage_end': {'key': 'properties.usageEnd', 'type': 'str'}, - 'azure_charges': {'key': 'properties.azureCharges', 'type': 'decimal'}, - 'charges_billed_separately': {'key': 'properties.chargesBilledSeparately', 'type': 'decimal'}, - 'marketplace_charges': {'key': 'properties.marketplaceCharges', 'type': 'decimal'}, - 'currency': {'key': 'properties.currency', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ChargeSummary, self).__init__(**kwargs) - self.billing_period_id = None - self.usage_start = None - self.usage_end = None - self.azure_charges = None - self.charges_billed_separately = None - self.marketplace_charges = None - self.currency = None diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/charge_summary_py3.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/charge_summary_py3.py deleted file mode 100644 index 1f6031eed7c4..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/charge_summary_py3.py +++ /dev/null @@ -1,82 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource_py3 import Resource - - -class ChargeSummary(Resource): - """A charge summary resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar billing_period_id: The id of the billing period resource that the - charge belongs to. - :vartype billing_period_id: str - :ivar usage_start: Usage start date. - :vartype usage_start: str - :ivar usage_end: Usage end date. - :vartype usage_end: str - :ivar azure_charges: Azure Charges. - :vartype azure_charges: decimal.Decimal - :ivar charges_billed_separately: Charges Billed separately. - :vartype charges_billed_separately: decimal.Decimal - :ivar marketplace_charges: Marketplace Charges. - :vartype marketplace_charges: decimal.Decimal - :ivar currency: Currency Code - :vartype currency: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'tags': {'readonly': True}, - 'billing_period_id': {'readonly': True}, - 'usage_start': {'readonly': True}, - 'usage_end': {'readonly': True}, - 'azure_charges': {'readonly': True}, - 'charges_billed_separately': {'readonly': True}, - 'marketplace_charges': {'readonly': True}, - 'currency': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'billing_period_id': {'key': 'properties.billingPeriodId', 'type': 'str'}, - 'usage_start': {'key': 'properties.usageStart', 'type': 'str'}, - 'usage_end': {'key': 'properties.usageEnd', 'type': 'str'}, - 'azure_charges': {'key': 'properties.azureCharges', 'type': 'decimal'}, - 'charges_billed_separately': {'key': 'properties.chargesBilledSeparately', 'type': 'decimal'}, - 'marketplace_charges': {'key': 'properties.marketplaceCharges', 'type': 'decimal'}, - 'currency': {'key': 'properties.currency', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(ChargeSummary, self).__init__(**kwargs) - self.billing_period_id = None - self.usage_start = None - self.usage_end = None - self.azure_charges = None - self.charges_billed_separately = None - self.marketplace_charges = None - self.currency = None diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/charges_list_result.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/charges_list_result.py deleted file mode 100644 index 7d968d08a465..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/charges_list_result.py +++ /dev/null @@ -1,35 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ChargesListResult(Model): - """Result of listing charge summary. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar value: The list of charge summary - :vartype value: list[~azure.mgmt.consumption.models.ChargeSummary] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ChargeSummary]'}, - } - - def __init__(self, **kwargs): - super(ChargesListResult, self).__init__(**kwargs) - self.value = None diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/charges_list_result_py3.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/charges_list_result_py3.py deleted file mode 100644 index 3c6e3404673b..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/charges_list_result_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ChargesListResult(Model): - """Result of listing charge summary. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar value: The list of charge summary - :vartype value: list[~azure.mgmt.consumption.models.ChargeSummary] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ChargeSummary]'}, - } - - def __init__(self, **kwargs) -> None: - super(ChargesListResult, self).__init__(**kwargs) - self.value = None 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 deleted file mode 100644 index b888ebdec7e0..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/consumption_management_client_enums.py +++ /dev/null @@ -1,71 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from enum import Enum - - -class BillingFrequency(str, Enum): - - month = "Month" - quarter = "Quarter" - year = "Year" - - -class CategoryType(str, Enum): - - cost = "Cost" - usage = "Usage" - - -class TimeGrainType(str, Enum): - - monthly = "Monthly" - quarterly = "Quarterly" - annually = "Annually" - - -class OperatorType(str, Enum): - - equal_to = "EqualTo" - greater_than = "GreaterThan" - greater_than_or_equal_to = "GreaterThanOrEqualTo" - - -class Grain(str, Enum): - - daily = "Daily" - monthly = "Monthly" - yearly = "Yearly" - - -class ChargeType(str, Enum): - - actual = "Actual" - forecast = "Forecast" - - -class Bound(str, Enum): - - upper = "Upper" - lower = "Lower" - - -class Datagrain(str, Enum): - - daily_grain = "daily" #: Daily grain of data - monthly_grain = "monthly" #: Monthly grain of data - - -class Metrictype(str, Enum): - - actual_cost_metric_type = "actualcost" #: Actual cost data. - amortized_cost_metric_type = "amortizedcost" #: Amortized cost data. - usage_metric_type = "usage" #: Usage data. diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/current_spend.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/current_spend.py deleted file mode 100644 index 42724a3aa6c6..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/current_spend.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class CurrentSpend(Model): - """The current amount of 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 total amount of cost which is being tracked by the - budget. - :vartype amount: decimal.Decimal - :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': 'decimal'}, - 'unit': {'key': 'unit', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(CurrentSpend, self).__init__(**kwargs) - self.amount = None - self.unit = None diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/current_spend_py3.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/current_spend_py3.py deleted file mode 100644 index 87a5fc0bcc1d..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/current_spend_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class CurrentSpend(Model): - """The current amount of 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 total amount of cost which is being tracked by the - budget. - :vartype amount: decimal.Decimal - :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': 'decimal'}, - 'unit': {'key': 'unit', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(CurrentSpend, self).__init__(**kwargs) - self.amount = None - self.unit = None diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/error_details.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/error_details.py deleted file mode 100644 index 03f3e23d2153..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/error_details.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ErrorDetails(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(ErrorDetails, self).__init__(**kwargs) - self.code = None - self.message = None diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/error_details_py3.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/error_details_py3.py deleted file mode 100644 index f9e1adeac9fe..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/error_details_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ErrorDetails(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) -> None: - super(ErrorDetails, self).__init__(**kwargs) - self.code = None - self.message = None diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/error_response.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/error_response.py deleted file mode 100644 index 4bd88fdd8421..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/error_response.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError - - -class ErrorResponse(Model): - """Error response indicates that the service is not able to process the - incoming request. The reason is provided in the error message. - - :param error: The details of the error. - :type error: ~azure.mgmt.consumption.models.ErrorDetails - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetails'}, - } - - def __init__(self, **kwargs): - super(ErrorResponse, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class ErrorResponseException(HttpOperationError): - """Server responsed with exception of type: 'ErrorResponse'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/error_response_py3.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/error_response_py3.py deleted file mode 100644 index 7ee8c9325c20..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/error_response_py3.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError - - -class ErrorResponse(Model): - """Error response indicates that the service is not able to process the - incoming request. The reason is provided in the error message. - - :param error: The details of the error. - :type error: ~azure.mgmt.consumption.models.ErrorDetails - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetails'}, - } - - def __init__(self, *, error=None, **kwargs) -> None: - super(ErrorResponse, self).__init__(**kwargs) - self.error = error - - -class ErrorResponseException(HttpOperationError): - """Server responsed with exception of type: 'ErrorResponse'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/filters.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/filters.py deleted file mode 100644 index 42c5f41c6412..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/filters.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Filters(Model): - """May be used to filter budgets by resource group, resource, or meter. - - :param resource_groups: The list of filters on resource groups, allowed at - subscription level only. - :type resource_groups: list[str] - :param resources: The list of filters on resources. - :type resources: list[str] - :param meters: The list of filters on meters (GUID), mandatory for budgets - of usage category. - :type meters: list[str] - :param tags: The dictionary of filters on tags. - :type tags: dict[str, list[str]] - """ - - _validation = { - 'resource_groups': {'max_items': 10, 'min_items': 0}, - 'resources': {'max_items': 10, 'min_items': 0}, - 'meters': {'max_items': 10, 'min_items': 0}, - } - - _attribute_map = { - 'resource_groups': {'key': 'resourceGroups', 'type': '[str]'}, - 'resources': {'key': 'resources', 'type': '[str]'}, - 'meters': {'key': 'meters', 'type': '[str]'}, - 'tags': {'key': 'tags', 'type': '{[str]}'}, - } - - def __init__(self, **kwargs): - super(Filters, self).__init__(**kwargs) - self.resource_groups = kwargs.get('resource_groups', None) - self.resources = kwargs.get('resources', None) - self.meters = kwargs.get('meters', None) - self.tags = kwargs.get('tags', None) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/filters_py3.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/filters_py3.py deleted file mode 100644 index c478858ccf1b..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/filters_py3.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Filters(Model): - """May be used to filter budgets by resource group, resource, or meter. - - :param resource_groups: The list of filters on resource groups, allowed at - subscription level only. - :type resource_groups: list[str] - :param resources: The list of filters on resources. - :type resources: list[str] - :param meters: The list of filters on meters (GUID), mandatory for budgets - of usage category. - :type meters: list[str] - :param tags: The dictionary of filters on tags. - :type tags: dict[str, list[str]] - """ - - _validation = { - 'resource_groups': {'max_items': 10, 'min_items': 0}, - 'resources': {'max_items': 10, 'min_items': 0}, - 'meters': {'max_items': 10, 'min_items': 0}, - } - - _attribute_map = { - 'resource_groups': {'key': 'resourceGroups', 'type': '[str]'}, - 'resources': {'key': 'resources', 'type': '[str]'}, - 'meters': {'key': 'meters', 'type': '[str]'}, - 'tags': {'key': 'tags', 'type': '{[str]}'}, - } - - def __init__(self, *, resource_groups=None, resources=None, meters=None, tags=None, **kwargs) -> None: - super(Filters, self).__init__(**kwargs) - self.resource_groups = resource_groups - self.resources = resources - self.meters = meters - self.tags = tags diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/forecast.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/forecast.py deleted file mode 100644 index 4cfb731f0b17..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/forecast.py +++ /dev/null @@ -1,79 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource import Resource - - -class Forecast(Resource): - """A forecast resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar tags: 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' - :type grain: str or ~azure.mgmt.consumption.models.Grain - :ivar charge: The amount of charge - :vartype charge: decimal.Decimal - :ivar currency: The ISO currency in which the meter is charged, for - example, USD. - :vartype currency: str - :param charge_type: The type of the charge. Could be actual or forecast. - Possible values include: 'Actual', 'Forecast' - :type charge_type: str or ~azure.mgmt.consumption.models.ChargeType - :ivar confidence_levels: The details about the forecast confidence levels. - This is populated only when chargeType is Forecast. - :vartype confidence_levels: - list[~azure.mgmt.consumption.models.ForecastPropertiesConfidenceLevelsItem] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'tags': {'readonly': True}, - 'usage_date': {'readonly': True}, - 'charge': {'readonly': True}, - 'currency': {'readonly': True}, - 'confidence_levels': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'usage_date': {'key': 'properties.usageDate', 'type': 'str'}, - 'grain': {'key': 'properties.grain', 'type': 'str'}, - 'charge': {'key': 'properties.charge', 'type': 'decimal'}, - 'currency': {'key': 'properties.currency', 'type': 'str'}, - 'charge_type': {'key': 'properties.chargeType', 'type': 'str'}, - 'confidence_levels': {'key': 'properties.confidenceLevels', 'type': '[ForecastPropertiesConfidenceLevelsItem]'}, - } - - def __init__(self, **kwargs): - super(Forecast, self).__init__(**kwargs) - self.usage_date = None - self.grain = kwargs.get('grain', None) - self.charge = None - self.currency = None - self.charge_type = kwargs.get('charge_type', None) - self.confidence_levels = None diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/forecast_paged.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/forecast_paged.py deleted file mode 100644 index 68cef39c6140..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/forecast_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class ForecastPaged(Paged): - """ - A paging container for iterating over a list of :class:`Forecast ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Forecast]'} - } - - def __init__(self, *args, **kwargs): - - super(ForecastPaged, self).__init__(*args, **kwargs) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/forecast_properties_confidence_levels_item.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/forecast_properties_confidence_levels_item.py deleted file mode 100644 index 803026660dd3..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/forecast_properties_confidence_levels_item.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ForecastPropertiesConfidenceLevelsItem(Model): - """ForecastPropertiesConfidenceLevelsItem. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar percentage: The percentage level of the confidence - :vartype percentage: decimal.Decimal - :param bound: The boundary of the percentage, values could be 'Upper' or - 'Lower'. Possible values include: 'Upper', 'Lower' - :type bound: str or ~azure.mgmt.consumption.models.Bound - :ivar value: The amount of forecast within the percentage level - :vartype value: decimal.Decimal - """ - - _validation = { - 'percentage': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'percentage': {'key': 'percentage', 'type': 'decimal'}, - 'bound': {'key': 'bound', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'decimal'}, - } - - def __init__(self, **kwargs): - super(ForecastPropertiesConfidenceLevelsItem, self).__init__(**kwargs) - self.percentage = None - self.bound = kwargs.get('bound', None) - self.value = None diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/forecast_properties_confidence_levels_item_py3.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/forecast_properties_confidence_levels_item_py3.py deleted file mode 100644 index ddbe8d8bb5df..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/forecast_properties_confidence_levels_item_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ForecastPropertiesConfidenceLevelsItem(Model): - """ForecastPropertiesConfidenceLevelsItem. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar percentage: The percentage level of the confidence - :vartype percentage: decimal.Decimal - :param bound: The boundary of the percentage, values could be 'Upper' or - 'Lower'. Possible values include: 'Upper', 'Lower' - :type bound: str or ~azure.mgmt.consumption.models.Bound - :ivar value: The amount of forecast within the percentage level - :vartype value: decimal.Decimal - """ - - _validation = { - 'percentage': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'percentage': {'key': 'percentage', 'type': 'decimal'}, - 'bound': {'key': 'bound', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'decimal'}, - } - - def __init__(self, *, bound=None, **kwargs) -> None: - super(ForecastPropertiesConfidenceLevelsItem, self).__init__(**kwargs) - self.percentage = None - self.bound = bound - self.value = None diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/forecast_py3.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/forecast_py3.py deleted file mode 100644 index ea3f5550f507..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/forecast_py3.py +++ /dev/null @@ -1,79 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource_py3 import Resource - - -class Forecast(Resource): - """A forecast resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar tags: 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' - :type grain: str or ~azure.mgmt.consumption.models.Grain - :ivar charge: The amount of charge - :vartype charge: decimal.Decimal - :ivar currency: The ISO currency in which the meter is charged, for - example, USD. - :vartype currency: str - :param charge_type: The type of the charge. Could be actual or forecast. - Possible values include: 'Actual', 'Forecast' - :type charge_type: str or ~azure.mgmt.consumption.models.ChargeType - :ivar confidence_levels: The details about the forecast confidence levels. - This is populated only when chargeType is Forecast. - :vartype confidence_levels: - list[~azure.mgmt.consumption.models.ForecastPropertiesConfidenceLevelsItem] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'tags': {'readonly': True}, - 'usage_date': {'readonly': True}, - 'charge': {'readonly': True}, - 'currency': {'readonly': True}, - 'confidence_levels': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'usage_date': {'key': 'properties.usageDate', 'type': 'str'}, - 'grain': {'key': 'properties.grain', 'type': 'str'}, - 'charge': {'key': 'properties.charge', 'type': 'decimal'}, - 'currency': {'key': 'properties.currency', 'type': 'str'}, - 'charge_type': {'key': 'properties.chargeType', 'type': 'str'}, - 'confidence_levels': {'key': 'properties.confidenceLevels', 'type': '[ForecastPropertiesConfidenceLevelsItem]'}, - } - - def __init__(self, *, grain=None, charge_type=None, **kwargs) -> None: - super(Forecast, self).__init__(**kwargs) - self.usage_date = None - self.grain = grain - self.charge = None - self.currency = None - self.charge_type = charge_type - self.confidence_levels = None diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/management_group_aggregated_cost_result.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/management_group_aggregated_cost_result.py deleted file mode 100644 index d44e542a0468..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/management_group_aggregated_cost_result.py +++ /dev/null @@ -1,100 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource import Resource - - -class ManagementGroupAggregatedCostResult(Resource): - """A management group aggregated cost resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar billing_period_id: The id of the billing period resource that the - aggregated cost belongs to. - :vartype billing_period_id: str - :ivar usage_start: The start of the date time range covered by aggregated - cost. - :vartype usage_start: datetime - :ivar usage_end: The end of the date time range covered by the aggregated - cost. - :vartype usage_end: datetime - :ivar azure_charges: Azure Charges. - :vartype azure_charges: decimal.Decimal - :ivar marketplace_charges: Marketplace Charges. - :vartype marketplace_charges: decimal.Decimal - :ivar charges_billed_separately: Charges Billed Separately. - :vartype charges_billed_separately: decimal.Decimal - :ivar currency: The ISO currency in which the meter is charged, for - example, USD. - :vartype currency: str - :param children: Children of a management group - :type children: - list[~azure.mgmt.consumption.models.ManagementGroupAggregatedCostResult] - :param included_subscriptions: List of subscription Guids included in the - calculation of aggregated cost - :type included_subscriptions: list[str] - :param excluded_subscriptions: List of subscription Guids excluded from - the calculation of aggregated cost - :type excluded_subscriptions: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'tags': {'readonly': True}, - 'billing_period_id': {'readonly': True}, - 'usage_start': {'readonly': True}, - 'usage_end': {'readonly': True}, - 'azure_charges': {'readonly': True}, - 'marketplace_charges': {'readonly': True}, - 'charges_billed_separately': {'readonly': True}, - 'currency': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'billing_period_id': {'key': 'properties.billingPeriodId', 'type': 'str'}, - 'usage_start': {'key': 'properties.usageStart', 'type': 'iso-8601'}, - 'usage_end': {'key': 'properties.usageEnd', 'type': 'iso-8601'}, - 'azure_charges': {'key': 'properties.azureCharges', 'type': 'decimal'}, - 'marketplace_charges': {'key': 'properties.marketplaceCharges', 'type': 'decimal'}, - 'charges_billed_separately': {'key': 'properties.chargesBilledSeparately', 'type': 'decimal'}, - 'currency': {'key': 'properties.currency', 'type': 'str'}, - 'children': {'key': 'properties.children', 'type': '[ManagementGroupAggregatedCostResult]'}, - 'included_subscriptions': {'key': 'properties.includedSubscriptions', 'type': '[str]'}, - 'excluded_subscriptions': {'key': 'properties.excludedSubscriptions', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(ManagementGroupAggregatedCostResult, self).__init__(**kwargs) - self.billing_period_id = None - self.usage_start = None - self.usage_end = None - self.azure_charges = None - self.marketplace_charges = None - self.charges_billed_separately = None - self.currency = None - self.children = kwargs.get('children', None) - self.included_subscriptions = kwargs.get('included_subscriptions', None) - self.excluded_subscriptions = kwargs.get('excluded_subscriptions', None) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/management_group_aggregated_cost_result_py3.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/management_group_aggregated_cost_result_py3.py deleted file mode 100644 index efd01f65232e..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/management_group_aggregated_cost_result_py3.py +++ /dev/null @@ -1,100 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource_py3 import Resource - - -class ManagementGroupAggregatedCostResult(Resource): - """A management group aggregated cost resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar billing_period_id: The id of the billing period resource that the - aggregated cost belongs to. - :vartype billing_period_id: str - :ivar usage_start: The start of the date time range covered by aggregated - cost. - :vartype usage_start: datetime - :ivar usage_end: The end of the date time range covered by the aggregated - cost. - :vartype usage_end: datetime - :ivar azure_charges: Azure Charges. - :vartype azure_charges: decimal.Decimal - :ivar marketplace_charges: Marketplace Charges. - :vartype marketplace_charges: decimal.Decimal - :ivar charges_billed_separately: Charges Billed Separately. - :vartype charges_billed_separately: decimal.Decimal - :ivar currency: The ISO currency in which the meter is charged, for - example, USD. - :vartype currency: str - :param children: Children of a management group - :type children: - list[~azure.mgmt.consumption.models.ManagementGroupAggregatedCostResult] - :param included_subscriptions: List of subscription Guids included in the - calculation of aggregated cost - :type included_subscriptions: list[str] - :param excluded_subscriptions: List of subscription Guids excluded from - the calculation of aggregated cost - :type excluded_subscriptions: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'tags': {'readonly': True}, - 'billing_period_id': {'readonly': True}, - 'usage_start': {'readonly': True}, - 'usage_end': {'readonly': True}, - 'azure_charges': {'readonly': True}, - 'marketplace_charges': {'readonly': True}, - 'charges_billed_separately': {'readonly': True}, - 'currency': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'billing_period_id': {'key': 'properties.billingPeriodId', 'type': 'str'}, - 'usage_start': {'key': 'properties.usageStart', 'type': 'iso-8601'}, - 'usage_end': {'key': 'properties.usageEnd', 'type': 'iso-8601'}, - 'azure_charges': {'key': 'properties.azureCharges', 'type': 'decimal'}, - 'marketplace_charges': {'key': 'properties.marketplaceCharges', 'type': 'decimal'}, - 'charges_billed_separately': {'key': 'properties.chargesBilledSeparately', 'type': 'decimal'}, - 'currency': {'key': 'properties.currency', 'type': 'str'}, - 'children': {'key': 'properties.children', 'type': '[ManagementGroupAggregatedCostResult]'}, - 'included_subscriptions': {'key': 'properties.includedSubscriptions', 'type': '[str]'}, - 'excluded_subscriptions': {'key': 'properties.excludedSubscriptions', 'type': '[str]'}, - } - - def __init__(self, *, children=None, included_subscriptions=None, excluded_subscriptions=None, **kwargs) -> None: - super(ManagementGroupAggregatedCostResult, self).__init__(**kwargs) - self.billing_period_id = None - self.usage_start = None - self.usage_end = None - self.azure_charges = None - self.marketplace_charges = None - self.charges_billed_separately = None - self.currency = None - self.children = children - self.included_subscriptions = included_subscriptions - self.excluded_subscriptions = excluded_subscriptions diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/marketplace.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/marketplace.py deleted file mode 100644 index 638fba19f244..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/marketplace.py +++ /dev/null @@ -1,180 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource import Resource - - -class Marketplace(Resource): - """An marketplace resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar billing_period_id: The id of the billing period resource that the - usage belongs to. - :vartype billing_period_id: str - :ivar usage_start: The start of the date time range covered by the usage - detail. - :vartype usage_start: datetime - :ivar usage_end: The end of the date time range covered by the usage - detail. - :vartype usage_end: datetime - :ivar resource_rate: The marketplace resource rate. - :vartype resource_rate: decimal.Decimal - :ivar offer_name: The type of offer. - :vartype offer_name: str - :ivar resource_group: The name of resource group. - :vartype resource_group: 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. - :vartype instance_name: str - :ivar instance_id: The uri of the resource instance that the usage is - about. - :vartype instance_id: str - :ivar currency: The ISO currency in which the meter is charged, for - example, USD. - :vartype currency: str - :ivar consumed_quantity: The quantity of usage. - :vartype consumed_quantity: decimal.Decimal - :ivar unit_of_measure: The unit of measure. - :vartype unit_of_measure: str - :ivar pretax_cost: The amount of cost before tax. - :vartype pretax_cost: decimal.Decimal - :ivar is_estimated: The estimated usage is subject to change. - :vartype is_estimated: bool - :ivar meter_id: The meter id (GUID). - :vartype meter_id: str - :ivar subscription_guid: Subscription guid. - :vartype subscription_guid: str - :ivar subscription_name: Subscription name. - :vartype subscription_name: str - :ivar account_name: Account name. - :vartype account_name: str - :ivar department_name: Department name. - :vartype department_name: str - :ivar consumed_service: Consumed service name. - :vartype consumed_service: str - :ivar cost_center: The cost center of this department if it is a - department and a costcenter exists - :vartype cost_center: str - :ivar additional_properties: Additional details of this usage item. By - default this is not populated, unless it's specified in $expand. - :vartype additional_properties: str - :ivar publisher_name: The name of publisher. - :vartype publisher_name: str - :ivar plan_name: The name of plan. - :vartype plan_name: str - :ivar is_recurring_charge: Flag indicating whether this is a recurring - charge or not. - :vartype is_recurring_charge: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'tags': {'readonly': True}, - 'billing_period_id': {'readonly': True}, - 'usage_start': {'readonly': True}, - 'usage_end': {'readonly': True}, - 'resource_rate': {'readonly': True}, - 'offer_name': {'readonly': True}, - 'resource_group': {'readonly': True}, - 'order_number': {'readonly': True}, - 'instance_name': {'readonly': True}, - 'instance_id': {'readonly': True}, - 'currency': {'readonly': True}, - 'consumed_quantity': {'readonly': True}, - 'unit_of_measure': {'readonly': True}, - 'pretax_cost': {'readonly': True}, - 'is_estimated': {'readonly': True}, - 'meter_id': {'readonly': True}, - 'subscription_guid': {'readonly': True}, - 'subscription_name': {'readonly': True}, - 'account_name': {'readonly': True}, - 'department_name': {'readonly': True}, - 'consumed_service': {'readonly': True}, - 'cost_center': {'readonly': True}, - 'additional_properties': {'readonly': True}, - 'publisher_name': {'readonly': True}, - 'plan_name': {'readonly': True}, - 'is_recurring_charge': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'billing_period_id': {'key': 'properties.billingPeriodId', 'type': 'str'}, - 'usage_start': {'key': 'properties.usageStart', 'type': 'iso-8601'}, - 'usage_end': {'key': 'properties.usageEnd', 'type': 'iso-8601'}, - 'resource_rate': {'key': 'properties.resourceRate', 'type': 'decimal'}, - 'offer_name': {'key': 'properties.offerName', 'type': 'str'}, - 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, - 'order_number': {'key': 'properties.orderNumber', 'type': 'str'}, - 'instance_name': {'key': 'properties.instanceName', 'type': 'str'}, - 'instance_id': {'key': 'properties.instanceId', 'type': 'str'}, - 'currency': {'key': 'properties.currency', 'type': 'str'}, - 'consumed_quantity': {'key': 'properties.consumedQuantity', 'type': 'decimal'}, - 'unit_of_measure': {'key': 'properties.unitOfMeasure', 'type': 'str'}, - 'pretax_cost': {'key': 'properties.pretaxCost', 'type': 'decimal'}, - 'is_estimated': {'key': 'properties.isEstimated', 'type': 'bool'}, - 'meter_id': {'key': 'properties.meterId', 'type': 'str'}, - 'subscription_guid': {'key': 'properties.subscriptionGuid', 'type': 'str'}, - 'subscription_name': {'key': 'properties.subscriptionName', 'type': 'str'}, - 'account_name': {'key': 'properties.accountName', 'type': 'str'}, - 'department_name': {'key': 'properties.departmentName', 'type': 'str'}, - 'consumed_service': {'key': 'properties.consumedService', 'type': 'str'}, - 'cost_center': {'key': 'properties.costCenter', 'type': 'str'}, - 'additional_properties': {'key': 'properties.additionalProperties', 'type': 'str'}, - 'publisher_name': {'key': 'properties.publisherName', 'type': 'str'}, - 'plan_name': {'key': 'properties.planName', 'type': 'str'}, - 'is_recurring_charge': {'key': 'properties.isRecurringCharge', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(Marketplace, self).__init__(**kwargs) - self.billing_period_id = None - self.usage_start = None - self.usage_end = None - self.resource_rate = None - self.offer_name = None - self.resource_group = None - self.order_number = None - self.instance_name = None - self.instance_id = None - self.currency = None - self.consumed_quantity = None - self.unit_of_measure = None - self.pretax_cost = None - self.is_estimated = None - self.meter_id = None - self.subscription_guid = None - self.subscription_name = None - self.account_name = None - self.department_name = None - self.consumed_service = None - self.cost_center = None - self.additional_properties = None - self.publisher_name = None - self.plan_name = None - self.is_recurring_charge = None diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/marketplace_paged.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/marketplace_paged.py deleted file mode 100644 index d360761aca55..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/marketplace_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class MarketplacePaged(Paged): - """ - A paging container for iterating over a list of :class:`Marketplace ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Marketplace]'} - } - - def __init__(self, *args, **kwargs): - - super(MarketplacePaged, self).__init__(*args, **kwargs) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/marketplace_py3.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/marketplace_py3.py deleted file mode 100644 index 776cec56d753..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/marketplace_py3.py +++ /dev/null @@ -1,180 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource_py3 import Resource - - -class Marketplace(Resource): - """An marketplace resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar billing_period_id: The id of the billing period resource that the - usage belongs to. - :vartype billing_period_id: str - :ivar usage_start: The start of the date time range covered by the usage - detail. - :vartype usage_start: datetime - :ivar usage_end: The end of the date time range covered by the usage - detail. - :vartype usage_end: datetime - :ivar resource_rate: The marketplace resource rate. - :vartype resource_rate: decimal.Decimal - :ivar offer_name: The type of offer. - :vartype offer_name: str - :ivar resource_group: The name of resource group. - :vartype resource_group: 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. - :vartype instance_name: str - :ivar instance_id: The uri of the resource instance that the usage is - about. - :vartype instance_id: str - :ivar currency: The ISO currency in which the meter is charged, for - example, USD. - :vartype currency: str - :ivar consumed_quantity: The quantity of usage. - :vartype consumed_quantity: decimal.Decimal - :ivar unit_of_measure: The unit of measure. - :vartype unit_of_measure: str - :ivar pretax_cost: The amount of cost before tax. - :vartype pretax_cost: decimal.Decimal - :ivar is_estimated: The estimated usage is subject to change. - :vartype is_estimated: bool - :ivar meter_id: The meter id (GUID). - :vartype meter_id: str - :ivar subscription_guid: Subscription guid. - :vartype subscription_guid: str - :ivar subscription_name: Subscription name. - :vartype subscription_name: str - :ivar account_name: Account name. - :vartype account_name: str - :ivar department_name: Department name. - :vartype department_name: str - :ivar consumed_service: Consumed service name. - :vartype consumed_service: str - :ivar cost_center: The cost center of this department if it is a - department and a costcenter exists - :vartype cost_center: str - :ivar additional_properties: Additional details of this usage item. By - default this is not populated, unless it's specified in $expand. - :vartype additional_properties: str - :ivar publisher_name: The name of publisher. - :vartype publisher_name: str - :ivar plan_name: The name of plan. - :vartype plan_name: str - :ivar is_recurring_charge: Flag indicating whether this is a recurring - charge or not. - :vartype is_recurring_charge: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'tags': {'readonly': True}, - 'billing_period_id': {'readonly': True}, - 'usage_start': {'readonly': True}, - 'usage_end': {'readonly': True}, - 'resource_rate': {'readonly': True}, - 'offer_name': {'readonly': True}, - 'resource_group': {'readonly': True}, - 'order_number': {'readonly': True}, - 'instance_name': {'readonly': True}, - 'instance_id': {'readonly': True}, - 'currency': {'readonly': True}, - 'consumed_quantity': {'readonly': True}, - 'unit_of_measure': {'readonly': True}, - 'pretax_cost': {'readonly': True}, - 'is_estimated': {'readonly': True}, - 'meter_id': {'readonly': True}, - 'subscription_guid': {'readonly': True}, - 'subscription_name': {'readonly': True}, - 'account_name': {'readonly': True}, - 'department_name': {'readonly': True}, - 'consumed_service': {'readonly': True}, - 'cost_center': {'readonly': True}, - 'additional_properties': {'readonly': True}, - 'publisher_name': {'readonly': True}, - 'plan_name': {'readonly': True}, - 'is_recurring_charge': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'billing_period_id': {'key': 'properties.billingPeriodId', 'type': 'str'}, - 'usage_start': {'key': 'properties.usageStart', 'type': 'iso-8601'}, - 'usage_end': {'key': 'properties.usageEnd', 'type': 'iso-8601'}, - 'resource_rate': {'key': 'properties.resourceRate', 'type': 'decimal'}, - 'offer_name': {'key': 'properties.offerName', 'type': 'str'}, - 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, - 'order_number': {'key': 'properties.orderNumber', 'type': 'str'}, - 'instance_name': {'key': 'properties.instanceName', 'type': 'str'}, - 'instance_id': {'key': 'properties.instanceId', 'type': 'str'}, - 'currency': {'key': 'properties.currency', 'type': 'str'}, - 'consumed_quantity': {'key': 'properties.consumedQuantity', 'type': 'decimal'}, - 'unit_of_measure': {'key': 'properties.unitOfMeasure', 'type': 'str'}, - 'pretax_cost': {'key': 'properties.pretaxCost', 'type': 'decimal'}, - 'is_estimated': {'key': 'properties.isEstimated', 'type': 'bool'}, - 'meter_id': {'key': 'properties.meterId', 'type': 'str'}, - 'subscription_guid': {'key': 'properties.subscriptionGuid', 'type': 'str'}, - 'subscription_name': {'key': 'properties.subscriptionName', 'type': 'str'}, - 'account_name': {'key': 'properties.accountName', 'type': 'str'}, - 'department_name': {'key': 'properties.departmentName', 'type': 'str'}, - 'consumed_service': {'key': 'properties.consumedService', 'type': 'str'}, - 'cost_center': {'key': 'properties.costCenter', 'type': 'str'}, - 'additional_properties': {'key': 'properties.additionalProperties', 'type': 'str'}, - 'publisher_name': {'key': 'properties.publisherName', 'type': 'str'}, - 'plan_name': {'key': 'properties.planName', 'type': 'str'}, - 'is_recurring_charge': {'key': 'properties.isRecurringCharge', 'type': 'bool'}, - } - - def __init__(self, **kwargs) -> None: - super(Marketplace, self).__init__(**kwargs) - self.billing_period_id = None - self.usage_start = None - self.usage_end = None - self.resource_rate = None - self.offer_name = None - self.resource_group = None - self.order_number = None - self.instance_name = None - self.instance_id = None - self.currency = None - self.consumed_quantity = None - self.unit_of_measure = None - self.pretax_cost = None - self.is_estimated = None - self.meter_id = None - self.subscription_guid = None - self.subscription_name = None - self.account_name = None - self.department_name = None - self.consumed_service = None - self.cost_center = None - self.additional_properties = None - self.publisher_name = None - self.plan_name = None - self.is_recurring_charge = None diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/meter_details.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/meter_details.py deleted file mode 100644 index c0cdb32756b0..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/meter_details.py +++ /dev/null @@ -1,80 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class MeterDetails(Model): - """The properties of the meter detail. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar meter_name: The name of the meter, within the given meter category - :vartype meter_name: str - :ivar meter_category: The category of the meter, for example, 'Cloud - services', 'Networking', etc.. - :vartype meter_category: str - :ivar meter_sub_category: The subcategory of the meter, for example, 'A6 - Cloud services', 'ExpressRoute (IXP)', etc.. - :vartype meter_sub_category: str - :ivar unit: The unit in which the meter consumption is charged, for - example, 'Hours', 'GB', etc. - :vartype unit: str - :ivar meter_location: The location in which the Azure service is - available. - :vartype meter_location: str - :ivar total_included_quantity: The total included quantity associated with - the offer. - :vartype total_included_quantity: decimal.Decimal - :ivar pretax_standard_rate: The pretax listing price. - :vartype pretax_standard_rate: decimal.Decimal - :ivar service_name: The name of the service. - :vartype service_name: str - :ivar service_tier: The service tier. - :vartype service_tier: str - """ - - _validation = { - 'meter_name': {'readonly': True}, - 'meter_category': {'readonly': True}, - 'meter_sub_category': {'readonly': True}, - 'unit': {'readonly': True}, - 'meter_location': {'readonly': True}, - 'total_included_quantity': {'readonly': True}, - 'pretax_standard_rate': {'readonly': True}, - 'service_name': {'readonly': True}, - 'service_tier': {'readonly': True}, - } - - _attribute_map = { - 'meter_name': {'key': 'meterName', 'type': 'str'}, - 'meter_category': {'key': 'meterCategory', 'type': 'str'}, - 'meter_sub_category': {'key': 'meterSubCategory', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'meter_location': {'key': 'meterLocation', 'type': 'str'}, - 'total_included_quantity': {'key': 'totalIncludedQuantity', 'type': 'decimal'}, - 'pretax_standard_rate': {'key': 'pretaxStandardRate', 'type': 'decimal'}, - 'service_name': {'key': 'serviceName', 'type': 'str'}, - 'service_tier': {'key': 'serviceTier', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(MeterDetails, self).__init__(**kwargs) - self.meter_name = None - self.meter_category = None - self.meter_sub_category = None - self.unit = None - self.meter_location = None - self.total_included_quantity = None - self.pretax_standard_rate = None - self.service_name = None - self.service_tier = None diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/meter_details_py3.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/meter_details_py3.py deleted file mode 100644 index c7b6c8a43a47..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/meter_details_py3.py +++ /dev/null @@ -1,80 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class MeterDetails(Model): - """The properties of the meter detail. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar meter_name: The name of the meter, within the given meter category - :vartype meter_name: str - :ivar meter_category: The category of the meter, for example, 'Cloud - services', 'Networking', etc.. - :vartype meter_category: str - :ivar meter_sub_category: The subcategory of the meter, for example, 'A6 - Cloud services', 'ExpressRoute (IXP)', etc.. - :vartype meter_sub_category: str - :ivar unit: The unit in which the meter consumption is charged, for - example, 'Hours', 'GB', etc. - :vartype unit: str - :ivar meter_location: The location in which the Azure service is - available. - :vartype meter_location: str - :ivar total_included_quantity: The total included quantity associated with - the offer. - :vartype total_included_quantity: decimal.Decimal - :ivar pretax_standard_rate: The pretax listing price. - :vartype pretax_standard_rate: decimal.Decimal - :ivar service_name: The name of the service. - :vartype service_name: str - :ivar service_tier: The service tier. - :vartype service_tier: str - """ - - _validation = { - 'meter_name': {'readonly': True}, - 'meter_category': {'readonly': True}, - 'meter_sub_category': {'readonly': True}, - 'unit': {'readonly': True}, - 'meter_location': {'readonly': True}, - 'total_included_quantity': {'readonly': True}, - 'pretax_standard_rate': {'readonly': True}, - 'service_name': {'readonly': True}, - 'service_tier': {'readonly': True}, - } - - _attribute_map = { - 'meter_name': {'key': 'meterName', 'type': 'str'}, - 'meter_category': {'key': 'meterCategory', 'type': 'str'}, - 'meter_sub_category': {'key': 'meterSubCategory', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'meter_location': {'key': 'meterLocation', 'type': 'str'}, - 'total_included_quantity': {'key': 'totalIncludedQuantity', 'type': 'decimal'}, - 'pretax_standard_rate': {'key': 'pretaxStandardRate', 'type': 'decimal'}, - 'service_name': {'key': 'serviceName', 'type': 'str'}, - 'service_tier': {'key': 'serviceTier', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(MeterDetails, self).__init__(**kwargs) - self.meter_name = None - self.meter_category = None - self.meter_sub_category = None - self.unit = None - self.meter_location = None - self.total_included_quantity = None - self.pretax_standard_rate = None - self.service_name = None - self.service_tier = None diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/meter_details_response.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/meter_details_response.py deleted file mode 100644 index 2b7625a1587d..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/meter_details_response.py +++ /dev/null @@ -1,58 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class MeterDetailsResponse(Model): - """The properties of the meter detail. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar meter_name: The name of the meter, within the given meter category - :vartype meter_name: str - :ivar meter_category: The category of the meter, for example, 'Cloud - services', 'Networking', etc.. - :vartype meter_category: str - :ivar meter_sub_category: The subcategory of the meter, for example, 'A6 - Cloud services', 'ExpressRoute (IXP)', etc.. - :vartype meter_sub_category: str - :ivar unit_of_measure: The unit in which the meter consumption is charged, - for example, 'Hours', 'GB', etc. - :vartype unit_of_measure: str - :ivar service_family: The service family. - :vartype service_family: str - """ - - _validation = { - 'meter_name': {'readonly': True}, - 'meter_category': {'readonly': True}, - 'meter_sub_category': {'readonly': True}, - 'unit_of_measure': {'readonly': True}, - 'service_family': {'readonly': True}, - } - - _attribute_map = { - 'meter_name': {'key': 'meterName', 'type': 'str'}, - 'meter_category': {'key': 'meterCategory', 'type': 'str'}, - 'meter_sub_category': {'key': 'meterSubCategory', 'type': 'str'}, - 'unit_of_measure': {'key': 'unitOfMeasure', 'type': 'str'}, - 'service_family': {'key': 'serviceFamily', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(MeterDetailsResponse, self).__init__(**kwargs) - self.meter_name = None - self.meter_category = None - self.meter_sub_category = None - self.unit_of_measure = None - self.service_family = None diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/meter_details_response_py3.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/meter_details_response_py3.py deleted file mode 100644 index 37f55c450ded..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/meter_details_response_py3.py +++ /dev/null @@ -1,58 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class MeterDetailsResponse(Model): - """The properties of the meter detail. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar meter_name: The name of the meter, within the given meter category - :vartype meter_name: str - :ivar meter_category: The category of the meter, for example, 'Cloud - services', 'Networking', etc.. - :vartype meter_category: str - :ivar meter_sub_category: The subcategory of the meter, for example, 'A6 - Cloud services', 'ExpressRoute (IXP)', etc.. - :vartype meter_sub_category: str - :ivar unit_of_measure: The unit in which the meter consumption is charged, - for example, 'Hours', 'GB', etc. - :vartype unit_of_measure: str - :ivar service_family: The service family. - :vartype service_family: str - """ - - _validation = { - 'meter_name': {'readonly': True}, - 'meter_category': {'readonly': True}, - 'meter_sub_category': {'readonly': True}, - 'unit_of_measure': {'readonly': True}, - 'service_family': {'readonly': True}, - } - - _attribute_map = { - 'meter_name': {'key': 'meterName', 'type': 'str'}, - 'meter_category': {'key': 'meterCategory', 'type': 'str'}, - 'meter_sub_category': {'key': 'meterSubCategory', 'type': 'str'}, - 'unit_of_measure': {'key': 'unitOfMeasure', 'type': 'str'}, - 'service_family': {'key': 'serviceFamily', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(MeterDetailsResponse, self).__init__(**kwargs) - self.meter_name = None - self.meter_category = None - self.meter_sub_category = None - self.unit_of_measure = None - self.service_family = None diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/notification.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/notification.py deleted file mode 100644 index c50dc6aa4dc2..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/notification.py +++ /dev/null @@ -1,64 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Notification(Model): - """The notification associated with a budget. - - All required parameters must be populated in order to send to Azure. - - :param enabled: Required. The notification is enabled or not. - :type enabled: bool - :param operator: Required. The comparison operator. Possible values - include: 'EqualTo', 'GreaterThan', 'GreaterThanOrEqualTo' - :type operator: str or ~azure.mgmt.consumption.models.OperatorType - :param threshold: Required. Threshold value associated with a - notification. Notification is sent when the cost exceeded the threshold. - It is always percent and has to be between 0 and 1000. - :type threshold: decimal.Decimal - :param contact_emails: Required. Email addresses to send the budget - notification to when the threshold is exceeded. - :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. - :type contact_groups: list[str] - """ - - _validation = { - 'enabled': {'required': True}, - 'operator': {'required': True}, - 'threshold': {'required': True}, - 'contact_emails': {'required': True, 'max_items': 50, 'min_items': 1}, - 'contact_groups': {'max_items': 50, 'min_items': 0}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'operator': {'key': 'operator', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'decimal'}, - 'contact_emails': {'key': 'contactEmails', 'type': '[str]'}, - 'contact_roles': {'key': 'contactRoles', 'type': '[str]'}, - 'contact_groups': {'key': 'contactGroups', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(Notification, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) - self.operator = kwargs.get('operator', None) - self.threshold = kwargs.get('threshold', None) - self.contact_emails = kwargs.get('contact_emails', None) - self.contact_roles = kwargs.get('contact_roles', None) - self.contact_groups = kwargs.get('contact_groups', None) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/notification_py3.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/notification_py3.py deleted file mode 100644 index 6dfc794e2477..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/notification_py3.py +++ /dev/null @@ -1,64 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Notification(Model): - """The notification associated with a budget. - - All required parameters must be populated in order to send to Azure. - - :param enabled: Required. The notification is enabled or not. - :type enabled: bool - :param operator: Required. The comparison operator. Possible values - include: 'EqualTo', 'GreaterThan', 'GreaterThanOrEqualTo' - :type operator: str or ~azure.mgmt.consumption.models.OperatorType - :param threshold: Required. Threshold value associated with a - notification. Notification is sent when the cost exceeded the threshold. - It is always percent and has to be between 0 and 1000. - :type threshold: decimal.Decimal - :param contact_emails: Required. Email addresses to send the budget - notification to when the threshold is exceeded. - :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. - :type contact_groups: list[str] - """ - - _validation = { - 'enabled': {'required': True}, - 'operator': {'required': True}, - 'threshold': {'required': True}, - 'contact_emails': {'required': True, 'max_items': 50, 'min_items': 1}, - 'contact_groups': {'max_items': 50, 'min_items': 0}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'operator': {'key': 'operator', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'decimal'}, - 'contact_emails': {'key': 'contactEmails', 'type': '[str]'}, - 'contact_roles': {'key': 'contactRoles', 'type': '[str]'}, - 'contact_groups': {'key': 'contactGroups', 'type': '[str]'}, - } - - def __init__(self, *, enabled: bool, operator, threshold, contact_emails, contact_roles=None, contact_groups=None, **kwargs) -> None: - super(Notification, self).__init__(**kwargs) - self.enabled = enabled - self.operator = operator - self.threshold = threshold - self.contact_emails = contact_emails - self.contact_roles = contact_roles - self.contact_groups = contact_groups diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/operation.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/operation.py deleted file mode 100644 index 4c9c35d9d03e..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/operation.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Operation(Model): - """A Consumption REST API operation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name: Operation name: {provider}/{resource}/{operation}. - :vartype name: str - :param display: The object that represents the operation. - :type display: ~azure.mgmt.consumption.models.OperationDisplay - """ - - _validation = { - 'name': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - } - - def __init__(self, **kwargs): - super(Operation, self).__init__(**kwargs) - self.name = None - self.display = kwargs.get('display', None) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/operation_display.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/operation_display.py deleted file mode 100644 index 5a1143b805e0..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/operation_display.py +++ /dev/null @@ -1,46 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class OperationDisplay(Model): - """The object that represents the operation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar provider: Service provider: Microsoft.Consumption. - :vartype provider: str - :ivar resource: Resource on which the operation is performed: UsageDetail, - etc. - :vartype resource: str - :ivar operation: Operation type: Read, write, delete, etc. - :vartype operation: str - """ - - _validation = { - 'provider': {'readonly': True}, - 'resource': {'readonly': True}, - 'operation': {'readonly': True}, - } - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(OperationDisplay, self).__init__(**kwargs) - self.provider = None - self.resource = None - self.operation = None diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/operation_display_py3.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/operation_display_py3.py deleted file mode 100644 index c5fe954f04a4..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/operation_display_py3.py +++ /dev/null @@ -1,46 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class OperationDisplay(Model): - """The object that represents the operation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar provider: Service provider: Microsoft.Consumption. - :vartype provider: str - :ivar resource: Resource on which the operation is performed: UsageDetail, - etc. - :vartype resource: str - :ivar operation: Operation type: Read, write, delete, etc. - :vartype operation: str - """ - - _validation = { - 'provider': {'readonly': True}, - 'resource': {'readonly': True}, - 'operation': {'readonly': True}, - } - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(OperationDisplay, self).__init__(**kwargs) - self.provider = None - self.resource = None - self.operation = None diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/operation_paged.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/operation_paged.py deleted file mode 100644 index 5d69a3bf3ca3..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/operation_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class OperationPaged(Paged): - """ - A paging container for iterating over a list of :class:`Operation ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Operation]'} - } - - def __init__(self, *args, **kwargs): - - super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/operation_py3.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/operation_py3.py deleted file mode 100644 index 93b8aa1bebad..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/operation_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Operation(Model): - """A Consumption REST API operation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name: Operation name: {provider}/{resource}/{operation}. - :vartype name: str - :param display: The object that represents the operation. - :type display: ~azure.mgmt.consumption.models.OperationDisplay - """ - - _validation = { - 'name': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - } - - def __init__(self, *, display=None, **kwargs) -> None: - super(Operation, self).__init__(**kwargs) - self.name = None - self.display = display diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/price_sheet_properties.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/price_sheet_properties.py deleted file mode 100644 index 7bf1bc6b770d..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/price_sheet_properties.py +++ /dev/null @@ -1,77 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class PriceSheetProperties(Model): - """The properties of the price sheet. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar billing_period_id: The id of the billing period resource that the - usage belongs to. - :vartype billing_period_id: str - :ivar meter_id: The meter id (GUID) - :vartype meter_id: str - :ivar meter_details: The details about the meter. By default this is not - populated, unless it's specified in $expand. - :vartype meter_details: ~azure.mgmt.consumption.models.MeterDetails - :ivar unit_of_measure: Unit of measure - :vartype unit_of_measure: str - :ivar included_quantity: Included quality for an offer - :vartype included_quantity: decimal.Decimal - :ivar part_number: Part Number - :vartype part_number: str - :ivar unit_price: Unit Price - :vartype unit_price: decimal.Decimal - :ivar currency_code: Currency Code - :vartype currency_code: str - :ivar offer_id: Offer Id - :vartype offer_id: str - """ - - _validation = { - 'billing_period_id': {'readonly': True}, - 'meter_id': {'readonly': True}, - 'meter_details': {'readonly': True}, - 'unit_of_measure': {'readonly': True}, - 'included_quantity': {'readonly': True}, - 'part_number': {'readonly': True}, - 'unit_price': {'readonly': True}, - 'currency_code': {'readonly': True}, - 'offer_id': {'readonly': True}, - } - - _attribute_map = { - 'billing_period_id': {'key': 'billingPeriodId', 'type': 'str'}, - 'meter_id': {'key': 'meterId', 'type': 'str'}, - 'meter_details': {'key': 'meterDetails', 'type': 'MeterDetails'}, - 'unit_of_measure': {'key': 'unitOfMeasure', 'type': 'str'}, - 'included_quantity': {'key': 'includedQuantity', 'type': 'decimal'}, - 'part_number': {'key': 'partNumber', 'type': 'str'}, - 'unit_price': {'key': 'unitPrice', 'type': 'decimal'}, - 'currency_code': {'key': 'currencyCode', 'type': 'str'}, - 'offer_id': {'key': 'offerId', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(PriceSheetProperties, self).__init__(**kwargs) - self.billing_period_id = None - self.meter_id = None - self.meter_details = None - self.unit_of_measure = None - self.included_quantity = None - self.part_number = None - self.unit_price = None - self.currency_code = None - self.offer_id = None diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/price_sheet_properties_py3.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/price_sheet_properties_py3.py deleted file mode 100644 index eef5a80d3d23..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/price_sheet_properties_py3.py +++ /dev/null @@ -1,77 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class PriceSheetProperties(Model): - """The properties of the price sheet. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar billing_period_id: The id of the billing period resource that the - usage belongs to. - :vartype billing_period_id: str - :ivar meter_id: The meter id (GUID) - :vartype meter_id: str - :ivar meter_details: The details about the meter. By default this is not - populated, unless it's specified in $expand. - :vartype meter_details: ~azure.mgmt.consumption.models.MeterDetails - :ivar unit_of_measure: Unit of measure - :vartype unit_of_measure: str - :ivar included_quantity: Included quality for an offer - :vartype included_quantity: decimal.Decimal - :ivar part_number: Part Number - :vartype part_number: str - :ivar unit_price: Unit Price - :vartype unit_price: decimal.Decimal - :ivar currency_code: Currency Code - :vartype currency_code: str - :ivar offer_id: Offer Id - :vartype offer_id: str - """ - - _validation = { - 'billing_period_id': {'readonly': True}, - 'meter_id': {'readonly': True}, - 'meter_details': {'readonly': True}, - 'unit_of_measure': {'readonly': True}, - 'included_quantity': {'readonly': True}, - 'part_number': {'readonly': True}, - 'unit_price': {'readonly': True}, - 'currency_code': {'readonly': True}, - 'offer_id': {'readonly': True}, - } - - _attribute_map = { - 'billing_period_id': {'key': 'billingPeriodId', 'type': 'str'}, - 'meter_id': {'key': 'meterId', 'type': 'str'}, - 'meter_details': {'key': 'meterDetails', 'type': 'MeterDetails'}, - 'unit_of_measure': {'key': 'unitOfMeasure', 'type': 'str'}, - 'included_quantity': {'key': 'includedQuantity', 'type': 'decimal'}, - 'part_number': {'key': 'partNumber', 'type': 'str'}, - 'unit_price': {'key': 'unitPrice', 'type': 'decimal'}, - 'currency_code': {'key': 'currencyCode', 'type': 'str'}, - 'offer_id': {'key': 'offerId', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(PriceSheetProperties, self).__init__(**kwargs) - self.billing_period_id = None - self.meter_id = None - self.meter_details = None - self.unit_of_measure = None - self.included_quantity = None - self.part_number = None - self.unit_price = None - self.currency_code = None - self.offer_id = None diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/price_sheet_result.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/price_sheet_result.py deleted file mode 100644 index e4b536b687b7..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/price_sheet_result.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource import Resource - - -class PriceSheetResult(Resource): - """An pricesheet resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar tags: 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 - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'tags': {'readonly': True}, - 'pricesheets': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'pricesheets': {'key': 'properties.pricesheets', 'type': '[PriceSheetProperties]'}, - 'next_link': {'key': 'properties.nextLink', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(PriceSheetResult, self).__init__(**kwargs) - self.pricesheets = None - self.next_link = None diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/price_sheet_result_py3.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/price_sheet_result_py3.py deleted file mode 100644 index aef94bda9c36..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/price_sheet_result_py3.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource_py3 import Resource - - -class PriceSheetResult(Resource): - """An pricesheet resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar tags: 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 - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'tags': {'readonly': True}, - 'pricesheets': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'pricesheets': {'key': 'properties.pricesheets', 'type': '[PriceSheetProperties]'}, - 'next_link': {'key': 'properties.nextLink', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(PriceSheetResult, self).__init__(**kwargs) - self.pricesheets = None - self.next_link = None diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/proxy_resource.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/proxy_resource.py deleted file mode 100644 index fd2230311017..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/proxy_resource.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ProxyResource(Model): - """The Resource model definition. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param e_tag: eTag of the resource. To handle concurrent update scenario, - this field will be used to determine whether the user is updating the - latest version or not. - :type e_tag: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'e_tag': {'key': 'eTag', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ProxyResource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.e_tag = kwargs.get('e_tag', None) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/proxy_resource_py3.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/proxy_resource_py3.py deleted file mode 100644 index 7fc6bf7e970c..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/proxy_resource_py3.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ProxyResource(Model): - """The Resource model definition. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param e_tag: eTag of the resource. To handle concurrent update scenario, - this field will be used to determine whether the user is updating the - latest version or not. - :type e_tag: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'e_tag': {'key': 'eTag', 'type': 'str'}, - } - - def __init__(self, *, e_tag: str=None, **kwargs) -> None: - super(ProxyResource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.e_tag = e_tag diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/reservation_detail.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/reservation_detail.py deleted file mode 100644 index 434326f37c82..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/reservation_detail.py +++ /dev/null @@ -1,97 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource import Resource - - -class ReservationDetail(Resource): - """reservation detail resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar reservation_order_id: The reservation order ID is the identifier for - a reservation purchase. Each reservation order ID represents a single - purchase transaction. A reservation order contains reservations. The - reservation order specifies the VM size and region for the reservations. - :vartype reservation_order_id: str - :ivar reservation_id: The reservation ID is the identifier of a - reservation within a reservation order. Each reservation is the grouping - for applying the benefit scope and also specifies the number of instances - to which the reservation benefit can be applied to. - :vartype reservation_id: str - :ivar sku_name: This is the ARM Sku name. It can be used to join with the - serviceType field in additional info in usage records. - :vartype sku_name: str - :ivar reserved_hours: This is the total hours reserved for the day. E.g. - if reservation for 1 instance was made on 1 PM, this will be 11 hours for - that day and 24 hours from subsequent days. - :vartype reserved_hours: decimal.Decimal - :ivar usage_date: The date on which consumption occurred. - :vartype usage_date: datetime - :ivar used_hours: This is the total hours used by the instance. - :vartype used_hours: decimal.Decimal - :ivar instance_id: This identifier is the name of the resource or the - fully qualified Resource ID. - :vartype instance_id: str - :ivar total_reserved_quantity: This is the total count of instances that - are reserved for the reservationId. - :vartype total_reserved_quantity: decimal.Decimal - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'tags': {'readonly': True}, - 'reservation_order_id': {'readonly': True}, - 'reservation_id': {'readonly': True}, - 'sku_name': {'readonly': True}, - 'reserved_hours': {'readonly': True}, - 'usage_date': {'readonly': True}, - 'used_hours': {'readonly': True}, - 'instance_id': {'readonly': True}, - 'total_reserved_quantity': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'reservation_order_id': {'key': 'properties.reservationOrderId', 'type': 'str'}, - 'reservation_id': {'key': 'properties.reservationId', 'type': 'str'}, - 'sku_name': {'key': 'properties.skuName', 'type': 'str'}, - 'reserved_hours': {'key': 'properties.reservedHours', 'type': 'decimal'}, - 'usage_date': {'key': 'properties.usageDate', 'type': 'iso-8601'}, - 'used_hours': {'key': 'properties.usedHours', 'type': 'decimal'}, - 'instance_id': {'key': 'properties.instanceId', 'type': 'str'}, - 'total_reserved_quantity': {'key': 'properties.totalReservedQuantity', 'type': 'decimal'}, - } - - def __init__(self, **kwargs): - super(ReservationDetail, self).__init__(**kwargs) - self.reservation_order_id = None - self.reservation_id = None - self.sku_name = None - self.reserved_hours = None - self.usage_date = None - self.used_hours = None - self.instance_id = None - self.total_reserved_quantity = None diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/reservation_detail_paged.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/reservation_detail_paged.py deleted file mode 100644 index 5b596c3df721..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/reservation_detail_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class ReservationDetailPaged(Paged): - """ - A paging container for iterating over a list of :class:`ReservationDetail ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ReservationDetail]'} - } - - def __init__(self, *args, **kwargs): - - super(ReservationDetailPaged, self).__init__(*args, **kwargs) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/reservation_detail_py3.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/reservation_detail_py3.py deleted file mode 100644 index b88fccac1663..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/reservation_detail_py3.py +++ /dev/null @@ -1,97 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource_py3 import Resource - - -class ReservationDetail(Resource): - """reservation detail resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar reservation_order_id: The reservation order ID is the identifier for - a reservation purchase. Each reservation order ID represents a single - purchase transaction. A reservation order contains reservations. The - reservation order specifies the VM size and region for the reservations. - :vartype reservation_order_id: str - :ivar reservation_id: The reservation ID is the identifier of a - reservation within a reservation order. Each reservation is the grouping - for applying the benefit scope and also specifies the number of instances - to which the reservation benefit can be applied to. - :vartype reservation_id: str - :ivar sku_name: This is the ARM Sku name. It can be used to join with the - serviceType field in additional info in usage records. - :vartype sku_name: str - :ivar reserved_hours: This is the total hours reserved for the day. E.g. - if reservation for 1 instance was made on 1 PM, this will be 11 hours for - that day and 24 hours from subsequent days. - :vartype reserved_hours: decimal.Decimal - :ivar usage_date: The date on which consumption occurred. - :vartype usage_date: datetime - :ivar used_hours: This is the total hours used by the instance. - :vartype used_hours: decimal.Decimal - :ivar instance_id: This identifier is the name of the resource or the - fully qualified Resource ID. - :vartype instance_id: str - :ivar total_reserved_quantity: This is the total count of instances that - are reserved for the reservationId. - :vartype total_reserved_quantity: decimal.Decimal - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'tags': {'readonly': True}, - 'reservation_order_id': {'readonly': True}, - 'reservation_id': {'readonly': True}, - 'sku_name': {'readonly': True}, - 'reserved_hours': {'readonly': True}, - 'usage_date': {'readonly': True}, - 'used_hours': {'readonly': True}, - 'instance_id': {'readonly': True}, - 'total_reserved_quantity': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'reservation_order_id': {'key': 'properties.reservationOrderId', 'type': 'str'}, - 'reservation_id': {'key': 'properties.reservationId', 'type': 'str'}, - 'sku_name': {'key': 'properties.skuName', 'type': 'str'}, - 'reserved_hours': {'key': 'properties.reservedHours', 'type': 'decimal'}, - 'usage_date': {'key': 'properties.usageDate', 'type': 'iso-8601'}, - 'used_hours': {'key': 'properties.usedHours', 'type': 'decimal'}, - 'instance_id': {'key': 'properties.instanceId', 'type': 'str'}, - 'total_reserved_quantity': {'key': 'properties.totalReservedQuantity', 'type': 'decimal'}, - } - - def __init__(self, **kwargs) -> None: - super(ReservationDetail, self).__init__(**kwargs) - self.reservation_order_id = None - self.reservation_id = None - self.sku_name = None - self.reserved_hours = None - self.usage_date = None - self.used_hours = None - self.instance_id = None - self.total_reserved_quantity = None diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/reservation_recommendation.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/reservation_recommendation.py deleted file mode 100644 index 45a36151f6f8..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/reservation_recommendation.py +++ /dev/null @@ -1,108 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ReservationRecommendation(Model): - """Reservation recommendation resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: Resource location - :vartype location: str - :ivar sku: Resource sku - :vartype sku: str - :ivar look_back_period: The number of days of usage to look back for - recommendation. - :vartype look_back_period: str - :ivar meter_id: The meter id (GUID) - :vartype meter_id: 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. - :vartype cost_with_no_reserved_instances: decimal.Decimal - :ivar recommended_quantity: Recommended quality for reserved instances. - :vartype recommended_quantity: decimal.Decimal - :ivar total_cost_with_reserved_instances: The total amount of cost with - reserved instances. - :vartype total_cost_with_reserved_instances: decimal.Decimal - :ivar net_savings: Total estimated savings with reserved instances. - :vartype net_savings: decimal.Decimal - :ivar first_usage_date: The usage date for looking back. - :vartype first_usage_date: datetime - :ivar scope: Shared or single recommendation. - :vartype scope: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'tags': {'readonly': True}, - 'location': {'readonly': True}, - 'sku': {'readonly': True}, - 'look_back_period': {'readonly': True}, - 'meter_id': {'readonly': True}, - 'term': {'readonly': True}, - 'cost_with_no_reserved_instances': {'readonly': True}, - 'recommended_quantity': {'readonly': True}, - 'total_cost_with_reserved_instances': {'readonly': True}, - 'net_savings': {'readonly': True}, - 'first_usage_date': {'readonly': True}, - 'scope': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'str'}, - 'look_back_period': {'key': 'properties.lookBackPeriod', 'type': 'str'}, - 'meter_id': {'key': 'properties.meterId', 'type': 'str'}, - 'term': {'key': 'properties.term', 'type': 'str'}, - 'cost_with_no_reserved_instances': {'key': 'properties.costWithNoReservedInstances', 'type': 'decimal'}, - 'recommended_quantity': {'key': 'properties.recommendedQuantity', 'type': 'decimal'}, - 'total_cost_with_reserved_instances': {'key': 'properties.totalCostWithReservedInstances', 'type': 'decimal'}, - 'net_savings': {'key': 'properties.netSavings', 'type': 'decimal'}, - 'first_usage_date': {'key': 'properties.firstUsageDate', 'type': 'iso-8601'}, - 'scope': {'key': 'properties.scope', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ReservationRecommendation, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.tags = None - self.location = None - self.sku = None - self.look_back_period = None - self.meter_id = None - self.term = None - self.cost_with_no_reserved_instances = None - self.recommended_quantity = None - self.total_cost_with_reserved_instances = None - self.net_savings = None - self.first_usage_date = None - self.scope = None diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/reservation_recommendation_paged.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/reservation_recommendation_paged.py deleted file mode 100644 index db7d155ade36..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/reservation_recommendation_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class ReservationRecommendationPaged(Paged): - """ - A paging container for iterating over a list of :class:`ReservationRecommendation ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ReservationRecommendation]'} - } - - def __init__(self, *args, **kwargs): - - super(ReservationRecommendationPaged, self).__init__(*args, **kwargs) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/reservation_recommendation_py3.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/reservation_recommendation_py3.py deleted file mode 100644 index 267d8195d4a1..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/reservation_recommendation_py3.py +++ /dev/null @@ -1,108 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ReservationRecommendation(Model): - """Reservation recommendation resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: Resource location - :vartype location: str - :ivar sku: Resource sku - :vartype sku: str - :ivar look_back_period: The number of days of usage to look back for - recommendation. - :vartype look_back_period: str - :ivar meter_id: The meter id (GUID) - :vartype meter_id: 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. - :vartype cost_with_no_reserved_instances: decimal.Decimal - :ivar recommended_quantity: Recommended quality for reserved instances. - :vartype recommended_quantity: decimal.Decimal - :ivar total_cost_with_reserved_instances: The total amount of cost with - reserved instances. - :vartype total_cost_with_reserved_instances: decimal.Decimal - :ivar net_savings: Total estimated savings with reserved instances. - :vartype net_savings: decimal.Decimal - :ivar first_usage_date: The usage date for looking back. - :vartype first_usage_date: datetime - :ivar scope: Shared or single recommendation. - :vartype scope: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'tags': {'readonly': True}, - 'location': {'readonly': True}, - 'sku': {'readonly': True}, - 'look_back_period': {'readonly': True}, - 'meter_id': {'readonly': True}, - 'term': {'readonly': True}, - 'cost_with_no_reserved_instances': {'readonly': True}, - 'recommended_quantity': {'readonly': True}, - 'total_cost_with_reserved_instances': {'readonly': True}, - 'net_savings': {'readonly': True}, - 'first_usage_date': {'readonly': True}, - 'scope': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'str'}, - 'look_back_period': {'key': 'properties.lookBackPeriod', 'type': 'str'}, - 'meter_id': {'key': 'properties.meterId', 'type': 'str'}, - 'term': {'key': 'properties.term', 'type': 'str'}, - 'cost_with_no_reserved_instances': {'key': 'properties.costWithNoReservedInstances', 'type': 'decimal'}, - 'recommended_quantity': {'key': 'properties.recommendedQuantity', 'type': 'decimal'}, - 'total_cost_with_reserved_instances': {'key': 'properties.totalCostWithReservedInstances', 'type': 'decimal'}, - 'net_savings': {'key': 'properties.netSavings', 'type': 'decimal'}, - 'first_usage_date': {'key': 'properties.firstUsageDate', 'type': 'iso-8601'}, - 'scope': {'key': 'properties.scope', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(ReservationRecommendation, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.tags = None - self.location = None - self.sku = None - self.look_back_period = None - self.meter_id = None - self.term = None - self.cost_with_no_reserved_instances = None - self.recommended_quantity = None - self.total_cost_with_reserved_instances = None - self.net_savings = None - self.first_usage_date = None - self.scope = None diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/reservation_summary.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/reservation_summary.py deleted file mode 100644 index 3d60ffb73ba0..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/reservation_summary.py +++ /dev/null @@ -1,108 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource import Resource - - -class ReservationSummary(Resource): - """reservation summary resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar reservation_order_id: The reservation order ID is the identifier for - a reservation purchase. Each reservation order ID represents a single - purchase transaction. A reservation order contains reservations. The - reservation order specifies the VM size and region for the reservations. - :vartype reservation_order_id: str - :ivar reservation_id: The reservation ID is the identifier of a - reservation within a reservation order. Each reservation is the grouping - for applying the benefit scope and also specifies the number of instances - to which the reservation benefit can be applied to. - :vartype reservation_id: str - :ivar sku_name: This is the ARM Sku name. It can be used to join with the - serviceType field in additional info in usage records. - :vartype sku_name: str - :ivar reserved_hours: This is the total hours reserved. E.g. if - reservation for 1 instance was made on 1 PM, this will be 11 hours for - that day and 24 hours from subsequent days - :vartype reserved_hours: decimal.Decimal - :ivar usage_date: Data corresponding to the utilization record. If the - grain of data is monthly, it will be first day of month. - :vartype usage_date: datetime - :ivar used_hours: Total used hours by the reservation - :vartype used_hours: decimal.Decimal - :ivar min_utilization_percentage: This is the minimum hourly utilization - in the usage time (day or month). E.g. if usage record corresponds to - 12/10/2017 and on that for hour 4 and 5, utilization was 10%, this field - will return 10% for that day - :vartype min_utilization_percentage: decimal.Decimal - :ivar avg_utilization_percentage: This is average utilization for the - entire time range. (day or month depending on the grain) - :vartype avg_utilization_percentage: decimal.Decimal - :ivar max_utilization_percentage: This is the maximum hourly utilization - in the usage time (day or month). E.g. if usage record corresponds to - 12/10/2017 and on that for hour 4 and 5, utilization was 100%, this field - will return 100% for that day. - :vartype max_utilization_percentage: decimal.Decimal - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'tags': {'readonly': True}, - 'reservation_order_id': {'readonly': True}, - 'reservation_id': {'readonly': True}, - 'sku_name': {'readonly': True}, - 'reserved_hours': {'readonly': True}, - 'usage_date': {'readonly': True}, - 'used_hours': {'readonly': True}, - 'min_utilization_percentage': {'readonly': True}, - 'avg_utilization_percentage': {'readonly': True}, - 'max_utilization_percentage': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'reservation_order_id': {'key': 'properties.reservationOrderId', 'type': 'str'}, - 'reservation_id': {'key': 'properties.reservationId', 'type': 'str'}, - 'sku_name': {'key': 'properties.skuName', 'type': 'str'}, - 'reserved_hours': {'key': 'properties.reservedHours', 'type': 'decimal'}, - 'usage_date': {'key': 'properties.usageDate', 'type': 'iso-8601'}, - 'used_hours': {'key': 'properties.usedHours', 'type': 'decimal'}, - 'min_utilization_percentage': {'key': 'properties.minUtilizationPercentage', 'type': 'decimal'}, - 'avg_utilization_percentage': {'key': 'properties.avgUtilizationPercentage', 'type': 'decimal'}, - 'max_utilization_percentage': {'key': 'properties.maxUtilizationPercentage', 'type': 'decimal'}, - } - - def __init__(self, **kwargs): - super(ReservationSummary, self).__init__(**kwargs) - self.reservation_order_id = None - self.reservation_id = None - self.sku_name = None - self.reserved_hours = None - self.usage_date = None - self.used_hours = None - self.min_utilization_percentage = None - self.avg_utilization_percentage = None - self.max_utilization_percentage = None diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/reservation_summary_paged.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/reservation_summary_paged.py deleted file mode 100644 index 5b2e1ee931ae..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/reservation_summary_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class ReservationSummaryPaged(Paged): - """ - A paging container for iterating over a list of :class:`ReservationSummary ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ReservationSummary]'} - } - - def __init__(self, *args, **kwargs): - - super(ReservationSummaryPaged, self).__init__(*args, **kwargs) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/reservation_summary_py3.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/reservation_summary_py3.py deleted file mode 100644 index 45d46e82b876..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/reservation_summary_py3.py +++ /dev/null @@ -1,108 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource_py3 import Resource - - -class ReservationSummary(Resource): - """reservation summary resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar reservation_order_id: The reservation order ID is the identifier for - a reservation purchase. Each reservation order ID represents a single - purchase transaction. A reservation order contains reservations. The - reservation order specifies the VM size and region for the reservations. - :vartype reservation_order_id: str - :ivar reservation_id: The reservation ID is the identifier of a - reservation within a reservation order. Each reservation is the grouping - for applying the benefit scope and also specifies the number of instances - to which the reservation benefit can be applied to. - :vartype reservation_id: str - :ivar sku_name: This is the ARM Sku name. It can be used to join with the - serviceType field in additional info in usage records. - :vartype sku_name: str - :ivar reserved_hours: This is the total hours reserved. E.g. if - reservation for 1 instance was made on 1 PM, this will be 11 hours for - that day and 24 hours from subsequent days - :vartype reserved_hours: decimal.Decimal - :ivar usage_date: Data corresponding to the utilization record. If the - grain of data is monthly, it will be first day of month. - :vartype usage_date: datetime - :ivar used_hours: Total used hours by the reservation - :vartype used_hours: decimal.Decimal - :ivar min_utilization_percentage: This is the minimum hourly utilization - in the usage time (day or month). E.g. if usage record corresponds to - 12/10/2017 and on that for hour 4 and 5, utilization was 10%, this field - will return 10% for that day - :vartype min_utilization_percentage: decimal.Decimal - :ivar avg_utilization_percentage: This is average utilization for the - entire time range. (day or month depending on the grain) - :vartype avg_utilization_percentage: decimal.Decimal - :ivar max_utilization_percentage: This is the maximum hourly utilization - in the usage time (day or month). E.g. if usage record corresponds to - 12/10/2017 and on that for hour 4 and 5, utilization was 100%, this field - will return 100% for that day. - :vartype max_utilization_percentage: decimal.Decimal - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'tags': {'readonly': True}, - 'reservation_order_id': {'readonly': True}, - 'reservation_id': {'readonly': True}, - 'sku_name': {'readonly': True}, - 'reserved_hours': {'readonly': True}, - 'usage_date': {'readonly': True}, - 'used_hours': {'readonly': True}, - 'min_utilization_percentage': {'readonly': True}, - 'avg_utilization_percentage': {'readonly': True}, - 'max_utilization_percentage': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'reservation_order_id': {'key': 'properties.reservationOrderId', 'type': 'str'}, - 'reservation_id': {'key': 'properties.reservationId', 'type': 'str'}, - 'sku_name': {'key': 'properties.skuName', 'type': 'str'}, - 'reserved_hours': {'key': 'properties.reservedHours', 'type': 'decimal'}, - 'usage_date': {'key': 'properties.usageDate', 'type': 'iso-8601'}, - 'used_hours': {'key': 'properties.usedHours', 'type': 'decimal'}, - 'min_utilization_percentage': {'key': 'properties.minUtilizationPercentage', 'type': 'decimal'}, - 'avg_utilization_percentage': {'key': 'properties.avgUtilizationPercentage', 'type': 'decimal'}, - 'max_utilization_percentage': {'key': 'properties.maxUtilizationPercentage', 'type': 'decimal'}, - } - - def __init__(self, **kwargs) -> None: - super(ReservationSummary, self).__init__(**kwargs) - self.reservation_order_id = None - self.reservation_id = None - self.sku_name = None - self.reserved_hours = None - self.usage_date = None - self.used_hours = None - self.min_utilization_percentage = None - self.avg_utilization_percentage = None - self.max_utilization_percentage = None diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/resource.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/resource.py deleted file mode 100644 index 08e36f3f8091..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/resource.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Resource(Model): - """The Resource model definition. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'tags': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, **kwargs): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.tags = None diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/resource_attributes.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/resource_attributes.py deleted file mode 100644 index fa0c45ddf7a8..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/resource_attributes.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ResourceAttributes(Model): - """The Resource model definition. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar location: Resource location - :vartype location: str - :ivar sku: Resource sku - :vartype sku: str - """ - - _validation = { - 'location': {'readonly': True}, - 'sku': {'readonly': True}, - } - - _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ResourceAttributes, self).__init__(**kwargs) - self.location = None - self.sku = None diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/resource_attributes_py3.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/resource_attributes_py3.py deleted file mode 100644 index 273cab9005d4..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/resource_attributes_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ResourceAttributes(Model): - """The Resource model definition. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar location: Resource location - :vartype location: str - :ivar sku: Resource sku - :vartype sku: str - """ - - _validation = { - 'location': {'readonly': True}, - 'sku': {'readonly': True}, - } - - _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(ResourceAttributes, self).__init__(**kwargs) - self.location = None - self.sku = None diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/resource_py3.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/resource_py3.py deleted file mode 100644 index 38b4ca3ee6af..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/resource_py3.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Resource(Model): - """The Resource model definition. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'tags': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, **kwargs) -> None: - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.tags = None diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/tag_py3.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/tag_py3.py deleted file mode 100644 index fca156d8312c..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/tag_py3.py +++ /dev/null @@ -1,28 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Tag(Model): - """The tag resource. - - :param key: Tag key. - :type key: str - """ - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - } - - def __init__(self, *, key: str=None, **kwargs) -> None: - super(Tag, self).__init__(**kwargs) - self.key = key diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/tags_result.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/tags_result.py deleted file mode 100644 index b202a33c77de..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/tags_result.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .proxy_resource import ProxyResource - - -class TagsResult(ProxyResource): - """A resource listing all tags. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param e_tag: eTag of the resource. To handle concurrent update scenario, - this field will be used to determine whether the user is updating the - latest version or not. - :type e_tag: str - :param tags: A list of Tag. - :type tags: list[~azure.mgmt.consumption.models.Tag] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'e_tag': {'key': 'eTag', 'type': 'str'}, - 'tags': {'key': 'properties.tags', 'type': '[Tag]'}, - } - - def __init__(self, **kwargs): - super(TagsResult, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/tags_result_py3.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/tags_result_py3.py deleted file mode 100644 index e817c5180ccc..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/tags_result_py3.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .proxy_resource_py3 import ProxyResource - - -class TagsResult(ProxyResource): - """A resource listing all tags. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param e_tag: eTag of the resource. To handle concurrent update scenario, - this field will be used to determine whether the user is updating the - latest version or not. - :type e_tag: str - :param tags: A list of Tag. - :type tags: list[~azure.mgmt.consumption.models.Tag] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'e_tag': {'key': 'eTag', 'type': 'str'}, - 'tags': {'key': 'properties.tags', 'type': '[Tag]'}, - } - - def __init__(self, *, e_tag: str=None, tags=None, **kwargs) -> None: - super(TagsResult, self).__init__(e_tag=e_tag, **kwargs) - self.tags = tags diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/usage_detail.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/usage_detail.py deleted file mode 100644 index 46fc3c6ae87b..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/usage_detail.py +++ /dev/null @@ -1,279 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource import Resource - - -class UsageDetail(Resource): - """An usage detail resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar billing_account_id: Billing Account identifier. - :vartype billing_account_id: str - :ivar billing_account_name: Billing Account Name. - :vartype billing_account_name: str - :ivar billing_period_start_date: The billing period start date. - :vartype billing_period_start_date: datetime - :ivar billing_period_end_date: The billing period end date. - :vartype billing_period_end_date: datetime - :ivar billing_profile_id: Billing Profile identifier. - :vartype billing_profile_id: str - :ivar billing_profile_name: Billing Profile Name. - :vartype billing_profile_name: str - :ivar account_owner_id: Account Owner Id. - :vartype account_owner_id: str - :ivar account_name: Account Name. - :vartype account_name: str - :ivar subscription_id: Subscription guid. - :vartype subscription_id: str - :ivar subscription_name: Subscription name. - :vartype subscription_name: str - :ivar date_property: Date for the usage record. - :vartype date_property: datetime - :ivar product: Product name for the consumed service or purchase. Not - available for Marketplace. - :vartype product: str - :ivar part_number: Part Number of the service used. Can be used to join - with the price sheet. Not available for marketplace. - :vartype part_number: str - :ivar meter_id: The meter id (GUID). Not available for marketplace. For - reserved instance this represents the primary meter for which the - reservation was purchased. For the actual VM Size for which the - reservation is purchased see productOrderName. - :vartype meter_id: str - :ivar meter_details: The details about the meter. By default this is not - populated, unless it's specified in $expand. - :vartype meter_details: - ~azure.mgmt.consumption.models.MeterDetailsResponse - :ivar quantity: The usage quantity. - :vartype quantity: decimal.Decimal - :ivar effective_price: Effective Price that’s charged for the usage. - :vartype effective_price: decimal.Decimal - :ivar cost: The amount of cost before tax. - :vartype cost: decimal.Decimal - :ivar unit_price: Unit Price is the price applicable to you. (your EA or - other contract price). - :vartype unit_price: decimal.Decimal - :ivar billing_currency: Billing Currency. - :vartype billing_currency: str - :ivar resource_location: Resource Location. - :vartype resource_location: str - :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. - :vartype resource_id: str - :ivar resource_name: Resource Name. - :vartype resource_name: str - :ivar service_info1: Service Info 1. - :vartype service_info1: str - :ivar service_info2: Service Info 2. - :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 as the actual VM Size - (ServiceType) or the ratio in which the reservation discount is applied. - :vartype additional_info: str - :ivar invoice_section: Invoice Section Name. - :vartype invoice_section: str - :ivar cost_center: The cost center of this department if it is a - department and a cost center is provided. - :vartype cost_center: str - :ivar resource_group: Resource Group Name. - :vartype resource_group: str - :ivar reservation_id: ARM resource id of the reservation. Only applies to - records relevant to reservations. - :vartype reservation_id: str - :ivar reservation_name: User provided display name of the reservation. - Last known name for a particular day is populated in the daily data. Only - applies to records relevant to reservations. - :vartype reservation_name: str - :ivar product_order_id: Product Order Id. For reservations this is the - Reservation Order ID. - :vartype product_order_id: str - :ivar product_order_name: Product Order Name. For reservations this is the - SKU that was purchased. - :vartype product_order_name: str - :ivar offer_id: Offer Id. Ex: MS-AZR-0017P, MS-AZR-0148P. - :vartype offer_id: str - :ivar is_azure_credit_eligible: Is Azure Credit Eligible. - :vartype is_azure_credit_eligible: bool - :ivar term: Term (in months). 1 month for monthly recurring purchase. 12 - months for a 1 year reservation. 36 months for a 3 year reservation. - :vartype term: str - :ivar publisher_name: Publisher Name. - :vartype publisher_name: str - :ivar publisher_type: Publisher Type. - :vartype publisher_type: str - :ivar plan_name: Plan Name. - :vartype plan_name: str - :ivar charge_type: Indicates a charge represents credits, usage, a - Marketplace purchase, a reservation fee, or a refund. - :vartype charge_type: str - :ivar frequency: Indicates how frequently this charge will occur. OneTime - for purchases which only happen once, Monthly for fees which recur every - month, and UsageBased for charges based on how much a service is used. - :vartype frequency: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'tags': {'readonly': True}, - 'billing_account_id': {'readonly': True}, - 'billing_account_name': {'readonly': True}, - 'billing_period_start_date': {'readonly': True}, - 'billing_period_end_date': {'readonly': True}, - 'billing_profile_id': {'readonly': True}, - 'billing_profile_name': {'readonly': True}, - 'account_owner_id': {'readonly': True}, - 'account_name': {'readonly': True}, - 'subscription_id': {'readonly': True}, - 'subscription_name': {'readonly': True}, - 'date_property': {'readonly': True}, - 'product': {'readonly': True}, - 'part_number': {'readonly': True}, - 'meter_id': {'readonly': True}, - 'meter_details': {'readonly': True}, - 'quantity': {'readonly': True}, - 'effective_price': {'readonly': True}, - 'cost': {'readonly': True}, - 'unit_price': {'readonly': True}, - 'billing_currency': {'readonly': True}, - 'resource_location': {'readonly': True}, - 'consumed_service': {'readonly': True}, - 'resource_id': {'readonly': True}, - 'resource_name': {'readonly': True}, - 'service_info1': {'readonly': True}, - 'service_info2': {'readonly': True}, - 'additional_info': {'readonly': True}, - 'invoice_section': {'readonly': True}, - 'cost_center': {'readonly': True}, - 'resource_group': {'readonly': True}, - 'reservation_id': {'readonly': True}, - 'reservation_name': {'readonly': True}, - 'product_order_id': {'readonly': True}, - 'product_order_name': {'readonly': True}, - 'offer_id': {'readonly': True}, - 'is_azure_credit_eligible': {'readonly': True}, - 'term': {'readonly': True}, - 'publisher_name': {'readonly': True}, - 'publisher_type': {'readonly': True}, - 'plan_name': {'readonly': True}, - 'charge_type': {'readonly': True}, - 'frequency': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'billing_account_id': {'key': 'properties.billingAccountId', 'type': 'str'}, - 'billing_account_name': {'key': 'properties.billingAccountName', 'type': 'str'}, - 'billing_period_start_date': {'key': 'properties.billingPeriodStartDate', 'type': 'iso-8601'}, - 'billing_period_end_date': {'key': 'properties.billingPeriodEndDate', 'type': 'iso-8601'}, - 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, - 'billing_profile_name': {'key': 'properties.billingProfileName', 'type': 'str'}, - 'account_owner_id': {'key': 'properties.accountOwnerId', 'type': 'str'}, - 'account_name': {'key': 'properties.accountName', 'type': 'str'}, - 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, - 'subscription_name': {'key': 'properties.subscriptionName', 'type': 'str'}, - 'date_property': {'key': 'properties.date', 'type': 'iso-8601'}, - 'product': {'key': 'properties.product', 'type': 'str'}, - 'part_number': {'key': 'properties.partNumber', 'type': 'str'}, - 'meter_id': {'key': 'properties.meterId', 'type': 'str'}, - 'meter_details': {'key': 'properties.meterDetails', 'type': 'MeterDetailsResponse'}, - 'quantity': {'key': 'properties.quantity', 'type': 'decimal'}, - 'effective_price': {'key': 'properties.effectivePrice', 'type': 'decimal'}, - 'cost': {'key': 'properties.cost', 'type': 'decimal'}, - 'unit_price': {'key': 'properties.unitPrice', 'type': 'decimal'}, - 'billing_currency': {'key': 'properties.billingCurrency', 'type': 'str'}, - 'resource_location': {'key': 'properties.resourceLocation', 'type': 'str'}, - 'consumed_service': {'key': 'properties.consumedService', 'type': 'str'}, - 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, - 'resource_name': {'key': 'properties.resourceName', 'type': 'str'}, - 'service_info1': {'key': 'properties.serviceInfo1', 'type': 'str'}, - 'service_info2': {'key': 'properties.serviceInfo2', 'type': 'str'}, - 'additional_info': {'key': 'properties.additionalInfo', 'type': 'str'}, - 'invoice_section': {'key': 'properties.invoiceSection', 'type': 'str'}, - 'cost_center': {'key': 'properties.costCenter', 'type': 'str'}, - 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, - 'reservation_id': {'key': 'properties.reservationId', 'type': 'str'}, - 'reservation_name': {'key': 'properties.reservationName', 'type': 'str'}, - 'product_order_id': {'key': 'properties.productOrderId', 'type': 'str'}, - 'product_order_name': {'key': 'properties.productOrderName', 'type': 'str'}, - 'offer_id': {'key': 'properties.offerId', 'type': 'str'}, - 'is_azure_credit_eligible': {'key': 'properties.isAzureCreditEligible', 'type': 'bool'}, - 'term': {'key': 'properties.term', 'type': 'str'}, - 'publisher_name': {'key': 'properties.publisherName', 'type': 'str'}, - 'publisher_type': {'key': 'properties.publisherType', 'type': 'str'}, - 'plan_name': {'key': 'properties.planName', 'type': 'str'}, - 'charge_type': {'key': 'properties.chargeType', 'type': 'str'}, - 'frequency': {'key': 'properties.frequency', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(UsageDetail, self).__init__(**kwargs) - self.billing_account_id = None - self.billing_account_name = None - self.billing_period_start_date = None - self.billing_period_end_date = None - self.billing_profile_id = None - self.billing_profile_name = None - self.account_owner_id = None - self.account_name = None - self.subscription_id = None - self.subscription_name = None - self.date_property = None - self.product = None - self.part_number = None - self.meter_id = None - self.meter_details = None - self.quantity = None - self.effective_price = None - self.cost = None - self.unit_price = None - self.billing_currency = None - self.resource_location = None - self.consumed_service = None - self.resource_id = None - self.resource_name = None - self.service_info1 = None - self.service_info2 = None - self.additional_info = None - self.invoice_section = None - self.cost_center = None - self.resource_group = None - self.reservation_id = None - self.reservation_name = None - self.product_order_id = None - self.product_order_name = None - self.offer_id = None - self.is_azure_credit_eligible = None - self.term = None - self.publisher_name = None - self.publisher_type = None - self.plan_name = None - self.charge_type = None - self.frequency = None diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/usage_detail_paged.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/usage_detail_paged.py deleted file mode 100644 index ae15d28a276e..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/usage_detail_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class UsageDetailPaged(Paged): - """ - A paging container for iterating over a list of :class:`UsageDetail ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[UsageDetail]'} - } - - def __init__(self, *args, **kwargs): - - super(UsageDetailPaged, self).__init__(*args, **kwargs) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/usage_detail_py3.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/usage_detail_py3.py deleted file mode 100644 index 131dadc0be5d..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/usage_detail_py3.py +++ /dev/null @@ -1,279 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource_py3 import Resource - - -class UsageDetail(Resource): - """An usage detail resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar billing_account_id: Billing Account identifier. - :vartype billing_account_id: str - :ivar billing_account_name: Billing Account Name. - :vartype billing_account_name: str - :ivar billing_period_start_date: The billing period start date. - :vartype billing_period_start_date: datetime - :ivar billing_period_end_date: The billing period end date. - :vartype billing_period_end_date: datetime - :ivar billing_profile_id: Billing Profile identifier. - :vartype billing_profile_id: str - :ivar billing_profile_name: Billing Profile Name. - :vartype billing_profile_name: str - :ivar account_owner_id: Account Owner Id. - :vartype account_owner_id: str - :ivar account_name: Account Name. - :vartype account_name: str - :ivar subscription_id: Subscription guid. - :vartype subscription_id: str - :ivar subscription_name: Subscription name. - :vartype subscription_name: str - :ivar date_property: Date for the usage record. - :vartype date_property: datetime - :ivar product: Product name for the consumed service or purchase. Not - available for Marketplace. - :vartype product: str - :ivar part_number: Part Number of the service used. Can be used to join - with the price sheet. Not available for marketplace. - :vartype part_number: str - :ivar meter_id: The meter id (GUID). Not available for marketplace. For - reserved instance this represents the primary meter for which the - reservation was purchased. For the actual VM Size for which the - reservation is purchased see productOrderName. - :vartype meter_id: str - :ivar meter_details: The details about the meter. By default this is not - populated, unless it's specified in $expand. - :vartype meter_details: - ~azure.mgmt.consumption.models.MeterDetailsResponse - :ivar quantity: The usage quantity. - :vartype quantity: decimal.Decimal - :ivar effective_price: Effective Price that’s charged for the usage. - :vartype effective_price: decimal.Decimal - :ivar cost: The amount of cost before tax. - :vartype cost: decimal.Decimal - :ivar unit_price: Unit Price is the price applicable to you. (your EA or - other contract price). - :vartype unit_price: decimal.Decimal - :ivar billing_currency: Billing Currency. - :vartype billing_currency: str - :ivar resource_location: Resource Location. - :vartype resource_location: str - :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. - :vartype resource_id: str - :ivar resource_name: Resource Name. - :vartype resource_name: str - :ivar service_info1: Service Info 1. - :vartype service_info1: str - :ivar service_info2: Service Info 2. - :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 as the actual VM Size - (ServiceType) or the ratio in which the reservation discount is applied. - :vartype additional_info: str - :ivar invoice_section: Invoice Section Name. - :vartype invoice_section: str - :ivar cost_center: The cost center of this department if it is a - department and a cost center is provided. - :vartype cost_center: str - :ivar resource_group: Resource Group Name. - :vartype resource_group: str - :ivar reservation_id: ARM resource id of the reservation. Only applies to - records relevant to reservations. - :vartype reservation_id: str - :ivar reservation_name: User provided display name of the reservation. - Last known name for a particular day is populated in the daily data. Only - applies to records relevant to reservations. - :vartype reservation_name: str - :ivar product_order_id: Product Order Id. For reservations this is the - Reservation Order ID. - :vartype product_order_id: str - :ivar product_order_name: Product Order Name. For reservations this is the - SKU that was purchased. - :vartype product_order_name: str - :ivar offer_id: Offer Id. Ex: MS-AZR-0017P, MS-AZR-0148P. - :vartype offer_id: str - :ivar is_azure_credit_eligible: Is Azure Credit Eligible. - :vartype is_azure_credit_eligible: bool - :ivar term: Term (in months). 1 month for monthly recurring purchase. 12 - months for a 1 year reservation. 36 months for a 3 year reservation. - :vartype term: str - :ivar publisher_name: Publisher Name. - :vartype publisher_name: str - :ivar publisher_type: Publisher Type. - :vartype publisher_type: str - :ivar plan_name: Plan Name. - :vartype plan_name: str - :ivar charge_type: Indicates a charge represents credits, usage, a - Marketplace purchase, a reservation fee, or a refund. - :vartype charge_type: str - :ivar frequency: Indicates how frequently this charge will occur. OneTime - for purchases which only happen once, Monthly for fees which recur every - month, and UsageBased for charges based on how much a service is used. - :vartype frequency: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'tags': {'readonly': True}, - 'billing_account_id': {'readonly': True}, - 'billing_account_name': {'readonly': True}, - 'billing_period_start_date': {'readonly': True}, - 'billing_period_end_date': {'readonly': True}, - 'billing_profile_id': {'readonly': True}, - 'billing_profile_name': {'readonly': True}, - 'account_owner_id': {'readonly': True}, - 'account_name': {'readonly': True}, - 'subscription_id': {'readonly': True}, - 'subscription_name': {'readonly': True}, - 'date_property': {'readonly': True}, - 'product': {'readonly': True}, - 'part_number': {'readonly': True}, - 'meter_id': {'readonly': True}, - 'meter_details': {'readonly': True}, - 'quantity': {'readonly': True}, - 'effective_price': {'readonly': True}, - 'cost': {'readonly': True}, - 'unit_price': {'readonly': True}, - 'billing_currency': {'readonly': True}, - 'resource_location': {'readonly': True}, - 'consumed_service': {'readonly': True}, - 'resource_id': {'readonly': True}, - 'resource_name': {'readonly': True}, - 'service_info1': {'readonly': True}, - 'service_info2': {'readonly': True}, - 'additional_info': {'readonly': True}, - 'invoice_section': {'readonly': True}, - 'cost_center': {'readonly': True}, - 'resource_group': {'readonly': True}, - 'reservation_id': {'readonly': True}, - 'reservation_name': {'readonly': True}, - 'product_order_id': {'readonly': True}, - 'product_order_name': {'readonly': True}, - 'offer_id': {'readonly': True}, - 'is_azure_credit_eligible': {'readonly': True}, - 'term': {'readonly': True}, - 'publisher_name': {'readonly': True}, - 'publisher_type': {'readonly': True}, - 'plan_name': {'readonly': True}, - 'charge_type': {'readonly': True}, - 'frequency': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'billing_account_id': {'key': 'properties.billingAccountId', 'type': 'str'}, - 'billing_account_name': {'key': 'properties.billingAccountName', 'type': 'str'}, - 'billing_period_start_date': {'key': 'properties.billingPeriodStartDate', 'type': 'iso-8601'}, - 'billing_period_end_date': {'key': 'properties.billingPeriodEndDate', 'type': 'iso-8601'}, - 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, - 'billing_profile_name': {'key': 'properties.billingProfileName', 'type': 'str'}, - 'account_owner_id': {'key': 'properties.accountOwnerId', 'type': 'str'}, - 'account_name': {'key': 'properties.accountName', 'type': 'str'}, - 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, - 'subscription_name': {'key': 'properties.subscriptionName', 'type': 'str'}, - 'date_property': {'key': 'properties.date', 'type': 'iso-8601'}, - 'product': {'key': 'properties.product', 'type': 'str'}, - 'part_number': {'key': 'properties.partNumber', 'type': 'str'}, - 'meter_id': {'key': 'properties.meterId', 'type': 'str'}, - 'meter_details': {'key': 'properties.meterDetails', 'type': 'MeterDetailsResponse'}, - 'quantity': {'key': 'properties.quantity', 'type': 'decimal'}, - 'effective_price': {'key': 'properties.effectivePrice', 'type': 'decimal'}, - 'cost': {'key': 'properties.cost', 'type': 'decimal'}, - 'unit_price': {'key': 'properties.unitPrice', 'type': 'decimal'}, - 'billing_currency': {'key': 'properties.billingCurrency', 'type': 'str'}, - 'resource_location': {'key': 'properties.resourceLocation', 'type': 'str'}, - 'consumed_service': {'key': 'properties.consumedService', 'type': 'str'}, - 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, - 'resource_name': {'key': 'properties.resourceName', 'type': 'str'}, - 'service_info1': {'key': 'properties.serviceInfo1', 'type': 'str'}, - 'service_info2': {'key': 'properties.serviceInfo2', 'type': 'str'}, - 'additional_info': {'key': 'properties.additionalInfo', 'type': 'str'}, - 'invoice_section': {'key': 'properties.invoiceSection', 'type': 'str'}, - 'cost_center': {'key': 'properties.costCenter', 'type': 'str'}, - 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, - 'reservation_id': {'key': 'properties.reservationId', 'type': 'str'}, - 'reservation_name': {'key': 'properties.reservationName', 'type': 'str'}, - 'product_order_id': {'key': 'properties.productOrderId', 'type': 'str'}, - 'product_order_name': {'key': 'properties.productOrderName', 'type': 'str'}, - 'offer_id': {'key': 'properties.offerId', 'type': 'str'}, - 'is_azure_credit_eligible': {'key': 'properties.isAzureCreditEligible', 'type': 'bool'}, - 'term': {'key': 'properties.term', 'type': 'str'}, - 'publisher_name': {'key': 'properties.publisherName', 'type': 'str'}, - 'publisher_type': {'key': 'properties.publisherType', 'type': 'str'}, - 'plan_name': {'key': 'properties.planName', 'type': 'str'}, - 'charge_type': {'key': 'properties.chargeType', 'type': 'str'}, - 'frequency': {'key': 'properties.frequency', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(UsageDetail, self).__init__(**kwargs) - self.billing_account_id = None - self.billing_account_name = None - self.billing_period_start_date = None - self.billing_period_end_date = None - self.billing_profile_id = None - self.billing_profile_name = None - self.account_owner_id = None - self.account_name = None - self.subscription_id = None - self.subscription_name = None - self.date_property = None - self.product = None - self.part_number = None - self.meter_id = None - self.meter_details = None - self.quantity = None - self.effective_price = None - self.cost = None - self.unit_price = None - self.billing_currency = None - self.resource_location = None - self.consumed_service = None - self.resource_id = None - self.resource_name = None - self.service_info1 = None - self.service_info2 = None - self.additional_info = None - self.invoice_section = None - self.cost_center = None - self.resource_group = None - self.reservation_id = None - self.reservation_name = None - self.product_order_id = None - self.product_order_name = None - self.offer_id = None - self.is_azure_credit_eligible = None - self.term = None - self.publisher_name = None - self.publisher_type = None - self.plan_name = None - self.charge_type = None - self.frequency = None diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/usage_details_download_response.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/usage_details_download_response.py deleted file mode 100644 index c009f116b3c7..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/usage_details_download_response.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource import Resource - - -class UsageDetailsDownloadResponse(Resource): - """Download response of Usage Details. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar download_url: The URL to the csv file. - :vartype download_url: str - :ivar valid_till: The time in UTC at which this download URL will expire. - :vartype valid_till: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'tags': {'readonly': True}, - 'download_url': {'readonly': True}, - 'valid_till': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'download_url': {'key': 'properties.downloadUrl', 'type': 'str'}, - 'valid_till': {'key': 'properties.validTill', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(UsageDetailsDownloadResponse, self).__init__(**kwargs) - self.download_url = None - self.valid_till = None diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/usage_details_download_response_py3.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/usage_details_download_response_py3.py deleted file mode 100644 index baaae11b4345..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/usage_details_download_response_py3.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource_py3 import Resource - - -class UsageDetailsDownloadResponse(Resource): - """Download response of Usage Details. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar download_url: The URL to the csv file. - :vartype download_url: str - :ivar valid_till: The time in UTC at which this download URL will expire. - :vartype valid_till: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'tags': {'readonly': True}, - 'download_url': {'readonly': True}, - 'valid_till': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'download_url': {'key': 'properties.downloadUrl', 'type': 'str'}, - 'valid_till': {'key': 'properties.validTill', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(UsageDetailsDownloadResponse, self).__init__(**kwargs) - self.download_url = None - self.valid_till = None diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/__init__.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/__init__.py index f778b44f0171..9736d77b0f1e 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/__init__.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/__init__.py @@ -1,27 +1,29 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from .usage_details_operations import UsageDetailsOperations -from .marketplaces_operations import MarketplacesOperations -from .budgets_operations import BudgetsOperations -from .tags_operations import TagsOperations -from .charges_operations import ChargesOperations -from .balances_operations import BalancesOperations -from .reservations_summaries_operations import ReservationsSummariesOperations -from .reservations_details_operations import ReservationsDetailsOperations -from .reservation_recommendations_operations import ReservationRecommendationsOperations -from .price_sheet_operations import PriceSheetOperations -from .forecasts_operations import ForecastsOperations -from .operations import Operations -from .aggregated_cost_operations import AggregatedCostOperations +from ._usage_details_operations import UsageDetailsOperations +from ._marketplaces_operations import MarketplacesOperations +from ._budgets_operations import BudgetsOperations +from ._tags_operations import TagsOperations +from ._charges_operations import ChargesOperations +from ._balances_operations import BalancesOperations +from ._reservations_summaries_operations import ReservationsSummariesOperations +from ._reservations_details_operations import ReservationsDetailsOperations +from ._reservation_recommendations_operations import ReservationRecommendationsOperations +from ._reservation_recommendation_details_operations import ReservationRecommendationDetailsOperations +from ._reservation_transactions_operations import ReservationTransactionsOperations +from ._price_sheet_operations import PriceSheetOperations +from ._forecasts_operations import ForecastsOperations +from ._operations import Operations +from ._aggregated_cost_operations import AggregatedCostOperations +from ._events_operations import EventsOperations +from ._lots_operations import LotsOperations +from ._credits_operations import CreditsOperations __all__ = [ 'UsageDetailsOperations', @@ -33,8 +35,13 @@ 'ReservationsSummariesOperations', 'ReservationsDetailsOperations', 'ReservationRecommendationsOperations', + 'ReservationRecommendationDetailsOperations', + 'ReservationTransactionsOperations', 'PriceSheetOperations', 'ForecastsOperations', 'Operations', 'AggregatedCostOperations', + 'EventsOperations', + 'LotsOperations', + 'CreditsOperations', ] 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 new file mode 100644 index 000000000000..15b597bcbee7 --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_aggregated_cost_operations.py @@ -0,0 +1,169 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AggregatedCostOperations(object): + """AggregatedCostOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.consumption.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get_by_management_group( + self, + management_group_id, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.ManagementGroupAggregatedCostResult" + """Provides the aggregate cost of a management group and all child management groups by current + billing period. + + :param management_group_id: Azure Management Group ID. + :type management_group_id: str + :param filter: May be used to filter aggregated cost by properties/usageStart (Utc time), + properties/usageEnd (Utc time). 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: ManagementGroupAggregatedCostResult, or the result of cls(response) + :rtype: ~azure.mgmt.consumption.models.ManagementGroupAggregatedCostResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ManagementGroupAggregatedCostResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-01" + accept = "application/json" + + # Construct URL + url = self.get_by_management_group.metadata['url'] # type: ignore + path_format_arguments = { + 'managementGroupId': self._serialize.url("management_group_id", management_group_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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + 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) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ManagementGroupAggregatedCostResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_by_management_group.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Consumption/aggregatedcost'} # type: ignore + + def get_for_billing_period_by_management_group( + self, + management_group_id, # type: str + billing_period_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ManagementGroupAggregatedCostResult" + """Provides the aggregate cost of a management group and all child management groups by specified + billing period. + + :param management_group_id: Azure Management Group ID. + :type management_group_id: str + :param billing_period_name: Billing Period Name. + :type billing_period_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagementGroupAggregatedCostResult, or the result of cls(response) + :rtype: ~azure.mgmt.consumption.models.ManagementGroupAggregatedCostResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ManagementGroupAggregatedCostResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-01" + accept = "application/json" + + # Construct URL + url = self.get_for_billing_period_by_management_group.metadata['url'] # type: ignore + path_format_arguments = { + 'managementGroupId': self._serialize.url("management_group_id", management_group_id, 'str'), + 'billingPeriodName': self._serialize.url("billing_period_name", billing_period_name, '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + 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) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ManagementGroupAggregatedCostResult', pipeline_response) + + if cls: + 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 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 new file mode 100644 index 000000000000..41ce62cee94a --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_balances_operations.py @@ -0,0 +1,161 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class BalancesOperations(object): + """BalancesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.consumption.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get_by_billing_account( + self, + billing_account_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.Balance" + """Gets the balances for a scope by billingAccountId. Balances are available via this API only for + May 1, 2014 or later. + + :param billing_account_id: BillingAccount ID. + :type billing_account_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Balance, or the result of cls(response) + :rtype: ~azure.mgmt.consumption.models.Balance + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Balance"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-01" + accept = "application/json" + + # Construct URL + url = self.get_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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + 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) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Balance', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_by_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/balances'} # type: ignore + + def get_for_billing_period_by_billing_account( + self, + billing_account_id, # type: str + billing_period_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.Balance" + """Gets the balances for a scope by billing period and billingAccountId. Balances are available + via this API only for May 1, 2014 or later. + + :param billing_account_id: BillingAccount ID. + :type billing_account_id: str + :param billing_period_name: Billing Period Name. + :type billing_period_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Balance, or the result of cls(response) + :rtype: ~azure.mgmt.consumption.models.Balance + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Balance"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-01" + accept = "application/json" + + # Construct URL + url = self.get_for_billing_period_by_billing_account.metadata['url'] # type: ignore + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), + 'billingPeriodName': self._serialize.url("billing_period_name", billing_period_name, '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + 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) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Balance', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_for_billing_period_by_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/balances'} # type: ignore 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 new file mode 100644 index 000000000000..ebbad1714f53 --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_budgets_operations.py @@ -0,0 +1,357 @@ + # coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class BudgetsOperations(object): + """BudgetsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.consumption.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + scope, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.BudgetsListResult"] + """Lists all budgets for the defined scope. + + :param scope: The scope associated with budget operations. This includes + '/subscriptions/{subscriptionId}/' for subscription scope, + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' + for Department scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + for EnrollmentAccount scope, + '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group + scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + for billingProfile scope, + 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' + for invoiceSection scope. + :type scope: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either BudgetsListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.consumption.models.BudgetsListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.BudgetsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-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.metadata['url'] # type: ignore + path_format_arguments = { + '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') + + 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('BudgetsListResult', 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(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.metadata = {'url': '/{scope}/providers/Microsoft.Consumption/budgets'} # type: ignore + + def get( + self, + scope, # type: str + budget_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.Budget" + """Gets the budget for the scope by budget name. + + :param scope: The scope associated with budget operations. This includes + '/subscriptions/{subscriptionId}/' for subscription scope, + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' + for Department scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + for EnrollmentAccount scope, + '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group + scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + for billingProfile scope, + 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' + for invoiceSection scope. + :type scope: str + :param budget_name: Budget Name. + :type budget_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Budget, or the result of cls(response) + :rtype: ~azure.mgmt.consumption.models.Budget + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Budget"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'budgetName': self._serialize.url("budget_name", budget_name, '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + 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) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Budget', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}'} # type: ignore + + def create_or_update( + self, + scope, # type: str + budget_name, # type: str + parameters, # type: "models.Budget" + **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. + + :param scope: The scope associated with budget operations. This includes + '/subscriptions/{subscriptionId}/' for subscription scope, + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' + for Department scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + for EnrollmentAccount scope, + '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group + scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + for billingProfile scope, + 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' + for invoiceSection scope. + :type scope: str + :param budget_name: Budget Name. + :type budget_name: str + :param parameters: Parameters supplied to the Create Budget operation. + :type parameters: ~azure.mgmt.consumption.models.Budget + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Budget, or the result of cls(response) + :rtype: ~azure.mgmt.consumption.models.Budget + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Budget"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'budgetName': self._serialize.url("budget_name", budget_name, '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'Budget') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + 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) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Budget', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Budget', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}'} # type: ignore + + def delete( + self, + scope, # type: str + budget_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """The operation to delete a budget. + + :param scope: The scope associated with budget operations. This includes + '/subscriptions/{subscriptionId}/' for subscription scope, + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' + for Department scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + for EnrollmentAccount scope, + '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group + scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + for billingProfile scope, + 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' + for invoiceSection scope. + :type scope: str + :param budget_name: Budget Name. + :type budget_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'budgetName': self._serialize.url("budget_name", budget_name, '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + 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) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}'} # type: ignore 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 new file mode 100644 index 000000000000..0baf018d481a --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_charges_operations.py @@ -0,0 +1,140 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ChargesOperations(object): + """ChargesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.consumption.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + scope, # type: str + start_date=None, # type: Optional[str] + end_date=None, # type: Optional[str] + filter=None, # type: Optional[str] + apply=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.ChargesListResult" + """Lists the charges based for the defined scope. + + :param scope: The scope associated with charges operations. This includes + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' + for Department scope, and + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + for EnrollmentAccount scope. For department and enrollment accounts, you can also add billing + period to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + For e.g. to specify billing period at department scope use + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + Also, Modern Commerce Account scopes are + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + for billingProfile scope, + 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + for invoiceSection scope, and + 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' + specific for partners. + :type scope: str + :param start_date: Start date. + :type start_date: str + :param end_date: End date. + :type end_date: str + :param filter: May be used to filter charges by properties/usageEnd (Utc time), + properties/usageStart (Utc time). 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 + :param apply: May be used to group charges for billingAccount scope by + properties/billingProfileId, properties/invoiceSectionId, properties/customerId (specific for + Partner Led), or for billingProfile scope by properties/invoiceSectionId. + :type apply: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ChargesListResult, or the result of cls(response) + :rtype: ~azure.mgmt.consumption.models.ChargesListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ChargesListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-01" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + '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') + if start_date is not None: + query_parameters['startDate'] = self._serialize.query("start_date", start_date, 'str') + if end_date is not None: + query_parameters['endDate'] = self._serialize.query("end_date", end_date, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if apply is not None: + query_parameters['$apply'] = self._serialize.query("apply", apply, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + 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) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ChargesListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/{scope}/providers/Microsoft.Consumption/charges'} # type: ignore 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 new file mode 100644 index 000000000000..e1524adcdb9b --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_credits_operations.py @@ -0,0 +1,104 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class CreditsOperations(object): + """CreditsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.consumption.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + billing_account_id, # type: str + billing_profile_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.CreditSummary" + """The credit summary by billingAccountId and billingProfileId. + + :param billing_account_id: BillingAccount ID. + :type billing_account_id: str + :param billing_profile_id: Azure Billing Profile ID. + :type billing_profile_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CreditSummary, or the result of cls(response) + :rtype: ~azure.mgmt.consumption.models.CreditSummary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CreditSummary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-01" + accept = "application/json" + + # Construct URL + url = self.get.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'), + } + 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + 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) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CreditSummary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.Consumption/credits/balanceSummary'} # type: ignore 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 new file mode 100644 index 000000000000..e47c48f548fb --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_events_operations.py @@ -0,0 +1,129 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class EventsOperations(object): + """EventsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.consumption.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + billing_account_id, # type: str + billing_profile_id, # type: str + start_date, # type: str + end_date, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.Events"] + """Lists the events by billingAccountId and billingProfileId for given start and end date. + + :param billing_account_id: BillingAccount ID. + :type billing_account_id: str + :param billing_profile_id: Azure Billing Profile ID. + :type billing_profile_id: str + :param start_date: Start date. + :type start_date: str + :param end_date: End date. + :type end_date: 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 = "2019-10-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.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'), + } + 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['startDate'] = self._serialize.query("start_date", start_date, 'str') + query_parameters['endDate'] = self._serialize.query("end_date", end_date, '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(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.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/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 new file mode 100644 index 000000000000..817430c3ac3b --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_forecasts_operations.py @@ -0,0 +1,121 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ForecastsOperations(object): + """ForecastsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.consumption.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.ForecastsListResult"] + """Lists the forecast charges by subscriptionId. + + :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', + and 'and'. It does not currently support 'ne', 'or', or 'not'. + :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 ForecastsListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.consumption.models.ForecastsListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ForecastsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-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.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, '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('ForecastsListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return 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(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.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/forecasts'} # type: ignore 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 new file mode 100644 index 000000000000..3e6ee7d91541 --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_lots_operations.py @@ -0,0 +1,121 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class LotsOperations(object): + """LotsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.consumption.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + 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. + + :param billing_account_id: BillingAccount ID. + :type billing_account_id: str + :param billing_profile_id: Azure Billing Profile ID. + :type billing_profile_id: 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 = "2019-10-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.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'), + } + 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') + + 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(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.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/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 new file mode 100644 index 000000000000..c03b00aaced0 --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_marketplaces_operations.py @@ -0,0 +1,148 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class MarketplacesOperations(object): + """MarketplacesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.consumption.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + scope, # type: str + filter=None, # type: Optional[str] + top=None, # type: Optional[int] + skiptoken=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.MarketplacesListResult"] + """Lists the marketplaces for a scope at the defined scope. Marketplaces are available via this + API only for May 1, 2014 or later. + + :param scope: The scope associated with marketplace operations. This includes + '/subscriptions/{subscriptionId}/' for subscription scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, + '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount + scope and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management + Group scope. For subscription, billing account, department, enrollment account and + ManagementGroup, you can also add billing period to the scope using + '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing + period at department scope use + '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + :type scope: str + :param filter: May be used to filter marketplaces by properties/usageEnd (Utc time), + properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName or + properties/instanceId. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not + currently support 'ne', 'or', or 'not'. + :type filter: str + :param top: May be used to limit the number of results to the most recent N marketplaces. + :type top: int + :param skiptoken: Skiptoken is only used if a previous operation returned a partial result. If + a previous response contains a nextLink element, the value of the nextLink element will include + a skiptoken parameter that specifies a starting point to use for subsequent calls. + :type skiptoken: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either MarketplacesListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.consumption.models.MarketplacesListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.MarketplacesListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-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.metadata['url'] # type: ignore + path_format_arguments = { + '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] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, '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('MarketplacesListResult', 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(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.metadata = {'url': '/{scope}/providers/Microsoft.Consumption/marketplaces'} # type: ignore 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 new file mode 100644 index 000000000000..e413fa9eb9a6 --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_operations.py @@ -0,0 +1,110 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class Operations(object): + """Operations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.consumption.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.OperationListResult"] + """Lists all of the available consumption REST API operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.consumption.models.OperationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-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.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, '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('OperationListResult', 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(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.metadata = {'url': '/providers/Microsoft.Consumption/operations'} # type: ignore 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 new file mode 100644 index 000000000000..a4276af439dc --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_price_sheet_operations.py @@ -0,0 +1,191 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class PriceSheetOperations(object): + """PriceSheetOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.consumption.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + expand=None, # type: Optional[str] + skiptoken=None, # type: Optional[str] + top=None, # type: Optional[int] + **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. + + :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. + :type expand: str + :param skiptoken: Skiptoken is only used if a previous operation returned a partial result. If + a previous response contains a nextLink element, the value of the nextLink element will include + a skiptoken parameter that specifies a starting point to use for subsequent calls. + :type skiptoken: str + :param top: May be used to limit the number of results to the top N results. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PriceSheetResult, or the result of cls(response) + :rtype: ~azure.mgmt.consumption.models.PriceSheetResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PriceSheetResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + 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) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PriceSheetResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/pricesheets/default'} # type: ignore + + def get_by_billing_period( + self, + billing_period_name, # type: str + expand=None, # type: Optional[str] + skiptoken=None, # type: Optional[str] + top=None, # type: Optional[int] + **kwargs # type: Any + ): + # type: (...) -> "models.PriceSheetResult" + """Get the price sheet for a scope by subscriptionId and billing period. Price sheet is available + via this API only for May 1, 2014 or later. + + :param billing_period_name: Billing Period Name. + :type billing_period_name: str + :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. + :type expand: str + :param skiptoken: Skiptoken is only used if a previous operation returned a partial result. If + a previous response contains a nextLink element, the value of the nextLink element will include + a skiptoken parameter that specifies a starting point to use for subsequent calls. + :type skiptoken: str + :param top: May be used to limit the number of results to the top N results. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PriceSheetResult, or the result of cls(response) + :rtype: ~azure.mgmt.consumption.models.PriceSheetResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PriceSheetResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-01" + accept = "application/json" + + # Construct URL + url = self.get_by_billing_period.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'billingPeriodName': self._serialize.url("billing_period_name", billing_period_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + 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) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PriceSheetResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_by_billing_period.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/pricesheets/default'} # type: ignore 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 new file mode 100644 index 000000000000..948e2758abec --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_reservation_recommendation_details_operations.py @@ -0,0 +1,129 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ReservationRecommendationDetailsOperations(object): + """ReservationRecommendationDetailsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.consumption.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + billing_scope, # type: str + scope, # type: Union[str, "models.Scope"] + region, # type: str + term, # type: Union[str, "models.Term"] + look_back_period, # type: Union[str, "models.LookBackPeriod"] + product, # type: str + **kwargs # type: Any + ): + # 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, + '/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 + :param region: Used to select the region the recommendation should be generated for. + :type region: str + :param term: Specify length of reservation recommendation term. + :type term: str or ~azure.mgmt.consumption.models.Term + :param look_back_period: Filter the time period on which reservation recommendation results are + based. + :type look_back_period: str or ~azure.mgmt.consumption.models.LookBackPeriod + :param product: Filter the products for which reservation recommendation results are generated. + Examples: Standard_DS1_v2 (for VM), Premium_SSD_Managed_Disks_P30 (for Managed Disks). + :type product: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ReservationRecommendationDetailsModel, or the result of cls(response) + :rtype: ~azure.mgmt.consumption.models.ReservationRecommendationDetailsModel or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ReservationRecommendationDetailsModel"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-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), + } + 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['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') + query_parameters['product'] = self._serialize.query("product", product, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + 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) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ReservationRecommendationDetailsModel', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/{billingScope}/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 new file mode 100644 index 000000000000..e1506a292066 --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_reservation_recommendations_operations.py @@ -0,0 +1,133 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ReservationRecommendationsOperations(object): + """ReservationRecommendationsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.consumption.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + scope, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.ReservationRecommendationsListResult"] + """List of recommendations for purchasing reserved instances. + + :param scope: The scope associated with reservation recommendations 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 scope: str + :param filter: May be used to filter reservationRecommendations by: properties/scope with + allowed values ['Single', 'Shared'] and default value 'Single'; properties/resourceType with + allowed values ['VirtualMachines', 'SQLDatabases', 'PostgreSQL', 'ManagedDisk', 'MySQL', + 'RedHat', 'MariaDB', 'RedisCache', 'CosmosDB', 'SqlDataWarehouse', 'SUSELinux', 'AppService', + 'BlockBlob', 'AzureDataExplorer', 'VMwareCloudSimple'] and default value 'VirtualMachines'; and + properties/lookBackPeriod with allowed values ['Last7Days', 'Last30Days', 'Last60Days'] and + default value 'Last7Days'. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ReservationRecommendationsListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.consumption.models.ReservationRecommendationsListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ReservationRecommendationsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-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.metadata['url'] # type: ignore + path_format_arguments = { + '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] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, '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('ReservationRecommendationsListResult', 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(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.metadata = {'url': '/{scope}/providers/Microsoft.Consumption/reservationRecommendations'} # type: ignore 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 new file mode 100644 index 000000000000..a2c5ca45f105 --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_reservation_transactions_operations.py @@ -0,0 +1,204 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ReservationTransactionsOperations(object): + """ReservationTransactionsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.consumption.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + billing_account_id, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.ReservationTransactionsListResult"] + """List of transactions for reserved instances on billing account scope. + + :param billing_account_id: BillingAccount ID. + :type billing_account_id: str + :param filter: Filter reservation transactions by date range. The properties/EventDate for + start date and end date. The filter supports 'le' and 'ge'. + :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 ReservationTransactionsListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.consumption.models.ReservationTransactionsListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ReservationTransactionsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-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.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] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, '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('ReservationTransactionsListResult', 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(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.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/reservationTransactions'} # type: ignore + + def list_by_billing_profile( + self, + billing_account_id, # type: str + billing_profile_id, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.ModernReservationTransactionsListResult"] + """List of transactions for reserved instances on billing account scope. + + :param billing_account_id: BillingAccount ID. + :type billing_account_id: str + :param billing_profile_id: Azure Billing Profile ID. + :type billing_profile_id: str + :param filter: Filter reservation transactions by date range. The properties/EventDate for + start date and end date. The filter supports 'le' and 'ge'. + :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 ModernReservationTransactionsListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.consumption.models.ModernReservationTransactionsListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ModernReservationTransactionsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-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_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'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, '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('ModernReservationTransactionsListResult', 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(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_profile.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.Consumption/reservationTransactions'} # type: ignore 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 new file mode 100644 index 000000000000..aad043fae6c0 --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_reservations_details_operations.py @@ -0,0 +1,306 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ReservationsDetailsOperations(object): + """ReservationsDetailsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.consumption.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_reservation_order( + self, + reservation_order_id, # type: str + filter, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.ReservationDetailsListResult"] + """Lists the reservations details for provided date range. + + :param reservation_order_id: Order Id of the reservation. + :type reservation_order_id: str + :param filter: Filter reservation details by date range. The properties/UsageDate for start + date and end date. The filter supports 'le' and 'ge'. + :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 ReservationDetailsListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.consumption.models.ReservationDetailsListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ReservationDetailsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-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_reservation_order.metadata['url'] # type: ignore + path_format_arguments = { + 'reservationOrderId': self._serialize.url("reservation_order_id", reservation_order_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, '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('ReservationDetailsListResult', 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(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_reservation_order.metadata = {'url': '/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/providers/Microsoft.Consumption/reservationDetails'} # type: ignore + + def list_by_reservation_order_and_reservation( + self, + reservation_order_id, # type: str + reservation_id, # type: str + filter, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.ReservationDetailsListResult"] + """Lists the reservations details for provided date range. + + :param reservation_order_id: Order Id of the reservation. + :type reservation_order_id: str + :param reservation_id: Id of the reservation. + :type reservation_id: str + :param filter: Filter reservation details by date range. The properties/UsageDate for start + date and end date. The filter supports 'le' and 'ge'. + :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 ReservationDetailsListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.consumption.models.ReservationDetailsListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ReservationDetailsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-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_reservation_order_and_reservation.metadata['url'] # type: ignore + path_format_arguments = { + 'reservationOrderId': self._serialize.url("reservation_order_id", reservation_order_id, 'str'), + 'reservationId': self._serialize.url("reservation_id", reservation_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, '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('ReservationDetailsListResult', 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(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_reservation_order_and_reservation.metadata = {'url': '/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/reservations/{reservationId}/providers/Microsoft.Consumption/reservationDetails'} # type: ignore + + def list( + self, + scope, # type: str + start_date=None, # type: Optional[str] + end_date=None, # type: Optional[str] + filter=None, # type: Optional[str] + reservation_id=None, # type: Optional[str] + reservation_order_id=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.ReservationDetailsListResult"] + """Lists the reservations details for the defined scope and provided date range. + + :param scope: The scope associated with reservations details operations. This includes + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope + (legacy), and + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + for BillingProfile scope (modern). + :type scope: str + :param start_date: Start date. Only applicable when querying with billing profile. + :type start_date: str + :param end_date: End date. Only applicable when querying with billing profile. + :type end_date: str + :param filter: Filter reservation details by date range. The properties/UsageDate for start + date and end date. The filter supports 'le' and 'ge'. Not applicable when querying with + billing profile. + :type filter: str + :param reservation_id: Reservation Id GUID. Only valid if reservationOrderId is also provided. + Filter to a specific reservation. + :type reservation_id: str + :param reservation_order_id: Reservation Order Id GUID. Required if reservationId is provided. + Filter to a specific reservation order. + :type reservation_order_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ReservationDetailsListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.consumption.models.ReservationDetailsListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ReservationDetailsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-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.metadata['url'] # type: ignore + path_format_arguments = { + '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] + if start_date is not None: + query_parameters['startDate'] = self._serialize.query("start_date", start_date, 'str') + if end_date is not None: + query_parameters['endDate'] = self._serialize.query("end_date", end_date, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if reservation_id is not None: + query_parameters['reservationId'] = self._serialize.query("reservation_id", reservation_id, 'str') + if reservation_order_id is not None: + query_parameters['reservationOrderId'] = self._serialize.query("reservation_order_id", reservation_order_id, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, '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('ReservationDetailsListResult', 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(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.metadata = {'url': '/{scope}/providers/Microsoft.Consumption/reservationDetails'} # type: ignore 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 new file mode 100644 index 000000000000..a443bb835a6c --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_reservations_summaries_operations.py @@ -0,0 +1,319 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ReservationsSummariesOperations(object): + """ReservationsSummariesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.consumption.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_reservation_order( + self, + reservation_order_id, # type: str + grain, # type: Union[str, "models.Datagrain"] + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.ReservationSummariesListResult"] + """Lists the reservations summaries for daily or monthly grain. + + :param reservation_order_id: Order Id of the reservation. + :type reservation_order_id: str + :param grain: Can be daily or monthly. + :type grain: str or ~azure.mgmt.consumption.models.Datagrain + :param filter: Required only for daily grain. The properties/UsageDate for start date and end + date. The filter supports 'le' and 'ge'. + :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 ReservationSummariesListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.consumption.models.ReservationSummariesListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ReservationSummariesListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-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_reservation_order.metadata['url'] # type: ignore + path_format_arguments = { + 'reservationOrderId': self._serialize.url("reservation_order_id", reservation_order_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['grain'] = self._serialize.query("grain", grain, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, '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('ReservationSummariesListResult', 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(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_reservation_order.metadata = {'url': '/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/providers/Microsoft.Consumption/reservationSummaries'} # type: ignore + + def list_by_reservation_order_and_reservation( + self, + reservation_order_id, # type: str + reservation_id, # type: str + grain, # type: Union[str, "models.Datagrain"] + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.ReservationSummariesListResult"] + """Lists the reservations summaries for daily or monthly grain. + + :param reservation_order_id: Order Id of the reservation. + :type reservation_order_id: str + :param reservation_id: Id of the reservation. + :type reservation_id: str + :param grain: Can be daily or monthly. + :type grain: str or ~azure.mgmt.consumption.models.Datagrain + :param filter: Required only for daily grain. The properties/UsageDate for start date and end + date. The filter supports 'le' and 'ge'. + :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 ReservationSummariesListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.consumption.models.ReservationSummariesListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ReservationSummariesListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-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_reservation_order_and_reservation.metadata['url'] # type: ignore + path_format_arguments = { + 'reservationOrderId': self._serialize.url("reservation_order_id", reservation_order_id, 'str'), + 'reservationId': self._serialize.url("reservation_id", reservation_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['grain'] = self._serialize.query("grain", grain, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, '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('ReservationSummariesListResult', 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(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_reservation_order_and_reservation.metadata = {'url': '/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/reservations/{reservationId}/providers/Microsoft.Consumption/reservationSummaries'} # type: ignore + + def list( + self, + scope, # type: str + grain, # type: Union[str, "models.Datagrain"] + start_date=None, # type: Optional[str] + end_date=None, # type: Optional[str] + filter=None, # type: Optional[str] + reservation_id=None, # type: Optional[str] + reservation_order_id=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.ReservationSummariesListResult"] + """Lists the reservations summaries for the defined scope daily or monthly grain. + + :param scope: The scope associated with reservations summaries operations. This includes + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope + (legacy), and + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + for BillingProfile scope (modern). + :type scope: str + :param grain: Can be daily or monthly. + :type grain: str or ~azure.mgmt.consumption.models.Datagrain + :param start_date: Start date. Only applicable when querying with billing profile. + :type start_date: str + :param end_date: End date. Only applicable when querying with billing profile. + :type end_date: str + :param filter: Required only for daily grain. The properties/UsageDate for start date and end + date. The filter supports 'le' and 'ge'. Not applicable when querying with billing profile. + :type filter: str + :param reservation_id: Reservation Id GUID. Only valid if reservationOrderId is also provided. + Filter to a specific reservation. + :type reservation_id: str + :param reservation_order_id: Reservation Order Id GUID. Required if reservationId is provided. + Filter to a specific reservation order. + :type reservation_order_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ReservationSummariesListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.consumption.models.ReservationSummariesListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ReservationSummariesListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-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.metadata['url'] # type: ignore + path_format_arguments = { + '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['grain'] = self._serialize.query("grain", grain, 'str') + if start_date is not None: + query_parameters['startDate'] = self._serialize.query("start_date", start_date, 'str') + if end_date is not None: + query_parameters['endDate'] = self._serialize.query("end_date", end_date, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if reservation_id is not None: + query_parameters['reservationId'] = self._serialize.query("reservation_id", reservation_id, 'str') + if reservation_order_id is not None: + query_parameters['reservationOrderId'] = self._serialize.query("reservation_order_id", reservation_order_id, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, '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('ReservationSummariesListResult', 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(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.metadata = {'url': '/{scope}/providers/Microsoft.Consumption/reservationSummaries'} # type: ignore 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 new file mode 100644 index 000000000000..06cdb67f9bc1 --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_tags_operations.py @@ -0,0 +1,109 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class TagsOperations(object): + """TagsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.consumption.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + scope, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.TagsResult" + """Get all available tag keys for the defined scope. + + :param scope: The scope associated with tags operations. This includes + '/subscriptions/{subscriptionId}/' for subscription scope, + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' + for Department scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + for EnrollmentAccount scope and + '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group + scope.. + :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 + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.TagsResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + '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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + 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) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('TagsResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/{scope}/providers/Microsoft.Consumption/tags'} # type: ignore 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 new file mode 100644 index 000000000000..9a3cef471610 --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_usage_details_operations.py @@ -0,0 +1,171 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class UsageDetailsOperations(object): + """UsageDetailsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.consumption.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + scope, # type: str + expand=None, # type: Optional[str] + filter=None, # type: Optional[str] + skiptoken=None, # type: Optional[str] + top=None, # type: Optional[int] + metric=None, # type: Optional[Union[str, "models.Metrictype"]] + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.UsageDetailsListResult"] + """Lists the usage details for the defined scope. Usage details are available via this API only + for May 1, 2014 or later. + + :param scope: The scope associated with usage details operations. This includes + '/subscriptions/{subscriptionId}/' for subscription scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, + '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount + scope and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management + Group scope. For subscription, billing account, department, enrollment account and management + group, you can also add billing period to the scope using + '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing + period at department scope use + '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + Also, Modern Commerce Account scopes are + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + for billingProfile scope, + 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + for invoiceSection scope, and + 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' + specific for partners. + :type scope: str + :param expand: May be used to expand the properties/additionalInfo or properties/meterDetails + within a list of usage details. By default, these fields are not included when listing usage + details. + :type expand: str + :param filter: May be used to filter usageDetails by properties/resourceGroup, + properties/resourceName, properties/resourceId, properties/chargeType, + properties/reservationId, properties/publisherType or tags. 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 (:). PublisherType Filter + accepts two values azure and marketplace and it is currently supported for Web Direct Offer + Type. + :type filter: str + :param skiptoken: Skiptoken is only used if a previous operation returned a partial result. If + a previous response contains a nextLink element, the value of the nextLink element will include + a skiptoken parameter that specifies a starting point to use for subsequent calls. + :type skiptoken: str + :param top: May be used to limit the number of results to the most recent N usageDetails. + :type top: int + :param metric: Allows to select different type of cost/usage records. + :type metric: str or ~azure.mgmt.consumption.models.Metrictype + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either UsageDetailsListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.consumption.models.UsageDetailsListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.UsageDetailsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-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.metadata['url'] # type: ignore + path_format_arguments = { + '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] + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if metric is not None: + query_parameters['metric'] = self._serialize.query("metric", metric, '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('UsageDetailsListResult', 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(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.metadata = {'url': '/{scope}/providers/Microsoft.Consumption/usageDetails'} # type: ignore 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 deleted file mode 100644 index 699821161f53..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/aggregated_cost_operations.py +++ /dev/null @@ -1,168 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse - -from .. import models - - -class AggregatedCostOperations(object): - """AggregatedCostOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2019-04-01-preview. Constant value: "2019-04-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-04-01-preview" - - self.config = config - - def get_by_management_group( - self, management_group_id, filter=None, custom_headers=None, raw=False, **operation_config): - """Provides the aggregate cost of a management group and all child - management groups by current billing period. - - :param management_group_id: Azure Management Group ID. - :type management_group_id: str - :param filter: May be used to filter aggregated cost by - properties/usageStart (Utc time), properties/usageEnd (Utc time). 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 - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ManagementGroupAggregatedCostResult or ClientRawResponse if - raw=true - :rtype: - ~azure.mgmt.consumption.models.ManagementGroupAggregatedCostResult or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get_by_management_group.metadata['url'] - path_format_arguments = { - 'managementGroupId': self._serialize.url("management_group_id", management_group_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('ManagementGroupAggregatedCostResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_by_management_group.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Consumption/aggregatedcost'} - - def get_for_billing_period_by_management_group( - self, management_group_id, billing_period_name, custom_headers=None, raw=False, **operation_config): - """Provides the aggregate cost of a management group and all child - management groups by specified billing period. - - :param management_group_id: Azure Management Group ID. - :type management_group_id: str - :param billing_period_name: Billing Period Name. - :type billing_period_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ManagementGroupAggregatedCostResult or ClientRawResponse if - raw=true - :rtype: - ~azure.mgmt.consumption.models.ManagementGroupAggregatedCostResult or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get_for_billing_period_by_management_group.metadata['url'] - path_format_arguments = { - 'managementGroupId': self._serialize.url("management_group_id", management_group_id, 'str'), - 'billingPeriodName': self._serialize.url("billing_period_name", billing_period_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('ManagementGroupAggregatedCostResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_for_billing_period_by_management_group.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/Microsoft.Consumption/aggregatedcost'} 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 deleted file mode 100644 index ed6f60699c50..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/balances_operations.py +++ /dev/null @@ -1,156 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse - -from .. import models - - -class BalancesOperations(object): - """BalancesOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2019-04-01-preview. Constant value: "2019-04-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-04-01-preview" - - self.config = config - - def get_by_billing_account( - self, billing_account_id, custom_headers=None, raw=False, **operation_config): - """Gets the balances for a scope by billingAccountId. Balances are - available via this API only for May 1, 2014 or later. - - :param billing_account_id: BillingAccount ID - :type billing_account_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: Balance or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.consumption.models.Balance or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get_by_billing_account.metadata['url'] - 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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('Balance', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_by_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/balances'} - - def get_for_billing_period_by_billing_account( - self, billing_account_id, billing_period_name, custom_headers=None, raw=False, **operation_config): - """Gets the balances for a scope by billing period and billingAccountId. - Balances are available via this API only for May 1, 2014 or later. - - :param billing_account_id: BillingAccount ID - :type billing_account_id: str - :param billing_period_name: Billing Period Name. - :type billing_period_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: Balance or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.consumption.models.Balance or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get_for_billing_period_by_billing_account.metadata['url'] - path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), - 'billingPeriodName': self._serialize.url("billing_period_name", billing_period_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('Balance', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_for_billing_period_by_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/balances'} 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 deleted file mode 100644 index 54a54997449f..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/budgets_operations.py +++ /dev/null @@ -1,344 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse - -from .. import models - - -class BudgetsOperations(object): - """BudgetsOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2019-04-01-preview. Constant value: "2019-04-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-04-01-preview" - - self.config = config - - def list( - self, scope, custom_headers=None, raw=False, **operation_config): - """Lists all budgets for the defined scope. - - :param scope: The scope associated with budget operations. This - includes '/subscriptions/{subscriptionId}/' for subscription scope, - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' - for resourceGroup scope, - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for - Billing Account scope, - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' - for Department scope, - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - for EnrollmentAccount scope, - '/providers/Microsoft.Management/managementGroups/{managementGroupId}' - for Management Group scope, - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - for billingProfile scope, - 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' - for invoiceSection scope. - :type scope: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Budget - :rtype: - ~azure.mgmt.consumption.models.BudgetPaged[~azure.mgmt.consumption.models.Budget] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.BudgetPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.BudgetPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/{scope}/providers/Microsoft.Consumption/budgets'} - - def get( - self, scope, budget_name, custom_headers=None, raw=False, **operation_config): - """Gets the budget for the scope by budget name. - - :param scope: The scope associated with budget operations. This - includes '/subscriptions/{subscriptionId}/' for subscription scope, - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' - for resourceGroup scope, - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for - Billing Account scope, - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' - for Department scope, - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - for EnrollmentAccount scope, - '/providers/Microsoft.Management/managementGroups/{managementGroupId}' - for Management Group scope, - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - for billingProfile scope, - 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' - for invoiceSection scope. - :type scope: str - :param budget_name: Budget Name. - :type budget_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: Budget or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.consumption.models.Budget or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - 'budgetName': self._serialize.url("budget_name", budget_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('Budget', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}'} - - def create_or_update( - self, scope, budget_name, parameters, custom_headers=None, raw=False, **operation_config): - """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. - - :param scope: The scope associated with budget operations. This - includes '/subscriptions/{subscriptionId}/' for subscription scope, - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' - for resourceGroup scope, - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for - Billing Account scope, - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' - for Department scope, - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - for EnrollmentAccount scope, - '/providers/Microsoft.Management/managementGroups/{managementGroupId}' - for Management Group scope, - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - for billingProfile scope, - 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' - for invoiceSection scope. - :type scope: str - :param budget_name: Budget Name. - :type budget_name: str - :param parameters: Parameters supplied to the Create Budget operation. - :type parameters: ~azure.mgmt.consumption.models.Budget - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: Budget or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.consumption.models.Budget or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.create_or_update.metadata['url'] - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - 'budgetName': self._serialize.url("budget_name", budget_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'Budget') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('Budget', response) - if response.status_code == 201: - deserialized = self._deserialize('Budget', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create_or_update.metadata = {'url': '/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}'} - - def delete( - self, scope, budget_name, custom_headers=None, raw=False, **operation_config): - """The operation to delete a budget. - - :param scope: The scope associated with budget operations. This - includes '/subscriptions/{subscriptionId}/' for subscription scope, - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' - for resourceGroup scope, - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for - Billing Account scope, - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' - for Department scope, - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - for EnrollmentAccount scope, - '/providers/Microsoft.Management/managementGroups/{managementGroupId}' - for Management Group scope, - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - for billingProfile scope, - 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' - for invoiceSection scope. - :type scope: str - :param budget_name: Budget Name. - :type budget_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - 'budgetName': self._serialize.url("budget_name", budget_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - delete.metadata = {'url': '/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}'} 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 deleted file mode 100644 index afec159b31b1..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/charges_operations.py +++ /dev/null @@ -1,111 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse - -from .. import models - - -class ChargesOperations(object): - """ChargesOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2019-04-01-preview. Constant value: "2019-04-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-04-01-preview" - - self.config = config - - def list_by_scope( - self, scope, filter=None, custom_headers=None, raw=False, **operation_config): - """Lists the charges based for the defined scope. - - :param scope: The scope associated with usage details operations. This - includes - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' - for Department scope and - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - for EnrollmentAccount scope. For department and enrollment accounts, - you can also add billing period to the scope using - '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For - e.g. to specify billing period at department scope use - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}' - :type scope: str - :param filter: May be used to filter charges by properties/usageEnd - (Utc time), properties/usageStart (Utc time). 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 - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ChargeSummary or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.consumption.models.ChargeSummary or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list_by_scope.metadata['url'] - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('ChargeSummary', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_by_scope.metadata = {'url': '/{scope}/providers/Microsoft.Consumption/charges'} 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 deleted file mode 100644 index c868e8e3586f..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/forecasts_operations.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse - -from .. import models - - -class ForecastsOperations(object): - """ForecastsOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2019-04-01-preview. Constant value: "2019-04-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-04-01-preview" - - self.config = config - - def list( - self, filter=None, custom_headers=None, raw=False, **operation_config): - """Lists the forecast charges by subscriptionId. - - :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', and 'and'. It does not - currently support 'ne', 'or', or 'not'. - :type filter: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Forecast - :rtype: - ~azure.mgmt.consumption.models.ForecastPaged[~azure.mgmt.consumption.models.Forecast] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.ForecastPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.ForecastPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/forecasts'} 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 deleted file mode 100644 index b090d9105b19..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/marketplaces_operations.py +++ /dev/null @@ -1,139 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse - -from .. import models - - -class MarketplacesOperations(object): - """MarketplacesOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2019-04-01-preview. Constant value: "2019-04-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-04-01-preview" - - self.config = config - - def list( - self, scope, filter=None, top=None, skiptoken=None, custom_headers=None, raw=False, **operation_config): - """Lists the marketplaces for a scope at the defined scope. Marketplaces - are available via this API only for May 1, 2014 or later. - - :param scope: The scope associated with marketplace operations. This - includes '/subscriptions/{subscriptionId}/' for subscription scope, - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' - for resourceGroup scope, - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for - Billing Account scope, - '/providers/Microsoft.Billing/departments/{departmentId}' for - Department scope, - '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' - for EnrollmentAccount scope and - '/providers/Microsoft.Management/managementGroups/{managementGroupId}' - for Management Group scope. For subscription, billing account, - department, enrollment account and ManagementGroup, you can also add - billing period to the scope using - '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For - e.g. to specify billing period at department scope use - '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}' - :type scope: str - :param filter: May be used to filter marketplaces by - properties/usageEnd (Utc time), properties/usageStart (Utc time), - properties/resourceGroup, properties/instanceName or - properties/instanceId. The filter supports 'eq', 'lt', 'gt', 'le', - 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. - :type filter: str - :param top: May be used to limit the number of results to the most - recent N marketplaces. - :type top: int - :param skiptoken: Skiptoken is only used if a previous operation - returned a partial result. If a previous response contains a nextLink - element, the value of the nextLink element will include a skiptoken - parameter that specifies a starting point to use for subsequent calls. - :type skiptoken: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Marketplace - :rtype: - ~azure.mgmt.consumption.models.MarketplacePaged[~azure.mgmt.consumption.models.Marketplace] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) - if skiptoken is not None: - query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.MarketplacePaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.MarketplacePaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/{scope}/providers/Microsoft.Consumption/marketplaces'} 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 deleted file mode 100644 index b271b1472121..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/operations.py +++ /dev/null @@ -1,96 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse - -from .. import models - - -class Operations(object): - """Operations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2019-04-01-preview. Constant value: "2019-04-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-04-01-preview" - - self.config = config - - def list( - self, custom_headers=None, raw=False, **operation_config): - """Lists all of the available consumption REST API operations. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Operation - :rtype: - ~azure.mgmt.consumption.models.OperationPaged[~azure.mgmt.consumption.models.Operation] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list.metadata['url'] - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/providers/Microsoft.Consumption/operations'} 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 deleted file mode 100644 index edd7edfec9ee..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/price_sheet_operations.py +++ /dev/null @@ -1,188 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse - -from .. import models - - -class PriceSheetOperations(object): - """PriceSheetOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2019-04-01-preview. Constant value: "2019-04-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-04-01-preview" - - self.config = config - - def get( - self, expand=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config): - """Gets the price sheet for a scope by subscriptionId. 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. - :type expand: str - :param skiptoken: Skiptoken is only used if a previous operation - returned a partial result. If a previous response contains a nextLink - element, the value of the nextLink element will include a skiptoken - parameter that specifies a starting point to use for subsequent calls. - :type skiptoken: str - :param top: May be used to limit the number of results to the top N - results. - :type top: int - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: PriceSheetResult or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.consumption.models.PriceSheetResult or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - if skiptoken is not None: - query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('PriceSheetResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/pricesheets/default'} - - def get_by_billing_period( - self, billing_period_name, expand=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config): - """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. - - :param billing_period_name: Billing Period Name. - :type billing_period_name: str - :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. - :type expand: str - :param skiptoken: Skiptoken is only used if a previous operation - returned a partial result. If a previous response contains a nextLink - element, the value of the nextLink element will include a skiptoken - parameter that specifies a starting point to use for subsequent calls. - :type skiptoken: str - :param top: May be used to limit the number of results to the top N - results. - :type top: int - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: PriceSheetResult or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.consumption.models.PriceSheetResult or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get_by_billing_period.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'billingPeriodName': self._serialize.url("billing_period_name", billing_period_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - if skiptoken is not None: - query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('PriceSheetResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_by_billing_period.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/pricesheets/default'} 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 deleted file mode 100644 index ba412e904860..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/reservation_recommendations_operations.py +++ /dev/null @@ -1,105 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse - -from .. import models - - -class ReservationRecommendationsOperations(object): - """ReservationRecommendationsOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2019-04-01-preview. Constant value: "2019-04-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-04-01-preview" - - self.config = config - - def list( - self, filter=None, custom_headers=None, raw=False, **operation_config): - """List of recommendations for purchasing reserved instances. - - :param filter: May be used to filter reservationRecommendations by - properties/scope and properties/lookBackPeriod. - :type filter: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ReservationRecommendation - :rtype: - ~azure.mgmt.consumption.models.ReservationRecommendationPaged[~azure.mgmt.consumption.models.ReservationRecommendation] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.ReservationRecommendationPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.ReservationRecommendationPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/reservationRecommendations'} 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 deleted file mode 100644 index 9e36876afa25..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/reservations_details_operations.py +++ /dev/null @@ -1,180 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse - -from .. import models - - -class ReservationsDetailsOperations(object): - """ReservationsDetailsOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2019-04-01-preview. Constant value: "2019-04-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-04-01-preview" - - self.config = config - - def list_by_reservation_order( - self, reservation_order_id, filter, custom_headers=None, raw=False, **operation_config): - """Lists the reservations details for provided date range. - - :param reservation_order_id: Order Id of the reservation - :type reservation_order_id: str - :param filter: Filter reservation details by date range. The - properties/UsageDate for start date and end date. The filter supports - 'le' and 'ge' - :type filter: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ReservationDetail - :rtype: - ~azure.mgmt.consumption.models.ReservationDetailPaged[~azure.mgmt.consumption.models.ReservationDetail] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_reservation_order.metadata['url'] - path_format_arguments = { - 'reservationOrderId': self._serialize.url("reservation_order_id", reservation_order_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.ReservationDetailPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.ReservationDetailPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_reservation_order.metadata = {'url': '/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/providers/Microsoft.Consumption/reservationDetails'} - - def list_by_reservation_order_and_reservation( - self, reservation_order_id, reservation_id, filter, custom_headers=None, raw=False, **operation_config): - """Lists the reservations details for provided date range. - - :param reservation_order_id: Order Id of the reservation - :type reservation_order_id: str - :param reservation_id: Id of the reservation - :type reservation_id: str - :param filter: Filter reservation details by date range. The - properties/UsageDate for start date and end date. The filter supports - 'le' and 'ge' - :type filter: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ReservationDetail - :rtype: - ~azure.mgmt.consumption.models.ReservationDetailPaged[~azure.mgmt.consumption.models.ReservationDetail] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_reservation_order_and_reservation.metadata['url'] - path_format_arguments = { - 'reservationOrderId': self._serialize.url("reservation_order_id", reservation_order_id, 'str'), - 'reservationId': self._serialize.url("reservation_id", reservation_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.ReservationDetailPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.ReservationDetailPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_reservation_order_and_reservation.metadata = {'url': '/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/reservations/{reservationId}/providers/Microsoft.Consumption/reservationDetails'} 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 deleted file mode 100644 index 3ec7d771804e..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/reservations_summaries_operations.py +++ /dev/null @@ -1,188 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse - -from .. import models - - -class ReservationsSummariesOperations(object): - """ReservationsSummariesOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2019-04-01-preview. Constant value: "2019-04-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-04-01-preview" - - self.config = config - - def list_by_reservation_order( - self, reservation_order_id, grain, filter=None, custom_headers=None, raw=False, **operation_config): - """Lists the reservations summaries for daily or monthly grain. - - :param reservation_order_id: Order Id of the reservation - :type reservation_order_id: str - :param grain: Can be daily or monthly. Possible values include: - 'DailyGrain', 'MonthlyGrain' - :type grain: str or ~azure.mgmt.consumption.models.Datagrain - :param filter: Required only for daily grain. The properties/UsageDate - for start date and end date. The filter supports 'le' and 'ge' - :type filter: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ReservationSummary - :rtype: - ~azure.mgmt.consumption.models.ReservationSummaryPaged[~azure.mgmt.consumption.models.ReservationSummary] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_reservation_order.metadata['url'] - path_format_arguments = { - 'reservationOrderId': self._serialize.url("reservation_order_id", reservation_order_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['grain'] = self._serialize.query("grain", grain, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.ReservationSummaryPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.ReservationSummaryPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_reservation_order.metadata = {'url': '/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/providers/Microsoft.Consumption/reservationSummaries'} - - def list_by_reservation_order_and_reservation( - self, reservation_order_id, reservation_id, grain, filter=None, custom_headers=None, raw=False, **operation_config): - """Lists the reservations summaries for daily or monthly grain. - - :param reservation_order_id: Order Id of the reservation - :type reservation_order_id: str - :param reservation_id: Id of the reservation - :type reservation_id: str - :param grain: Can be daily or monthly. Possible values include: - 'DailyGrain', 'MonthlyGrain' - :type grain: str or ~azure.mgmt.consumption.models.Datagrain - :param filter: Required only for daily grain. The properties/UsageDate - for start date and end date. The filter supports 'le' and 'ge' - :type filter: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ReservationSummary - :rtype: - ~azure.mgmt.consumption.models.ReservationSummaryPaged[~azure.mgmt.consumption.models.ReservationSummary] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_reservation_order_and_reservation.metadata['url'] - path_format_arguments = { - 'reservationOrderId': self._serialize.url("reservation_order_id", reservation_order_id, 'str'), - 'reservationId': self._serialize.url("reservation_id", reservation_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['grain'] = self._serialize.query("grain", grain, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.ReservationSummaryPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.ReservationSummaryPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_reservation_order_and_reservation.metadata = {'url': '/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/reservations/{reservationId}/providers/Microsoft.Consumption/reservationSummaries'} 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 deleted file mode 100644 index bd200f98a583..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/tags_operations.py +++ /dev/null @@ -1,105 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse - -from .. import models - - -class TagsOperations(object): - """TagsOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2019-04-01-preview. Constant value: "2019-04-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-04-01-preview" - - self.config = config - - def get( - self, scope, custom_headers=None, raw=False, **operation_config): - """Get all available tag keys for the defined scope. - - :param scope: The scope associated with tags operations. This includes - '/subscriptions/{subscriptionId}/' for subscription scope, - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' - for resourceGroup scope, - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for - Billing Account scope, - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' - for Department scope, - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - for EnrollmentAccount scope and - '/providers/Microsoft.Management/managementGroups/{managementGroupId}' - for Management Group scope.. - :type scope: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: TagsResult or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.consumption.models.TagsResult or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('TagsResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/{scope}/providers/Microsoft.Consumption/tags'} 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 deleted file mode 100644 index 44fa3a96b4cd..000000000000 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/usage_details_operations.py +++ /dev/null @@ -1,278 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling - -from .. import models - - -class UsageDetailsOperations(object): - """UsageDetailsOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2019-04-01-preview. Constant value: "2019-04-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-04-01-preview" - - self.config = config - - def list( - self, scope, expand=None, filter=None, skiptoken=None, top=None, metric=None, custom_headers=None, raw=False, **operation_config): - """Lists the usage details for the defined scope. Usage details are - available via this API only for May 1, 2014 or later. - - :param scope: The scope associated with usage details operations. This - includes '/subscriptions/{subscriptionId}/' for subscription scope, - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' - for resourceGroup scope, - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for - Billing Account scope, - '/providers/Microsoft.Billing/departments/{departmentId}' for - Department scope, - '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' - for EnrollmentAccount scope and - '/providers/Microsoft.Management/managementGroups/{managementGroupId}' - for Management Group scope. For subscription, billing account, - department, enrollment account and management group, you can also add - billing period to the scope using - '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For - e.g. to specify billing period at department scope use - '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}' - :type scope: str - :param expand: May be used to expand the properties/additionalInfo or - properties/meterDetails within a list of usage details. By default, - these fields are not included when listing usage details. - :type expand: str - :param filter: May be used to filter usageDetails by - properties/resourceGroup, properties/resourceName, - properties/resourceId, properties/chargeType, properties/reservationId - or tags. 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 - :param skiptoken: Skiptoken is only used if a previous operation - returned a partial result. If a previous response contains a nextLink - element, the value of the nextLink element will include a skiptoken - parameter that specifies a starting point to use for subsequent calls. - :type skiptoken: str - :param top: May be used to limit the number of results to the most - recent N usageDetails. - :type top: int - :param metric: Allows to select different type of cost/usage records. - Possible values include: 'ActualCostMetricType', - 'AmortizedCostMetricType', 'UsageMetricType' - :type metric: str or ~azure.mgmt.consumption.models.Metrictype - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of UsageDetail - :rtype: - ~azure.mgmt.consumption.models.UsageDetailPaged[~azure.mgmt.consumption.models.UsageDetail] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if skiptoken is not None: - query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if metric is not None: - query_parameters['metric'] = self._serialize.query("metric", metric, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.UsageDetailPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.UsageDetailPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/{scope}/providers/Microsoft.Consumption/usageDetails'} - - - def _download_initial( - self, scope, metric=None, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.download.metadata['url'] - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if metric is not None: - query_parameters['metric'] = self._serialize.query("metric", metric, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 202]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - header_dict = {} - - if response.status_code == 200: - deserialized = self._deserialize('UsageDetailsDownloadResponse', response) - header_dict = { - 'Location': 'str', - 'Retry-After': 'str', - 'Azure-AsyncOperation': 'str', - } - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - client_raw_response.add_headers(header_dict) - return client_raw_response - - return deserialized - - def download( - self, scope, metric=None, custom_headers=None, raw=False, polling=True, **operation_config): - """Download usage details data. - - :param scope: The scope associated with usage details operations. This - includes '/subscriptions/{subscriptionId}/' for subscription scope, - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' - for resourceGroup scope, - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for - Billing Account scope, - '/providers/Microsoft.Billing/departments/{departmentId}' for - Department scope, - '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' - for EnrollmentAccount scope and - '/providers/Microsoft.Management/managementGroups/{managementGroupId}' - for Management Group scope. For subscription, billing account, - department, enrollment account and management group, you can also add - billing period to the scope using - '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For - e.g. to specify billing period at department scope use - '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}' - :type scope: str - :param metric: Allows to select different type of cost/usage records. - Possible values include: 'ActualCostMetricType', - 'AmortizedCostMetricType', 'UsageMetricType' - :type metric: str or ~azure.mgmt.consumption.models.Metrictype - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns - UsageDetailsDownloadResponse or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.consumption.models.UsageDetailsDownloadResponse] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.consumption.models.UsageDetailsDownloadResponse]] - :raises: - :class:`ErrorResponseException` - """ - raw_result = self._download_initial( - scope=scope, - metric=metric, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - header_dict = { - 'Location': 'str', - 'Retry-After': 'str', - 'Azure-AsyncOperation': 'str', - } - deserialized = self._deserialize('UsageDetailsDownloadResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - client_raw_response.add_headers(header_dict) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - download.metadata = {'url': '/{scope}/providers/Microsoft.Consumption/usageDetails/download'} diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/py.typed b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/consumption/azure-mgmt-consumption/setup.py b/sdk/consumption/azure-mgmt-consumption/setup.py index c12e831fdc02..b2a68217f42d 100644 --- a/sdk/consumption/azure-mgmt-consumption/setup.py +++ b/sdk/consumption/azure-mgmt-consumption/setup.py @@ -36,7 +36,7 @@ pass # Version extraction inspired from 'requests' -with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd: +with open(os.path.join(package_folder_path, '_version.py'), 'r') as fd: version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) @@ -79,8 +79,8 @@ ]), install_requires=[ 'msrest>=0.5.0', - 'msrestazure>=0.4.32,<2.0.0', 'azure-common~=1.1', + 'azure-mgmt-core>=1.2.0,<2.0.0' ], extras_require={ ":python_version<'3.0'": ['azure-mgmt-nspkg'], diff --git a/sdk/consumption/azure-mgmt-consumption/tests/recordings/test_budgets.test_budgets.yaml b/sdk/consumption/azure-mgmt-consumption/tests/recordings/test_budgets.test_budgets.yaml new file mode 100644 index 000000000000..7d80664e691b --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/tests/recordings/test_budgets.test_budgets.yaml @@ -0,0 +1,139 @@ +interactions: +- request: + body: '{"properties": {"category": "Cost", "amount": 100.0, "timeGrain": "Monthly", + "timePeriod": {"startDate": "2020-10-01T00:00:00.000Z", "endDate": "2021-10-31T00:00:00.000Z"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '173' + Content-Type: + - application/json + User-Agent: + - azsdk-python-mgmt-consumption/8.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_budgets_test_budgets85c60a49/providers/Microsoft.Consumption/budgets/budget85c60a49?api-version=2019-10-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_budgets_test_budgets85c60a49/providers/Microsoft.Consumption/budgets/budget85c60a49","name":"budget85c60a49","type":"Microsoft.Consumption/budgets","eTag":"\"1d6acfa6f0a7cf1\"","properties":{"timePeriod":{"startDate":"2020-10-01T00:00:00Z","endDate":"2021-10-31T00:00:00Z"},"timeGrain":"Monthly","amount":100.0,"currentSpend":null,"category":"Cost","notifications":{},"filter":{},"currencySetting":"None"}}' + headers: + cache-control: + - no-cache + content-length: + - '485' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Oct 2020 07:17:45 GMT + expires: + - '-1' + pragma: + - no-cache + session-id: + - abd61b51-746c-49b7-8764-f2a277a40e03 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1196' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-consumption/8.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_budgets_test_budgets85c60a49/providers/Microsoft.Consumption/budgets/budget85c60a49?api-version=2019-10-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_budgets_test_budgets85c60a49/providers/Microsoft.Consumption/budgets/budget85c60a49","name":"budget85c60a49","type":"Microsoft.Consumption/budgets","eTag":"\"1d6acfa6f0a7cf1\"","properties":{"timePeriod":{"startDate":"2020-10-01T00:00:00Z","endDate":"2021-10-31T00:00:00Z"},"timeGrain":"Monthly","amount":100.0,"currentSpend":{"amount":0.0,"unit":null},"category":"Cost","notifications":{},"filter":{},"currencySetting":"None"}}' + headers: + cache-control: + - no-cache + content-length: + - '507' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Oct 2020 07:17:49 GMT + expires: + - '-1' + pragma: + - no-cache + session-id: + - d23ea974-50c7-43ee-8f6e-93c4eb92de7c + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-mgmt-consumption/8.0.0b1 Python/3.6.9 (Linux-4.19.76-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_budgets_test_budgets85c60a49/providers/Microsoft.Consumption/budgets/budget85c60a49?api-version=2019-10-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Wed, 28 Oct 2020 07:17:50 GMT + expires: + - '-1' + pragma: + - no-cache + session-id: + - 9760f79a-af33-48fc-b2d3-e40480b6ff94 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14996' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/consumption/azure-mgmt-consumption/tests/test_budgets.py b/sdk/consumption/azure-mgmt-consumption/tests/test_budgets.py new file mode 100644 index 000000000000..6302d37100f6 --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/tests/test_budgets.py @@ -0,0 +1,50 @@ +# coding: utf-8 + +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- +import datetime +import unittest + +import azure.mgmt.consumption +import azure.mgmt.consumption.models +from devtools_testutils import AzureMgmtTestCase, ResourceGroupPreparer + + +class MgmtConsumptionTest(AzureMgmtTestCase): + + def setUp(self): + super(MgmtConsumptionTest, self).setUp() + self.consumption_client = self.create_mgmt_client( + azure.mgmt.consumption.ConsumptionManagementClient + ) + + @ResourceGroupPreparer() + def test_budgets(self, resource_group): + SUBSCRIPTION_ID = getattr(self.settings, 'SUBSCRIPTION_ID', "123") + SCOPE = '/subscriptions/{}/resourceGroups/{}'.format(SUBSCRIPTION_ID, resource_group.name) + BUDGET_NAME = self.get_resource_name('budget') + # create + BODY = { + "category": "Cost", + "amount": '100', + "timeGrain": "Monthly", + "timePeriod": { + "startDate": "2020-10-01T00:00:00Z", + "endDate": "2021-10-31T00:00:00Z" + } + } + self.consumption_client.budgets.create_or_update(SCOPE, BUDGET_NAME, BODY) + + # get + self.consumption_client.budgets.get(SCOPE, BUDGET_NAME) + + # delete + self.consumption_client.budgets.delete(SCOPE, BUDGET_NAME) + + +# ------------------------------------------------------------------------------ +if __name__ == '__main__': + unittest.main()