|
| 1 | +# coding=utf-8 |
| 2 | +# -------------------------------------------------------------------------- |
| 3 | +# Copyright (c) Microsoft Corporation. All rights reserved. |
| 4 | +# Licensed under the MIT License. See License.txt in the project root for license information. |
| 5 | +# Code generated by Microsoft (R) AutoRest Code Generator. |
| 6 | +# Changes may cause incorrect behavior and will be lost if the code is regenerated. |
| 7 | +# -------------------------------------------------------------------------- |
| 8 | + |
| 9 | +from typing import TYPE_CHECKING |
| 10 | + |
| 11 | +from azure.mgmt.core import ARMPipelineClient |
| 12 | +from msrest import Deserializer, Serializer |
| 13 | + |
| 14 | +if TYPE_CHECKING: |
| 15 | + # pylint: disable=unused-import,ungrouped-imports |
| 16 | + from typing import Any, Optional |
| 17 | + |
| 18 | + from azure.core.credentials import TokenCredential |
| 19 | + |
| 20 | +from ._configuration import ConsumptionManagementClientConfiguration |
| 21 | +from .operations import UsageDetailsOperations |
| 22 | +from .operations import MarketplacesOperations |
| 23 | +from .operations import BudgetsOperations |
| 24 | +from .operations import TagsOperations |
| 25 | +from .operations import ChargesOperations |
| 26 | +from .operations import BalancesOperations |
| 27 | +from .operations import ReservationsSummariesOperations |
| 28 | +from .operations import ReservationsDetailsOperations |
| 29 | +from .operations import ReservationRecommendationsOperations |
| 30 | +from .operations import ReservationRecommendationDetailsOperations |
| 31 | +from .operations import ReservationTransactionsOperations |
| 32 | +from .operations import PriceSheetOperations |
| 33 | +from .operations import ForecastsOperations |
| 34 | +from .operations import Operations |
| 35 | +from .operations import AggregatedCostOperations |
| 36 | +from .operations import EventsOperations |
| 37 | +from .operations import LotsOperations |
| 38 | +from .operations import CreditsOperations |
| 39 | +from . import models |
| 40 | + |
| 41 | + |
| 42 | +class ConsumptionManagementClient(object): |
| 43 | + """Consumption management client provides access to consumption resources for Azure Enterprise Subscriptions. |
| 44 | +
|
| 45 | + :ivar usage_details: UsageDetailsOperations operations |
| 46 | + :vartype usage_details: azure.mgmt.consumption.operations.UsageDetailsOperations |
| 47 | + :ivar marketplaces: MarketplacesOperations operations |
| 48 | + :vartype marketplaces: azure.mgmt.consumption.operations.MarketplacesOperations |
| 49 | + :ivar budgets: BudgetsOperations operations |
| 50 | + :vartype budgets: azure.mgmt.consumption.operations.BudgetsOperations |
| 51 | + :ivar tags: TagsOperations operations |
| 52 | + :vartype tags: azure.mgmt.consumption.operations.TagsOperations |
| 53 | + :ivar charges: ChargesOperations operations |
| 54 | + :vartype charges: azure.mgmt.consumption.operations.ChargesOperations |
| 55 | + :ivar balances: BalancesOperations operations |
| 56 | + :vartype balances: azure.mgmt.consumption.operations.BalancesOperations |
| 57 | + :ivar reservations_summaries: ReservationsSummariesOperations operations |
| 58 | + :vartype reservations_summaries: azure.mgmt.consumption.operations.ReservationsSummariesOperations |
| 59 | + :ivar reservations_details: ReservationsDetailsOperations operations |
| 60 | + :vartype reservations_details: azure.mgmt.consumption.operations.ReservationsDetailsOperations |
| 61 | + :ivar reservation_recommendations: ReservationRecommendationsOperations operations |
| 62 | + :vartype reservation_recommendations: azure.mgmt.consumption.operations.ReservationRecommendationsOperations |
| 63 | + :ivar reservation_recommendation_details: ReservationRecommendationDetailsOperations operations |
| 64 | + :vartype reservation_recommendation_details: azure.mgmt.consumption.operations.ReservationRecommendationDetailsOperations |
| 65 | + :ivar reservation_transactions: ReservationTransactionsOperations operations |
| 66 | + :vartype reservation_transactions: azure.mgmt.consumption.operations.ReservationTransactionsOperations |
| 67 | + :ivar price_sheet: PriceSheetOperations operations |
| 68 | + :vartype price_sheet: azure.mgmt.consumption.operations.PriceSheetOperations |
| 69 | + :ivar forecasts: ForecastsOperations operations |
| 70 | + :vartype forecasts: azure.mgmt.consumption.operations.ForecastsOperations |
| 71 | + :ivar operations: Operations operations |
| 72 | + :vartype operations: azure.mgmt.consumption.operations.Operations |
| 73 | + :ivar aggregated_cost: AggregatedCostOperations operations |
| 74 | + :vartype aggregated_cost: azure.mgmt.consumption.operations.AggregatedCostOperations |
| 75 | + :ivar events: EventsOperations operations |
| 76 | + :vartype events: azure.mgmt.consumption.operations.EventsOperations |
| 77 | + :ivar lots: LotsOperations operations |
| 78 | + :vartype lots: azure.mgmt.consumption.operations.LotsOperations |
| 79 | + :ivar credits: CreditsOperations operations |
| 80 | + :vartype credits: azure.mgmt.consumption.operations.CreditsOperations |
| 81 | + :param credential: Credential needed for the client to connect to Azure. |
| 82 | + :type credential: ~azure.core.credentials.TokenCredential |
| 83 | + :param subscription_id: Azure Subscription ID. |
| 84 | + :type subscription_id: str |
| 85 | + :param str base_url: Service URL |
| 86 | + """ |
| 87 | + |
| 88 | + def __init__( |
| 89 | + self, |
| 90 | + credential, # type: "TokenCredential" |
| 91 | + subscription_id, # type: str |
| 92 | + base_url=None, # type: Optional[str] |
| 93 | + **kwargs # type: Any |
| 94 | + ): |
| 95 | + # type: (...) -> None |
| 96 | + if not base_url: |
| 97 | + base_url = 'https://management.azure.com' |
| 98 | + self._config = ConsumptionManagementClientConfiguration(credential, subscription_id, **kwargs) |
| 99 | + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) |
| 100 | + |
| 101 | + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} |
| 102 | + self._serialize = Serializer(client_models) |
| 103 | + self._serialize.client_side_validation = False |
| 104 | + self._deserialize = Deserializer(client_models) |
| 105 | + |
| 106 | + self.usage_details = UsageDetailsOperations( |
| 107 | + self._client, self._config, self._serialize, self._deserialize) |
| 108 | + self.marketplaces = MarketplacesOperations( |
| 109 | + self._client, self._config, self._serialize, self._deserialize) |
| 110 | + self.budgets = BudgetsOperations( |
| 111 | + self._client, self._config, self._serialize, self._deserialize) |
| 112 | + self.tags = TagsOperations( |
| 113 | + self._client, self._config, self._serialize, self._deserialize) |
| 114 | + self.charges = ChargesOperations( |
| 115 | + self._client, self._config, self._serialize, self._deserialize) |
| 116 | + self.balances = BalancesOperations( |
| 117 | + self._client, self._config, self._serialize, self._deserialize) |
| 118 | + self.reservations_summaries = ReservationsSummariesOperations( |
| 119 | + self._client, self._config, self._serialize, self._deserialize) |
| 120 | + self.reservations_details = ReservationsDetailsOperations( |
| 121 | + self._client, self._config, self._serialize, self._deserialize) |
| 122 | + self.reservation_recommendations = ReservationRecommendationsOperations( |
| 123 | + self._client, self._config, self._serialize, self._deserialize) |
| 124 | + self.reservation_recommendation_details = ReservationRecommendationDetailsOperations( |
| 125 | + self._client, self._config, self._serialize, self._deserialize) |
| 126 | + self.reservation_transactions = ReservationTransactionsOperations( |
| 127 | + self._client, self._config, self._serialize, self._deserialize) |
| 128 | + self.price_sheet = PriceSheetOperations( |
| 129 | + self._client, self._config, self._serialize, self._deserialize) |
| 130 | + self.forecasts = ForecastsOperations( |
| 131 | + self._client, self._config, self._serialize, self._deserialize) |
| 132 | + self.operations = Operations( |
| 133 | + self._client, self._config, self._serialize, self._deserialize) |
| 134 | + self.aggregated_cost = AggregatedCostOperations( |
| 135 | + self._client, self._config, self._serialize, self._deserialize) |
| 136 | + self.events = EventsOperations( |
| 137 | + self._client, self._config, self._serialize, self._deserialize) |
| 138 | + self.lots = LotsOperations( |
| 139 | + self._client, self._config, self._serialize, self._deserialize) |
| 140 | + self.credits = CreditsOperations( |
| 141 | + self._client, self._config, self._serialize, self._deserialize) |
| 142 | + |
| 143 | + def close(self): |
| 144 | + # type: () -> None |
| 145 | + self._client.close() |
| 146 | + |
| 147 | + def __enter__(self): |
| 148 | + # type: () -> ConsumptionManagementClient |
| 149 | + self._client.__enter__() |
| 150 | + return self |
| 151 | + |
| 152 | + def __exit__(self, *exc_details): |
| 153 | + # type: (Any) -> None |
| 154 | + self._client.__exit__(*exc_details) |
0 commit comments