From 1605d1d9ec3789bfc5c34a3284faa9115c5e0184 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 15 Jan 2021 01:36:32 +0000 Subject: [PATCH] CodeGen from PR 12347 in Azure/azure-rest-api-specs Merge dbfa861cb8fb60af39883e6dbe1c55eb10c5afd6 into d4bad535d456ee82c7fd17d1ec2b8802a0b83205 --- .../_consumption_management_client.py | 1 - .../azure/mgmt/consumption/_metadata.json | 78 +++++++++++++++++++ .../azure/mgmt/consumption/_version.py | 2 +- .../aio/_consumption_management_client.py | 1 - .../aio/operations/_budgets_operations.py | 6 +- .../aio/operations/_forecasts_operations.py | 4 +- .../aio/operations/_tags_operations.py | 12 +-- .../_consumption_management_client_enums.py | 4 +- .../azure/mgmt/consumption/models/_models.py | 39 +++++++--- .../mgmt/consumption/models/_models_py3.py | 39 +++++++--- .../operations/_budgets_operations.py | 6 +- .../operations/_forecasts_operations.py | 4 +- .../operations/_tags_operations.py | 12 +-- 13 files changed, 162 insertions(+), 46 deletions(-) create mode 100644 sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/_metadata.json diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/_consumption_management_client.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/_consumption_management_client.py index bd8acadb67e73..a1c1123401837 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/_consumption_management_client.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/_consumption_management_client.py @@ -100,7 +100,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.usage_details = UsageDetailsOperations( diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/_metadata.json b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/_metadata.json new file mode 100644 index 0000000000000..bc5fe34a48b3d --- /dev/null +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/_metadata.json @@ -0,0 +1,78 @@ +{ + "chosen_version": "2019-10-01", + "total_api_version_list": ["2019-10-01"], + "client": { + "name": "ConsumptionManagementClient", + "filename": "_consumption_management_client", + "description": "Consumption management client provides access to consumption resources for Azure Enterprise Subscriptions.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": false, + "client_side_validation": true + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "Azure Subscription ID.", + "docstring_type": "str", + "required": true + } + }, + "async": { + "credential": { + "signature": "credential, # type: \"AsyncTokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "Azure Subscription ID.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id" + }, + "config": { + "credential": true, + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null + }, + "operation_groups": { + "usage_details": "UsageDetailsOperations", + "marketplaces": "MarketplacesOperations", + "budgets": "BudgetsOperations", + "tags": "TagsOperations", + "charges": "ChargesOperations", + "balances": "BalancesOperations", + "reservations_summaries": "ReservationsSummariesOperations", + "reservations_details": "ReservationsDetailsOperations", + "reservation_recommendations": "ReservationRecommendationsOperations", + "reservation_recommendation_details": "ReservationRecommendationDetailsOperations", + "reservation_transactions": "ReservationTransactionsOperations", + "price_sheet": "PriceSheetOperations", + "forecasts": "ForecastsOperations", + "operations": "Operations", + "aggregated_cost": "AggregatedCostOperations", + "events": "EventsOperations", + "lots": "LotsOperations", + "credits": "CreditsOperations" + }, + "operation_mixins": { + }, + "sync_imports": "None", + "async_imports": "None" +} \ No newline at end of file diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/_version.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/_version.py index 142a0420b39b4..48944bf3938a2 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/_version.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "8.0.0" +VERSION = "2.0.0" diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/_consumption_management_client.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/_consumption_management_client.py index c709a3e4f1e96..939f029e5d9ed 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/_consumption_management_client.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/_consumption_management_client.py @@ -97,7 +97,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.usage_details = UsageDetailsOperations( diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_budgets_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_budgets_operations.py index 7d802a0352a96..68f1f28c763ff 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_budgets_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_budgets_operations.py @@ -202,9 +202,9 @@ async def create_or_update( 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. + """The operation to create or update a budget. You can optionally provide an eTag if desired as a + form of concurrency control. To obtain the latest eTag for a given budget, perform a get + operation prior to your put operation. :param scope: The scope associated with budget operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_forecasts_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_forecasts_operations.py index 3e0e3c744c1d7..07acafc32c200 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_forecasts_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_forecasts_operations.py @@ -46,7 +46,9 @@ def list( filter: Optional[str] = None, **kwargs ) -> AsyncIterable["_models.ForecastsListResult"]: - """Lists the forecast charges by subscriptionId. + """Lists the forecast charges for scope defined. Please note that this API is no longer actively + under development. We recommend using our new Forecast API moving forward: + https://docs.microsoft.com/en-us/rest/api/cost-management/forecast/usage. :param filter: May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_tags_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_tags_operations.py index a2f7be0f3a48c..7f380847962e5 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_tags_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_tags_operations.py @@ -44,7 +44,7 @@ async def get( self, scope: str, **kwargs - ) -> "_models.TagsResult": + ) -> Optional["_models.TagsResult"]: """Get all available tag keys for the defined scope. :param scope: The scope associated with tags operations. This includes @@ -60,10 +60,10 @@ async def get( :type scope: str :keyword callable cls: A custom type or function that will be passed the direct response :return: TagsResult, or the result of cls(response) - :rtype: ~azure.mgmt.consumption.models.TagsResult + :rtype: ~azure.mgmt.consumption.models.TagsResult or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.TagsResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.TagsResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -90,12 +90,14 @@ async def get( pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('TagsResult', pipeline_response) + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TagsResult', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/_consumption_management_client_enums.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/_consumption_management_client_enums.py index cd7ad1ca77c15..a58240c3f7bd5 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/_consumption_management_client_enums.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/_consumption_management_client_enums.py @@ -85,7 +85,9 @@ class EventType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): NEW_CREDIT = "NewCredit" class Grain(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The granularity of forecast. + """The granularity of forecast. Please note that Yearly is not currently supported in this API. + The API will provide responses in the Monthly grain if Yearly is selected. To get yearly grain + data, please use our newer Forecast API. """ DAILY = "Daily" diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/_models.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/_models.py index ba7caff4e7157..a5ed182b7582b 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/_models.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/_models.py @@ -323,7 +323,7 @@ class Budget(ProxyResource): Future start date should not be more than twelve months. Past start date should be selected within the timegrain period. There are no restrictions on the end date. :type time_period: ~azure.mgmt.consumption.models.BudgetTimePeriod - :param filter: May be used to filter budgets by resource group, resource, or meter. + :param filter: May be used to filter budgets by user-specified dimensions and/or tags. :type filter: ~azure.mgmt.consumption.models.BudgetFilter :ivar current_spend: The current amount of cost which is being tracked for a budget. :vartype current_spend: ~azure.mgmt.consumption.models.CurrentSpend @@ -897,8 +897,10 @@ class Forecast(Resource): :vartype tags: dict[str, str] :ivar usage_date: The usage date of the forecast. :vartype usage_date: str - :param grain: The granularity of forecast. Possible values include: "Daily", "Monthly", - "Yearly". + :param grain: The granularity of forecast. Please note that Yearly is not currently supported + in this API. The API will provide responses in the Monthly grain if Yearly is selected. To get + yearly grain data, please use our newer Forecast API. Possible values include: "Daily", + "Monthly", "Yearly". :type grain: str or ~azure.mgmt.consumption.models.Grain :ivar charge: The amount of charge. :vartype charge: float @@ -1210,7 +1212,7 @@ class LegacyReservationRecommendation(ReservationRecommendation): :ivar look_back_period: The number of days of usage to look back for recommendation. :vartype look_back_period: str :ivar instance_flexibility_ratio: The instance Flexibility Ratio. - :vartype instance_flexibility_ratio: int + :vartype instance_flexibility_ratio: float :ivar instance_flexibility_group: The instance Flexibility Group. :vartype instance_flexibility_group: str :ivar normalized_size: The normalized Size. @@ -1270,7 +1272,7 @@ class LegacyReservationRecommendation(ReservationRecommendation): 'tags': {'key': 'tags', 'type': '{str}'}, 'kind': {'key': 'kind', 'type': 'str'}, 'look_back_period': {'key': 'properties.lookBackPeriod', 'type': 'str'}, - 'instance_flexibility_ratio': {'key': 'properties.instanceFlexibilityRatio', 'type': 'int'}, + 'instance_flexibility_ratio': {'key': 'properties.instanceFlexibilityRatio', 'type': 'float'}, 'instance_flexibility_group': {'key': 'properties.instanceFlexibilityGroup', 'type': 'str'}, 'normalized_size': {'key': 'properties.normalizedSize', 'type': 'str'}, 'recommended_quantity_normalized': {'key': 'properties.recommendedQuantityNormalized', 'type': 'float'}, @@ -2546,7 +2548,7 @@ class ModernReservationRecommendation(ReservationRecommendation): :ivar look_back_period: The number of days of usage to look back for recommendation. :vartype look_back_period: str :ivar instance_flexibility_ratio: The instance Flexibility Ratio. - :vartype instance_flexibility_ratio: int + :vartype instance_flexibility_ratio: float :ivar instance_flexibility_group: The instance Flexibility Group. :vartype instance_flexibility_group: str :ivar normalized_size: The normalized Size. @@ -2606,7 +2608,7 @@ class ModernReservationRecommendation(ReservationRecommendation): 'tags': {'key': 'tags', 'type': '{str}'}, 'kind': {'key': 'kind', 'type': 'str'}, 'look_back_period': {'key': 'properties.lookBackPeriod', 'type': 'str'}, - 'instance_flexibility_ratio': {'key': 'properties.instanceFlexibilityRatio', 'type': 'int'}, + 'instance_flexibility_ratio': {'key': 'properties.instanceFlexibilityRatio', 'type': 'float'}, 'instance_flexibility_group': {'key': 'properties.instanceFlexibilityGroup', 'type': 'str'}, 'normalized_size': {'key': 'properties.normalizedSize', 'type': 'str'}, 'recommended_quantity_normalized': {'key': 'properties.recommendedQuantityNormalized', 'type': 'float'}, @@ -3242,15 +3244,18 @@ class Notification(msrest.serialization.Model): 1000. :type threshold: float :param contact_emails: Required. Email addresses to send the budget notification to when the - threshold is exceeded. + threshold is exceeded. Must have at least one contact email or contact group specified at the + Subscription or Resource Group scopes. All other scopes must have at least one contact email + specified. :type contact_emails: list[str] :param contact_roles: Contact roles to send the budget notification to when the threshold is exceeded. :type contact_roles: list[str] :param contact_groups: Action groups to send the budget notification to when the threshold is - exceeded. + exceeded. Only supported at Subscription or Resource Group scopes. :type contact_groups: list[str] - :param threshold_type: The type of threshold. Possible values include: "Actual". + :param threshold_type: The type of threshold. Possible values include: "Actual". Default value: + "Actual". :type threshold_type: str or ~azure.mgmt.consumption.models.ThresholdType """ @@ -3258,7 +3263,7 @@ class Notification(msrest.serialization.Model): 'enabled': {'required': True}, 'operator': {'required': True}, 'threshold': {'required': True}, - 'contact_emails': {'required': True, 'max_items': 50, 'min_items': 1}, + 'contact_emails': {'required': True, 'max_items': 50, 'min_items': 0}, 'contact_groups': {'max_items': 50, 'min_items': 0}, } @@ -3283,7 +3288,7 @@ def __init__( self.contact_emails = kwargs['contact_emails'] self.contact_roles = kwargs.get('contact_roles', None) self.contact_groups = kwargs.get('contact_groups', None) - self.threshold_type = kwargs.get('threshold_type', None) + self.threshold_type = kwargs.get('threshold_type', "Actual") class Operation(msrest.serialization.Model): @@ -4184,12 +4189,18 @@ class TagsResult(ProxyResource): :type e_tag: str :param tags: A set of tags. A list of Tag. :type tags: list[~azure.mgmt.consumption.models.Tag] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + :ivar previous_link: The link (url) to the previous page of results. + :vartype previous_link: str """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'next_link': {'readonly': True}, + 'previous_link': {'readonly': True}, } _attribute_map = { @@ -4198,6 +4209,8 @@ class TagsResult(ProxyResource): 'type': {'key': 'type', 'type': 'str'}, 'e_tag': {'key': 'eTag', 'type': 'str'}, 'tags': {'key': 'properties.tags', 'type': '[Tag]'}, + 'next_link': {'key': 'properties.nextLink', 'type': 'str'}, + 'previous_link': {'key': 'properties.previousLink', 'type': 'str'}, } def __init__( @@ -4206,6 +4219,8 @@ def __init__( ): super(TagsResult, self).__init__(**kwargs) self.tags = kwargs.get('tags', None) + self.next_link = None + self.previous_link = None class UsageDetailsListResult(msrest.serialization.Model): diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/_models_py3.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/_models_py3.py index aacfd19b6a23e..2010b4bceddc3 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/_models_py3.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/models/_models_py3.py @@ -332,7 +332,7 @@ class Budget(ProxyResource): Future start date should not be more than twelve months. Past start date should be selected within the timegrain period. There are no restrictions on the end date. :type time_period: ~azure.mgmt.consumption.models.BudgetTimePeriod - :param filter: May be used to filter budgets by resource group, resource, or meter. + :param filter: May be used to filter budgets by user-specified dimensions and/or tags. :type filter: ~azure.mgmt.consumption.models.BudgetFilter :ivar current_spend: The current amount of cost which is being tracked for a budget. :vartype current_spend: ~azure.mgmt.consumption.models.CurrentSpend @@ -933,8 +933,10 @@ class Forecast(Resource): :vartype tags: dict[str, str] :ivar usage_date: The usage date of the forecast. :vartype usage_date: str - :param grain: The granularity of forecast. Possible values include: "Daily", "Monthly", - "Yearly". + :param grain: The granularity of forecast. Please note that Yearly is not currently supported + in this API. The API will provide responses in the Monthly grain if Yearly is selected. To get + yearly grain data, please use our newer Forecast API. Possible values include: "Daily", + "Monthly", "Yearly". :type grain: str or ~azure.mgmt.consumption.models.Grain :ivar charge: The amount of charge. :vartype charge: float @@ -1251,7 +1253,7 @@ class LegacyReservationRecommendation(ReservationRecommendation): :ivar look_back_period: The number of days of usage to look back for recommendation. :vartype look_back_period: str :ivar instance_flexibility_ratio: The instance Flexibility Ratio. - :vartype instance_flexibility_ratio: int + :vartype instance_flexibility_ratio: float :ivar instance_flexibility_group: The instance Flexibility Group. :vartype instance_flexibility_group: str :ivar normalized_size: The normalized Size. @@ -1311,7 +1313,7 @@ class LegacyReservationRecommendation(ReservationRecommendation): 'tags': {'key': 'tags', 'type': '{str}'}, 'kind': {'key': 'kind', 'type': 'str'}, 'look_back_period': {'key': 'properties.lookBackPeriod', 'type': 'str'}, - 'instance_flexibility_ratio': {'key': 'properties.instanceFlexibilityRatio', 'type': 'int'}, + 'instance_flexibility_ratio': {'key': 'properties.instanceFlexibilityRatio', 'type': 'float'}, 'instance_flexibility_group': {'key': 'properties.instanceFlexibilityGroup', 'type': 'str'}, 'normalized_size': {'key': 'properties.normalizedSize', 'type': 'str'}, 'recommended_quantity_normalized': {'key': 'properties.recommendedQuantityNormalized', 'type': 'float'}, @@ -2591,7 +2593,7 @@ class ModernReservationRecommendation(ReservationRecommendation): :ivar look_back_period: The number of days of usage to look back for recommendation. :vartype look_back_period: str :ivar instance_flexibility_ratio: The instance Flexibility Ratio. - :vartype instance_flexibility_ratio: int + :vartype instance_flexibility_ratio: float :ivar instance_flexibility_group: The instance Flexibility Group. :vartype instance_flexibility_group: str :ivar normalized_size: The normalized Size. @@ -2651,7 +2653,7 @@ class ModernReservationRecommendation(ReservationRecommendation): 'tags': {'key': 'tags', 'type': '{str}'}, 'kind': {'key': 'kind', 'type': 'str'}, 'look_back_period': {'key': 'properties.lookBackPeriod', 'type': 'str'}, - 'instance_flexibility_ratio': {'key': 'properties.instanceFlexibilityRatio', 'type': 'int'}, + 'instance_flexibility_ratio': {'key': 'properties.instanceFlexibilityRatio', 'type': 'float'}, 'instance_flexibility_group': {'key': 'properties.instanceFlexibilityGroup', 'type': 'str'}, 'normalized_size': {'key': 'properties.normalizedSize', 'type': 'str'}, 'recommended_quantity_normalized': {'key': 'properties.recommendedQuantityNormalized', 'type': 'float'}, @@ -3287,15 +3289,18 @@ class Notification(msrest.serialization.Model): 1000. :type threshold: float :param contact_emails: Required. Email addresses to send the budget notification to when the - threshold is exceeded. + threshold is exceeded. Must have at least one contact email or contact group specified at the + Subscription or Resource Group scopes. All other scopes must have at least one contact email + specified. :type contact_emails: list[str] :param contact_roles: Contact roles to send the budget notification to when the threshold is exceeded. :type contact_roles: list[str] :param contact_groups: Action groups to send the budget notification to when the threshold is - exceeded. + exceeded. Only supported at Subscription or Resource Group scopes. :type contact_groups: list[str] - :param threshold_type: The type of threshold. Possible values include: "Actual". + :param threshold_type: The type of threshold. Possible values include: "Actual". Default value: + "Actual". :type threshold_type: str or ~azure.mgmt.consumption.models.ThresholdType """ @@ -3303,7 +3308,7 @@ class Notification(msrest.serialization.Model): 'enabled': {'required': True}, 'operator': {'required': True}, 'threshold': {'required': True}, - 'contact_emails': {'required': True, 'max_items': 50, 'min_items': 1}, + 'contact_emails': {'required': True, 'max_items': 50, 'min_items': 0}, 'contact_groups': {'max_items': 50, 'min_items': 0}, } @@ -3326,7 +3331,7 @@ def __init__( contact_emails: List[str], contact_roles: Optional[List[str]] = None, contact_groups: Optional[List[str]] = None, - threshold_type: Optional[Union[str, "ThresholdType"]] = None, + threshold_type: Optional[Union[str, "ThresholdType"]] = "Actual", **kwargs ): super(Notification, self).__init__(**kwargs) @@ -4248,12 +4253,18 @@ class TagsResult(ProxyResource): :type e_tag: str :param tags: A set of tags. A list of Tag. :type tags: list[~azure.mgmt.consumption.models.Tag] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + :ivar previous_link: The link (url) to the previous page of results. + :vartype previous_link: str """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'next_link': {'readonly': True}, + 'previous_link': {'readonly': True}, } _attribute_map = { @@ -4262,6 +4273,8 @@ class TagsResult(ProxyResource): 'type': {'key': 'type', 'type': 'str'}, 'e_tag': {'key': 'eTag', 'type': 'str'}, 'tags': {'key': 'properties.tags', 'type': '[Tag]'}, + 'next_link': {'key': 'properties.nextLink', 'type': 'str'}, + 'previous_link': {'key': 'properties.previousLink', 'type': 'str'}, } def __init__( @@ -4273,6 +4286,8 @@ def __init__( ): super(TagsResult, self).__init__(e_tag=e_tag, **kwargs) self.tags = tags + self.next_link = None + self.previous_link = None class UsageDetailsListResult(msrest.serialization.Model): diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_budgets_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_budgets_operations.py index c50bf7bc303ca..7f248d3881509 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_budgets_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_budgets_operations.py @@ -209,9 +209,9 @@ def create_or_update( **kwargs # type: Any ): # type: (...) -> "_models.Budget" - """The operation to create or update a budget. Update operation requires latest eTag to be set in - the request mandatorily. You may obtain the latest eTag by performing a get operation. Create - operation does not require eTag. + """The operation to create or update a budget. You can optionally provide an eTag if desired as a + form of concurrency control. To obtain the latest eTag for a given budget, perform a get + operation prior to your put operation. :param scope: The scope associated with budget operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_forecasts_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_forecasts_operations.py index 507a13eb386c7..d67fc553a821e 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_forecasts_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_forecasts_operations.py @@ -51,7 +51,9 @@ def list( **kwargs # type: Any ): # type: (...) -> Iterable["_models.ForecastsListResult"] - """Lists the forecast charges by subscriptionId. + """Lists the forecast charges for scope defined. Please note that this API is no longer actively + under development. We recommend using our new Forecast API moving forward: + https://docs.microsoft.com/en-us/rest/api/cost-management/forecast/usage. :param filter: May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', diff --git a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_tags_operations.py b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_tags_operations.py index e6cedfb6f4592..489c17d8c25f1 100644 --- a/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_tags_operations.py +++ b/sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/operations/_tags_operations.py @@ -49,7 +49,7 @@ def get( scope, # type: str **kwargs # type: Any ): - # type: (...) -> "_models.TagsResult" + # type: (...) -> Optional["_models.TagsResult"] """Get all available tag keys for the defined scope. :param scope: The scope associated with tags operations. This includes @@ -65,10 +65,10 @@ def get( :type scope: str :keyword callable cls: A custom type or function that will be passed the direct response :return: TagsResult, or the result of cls(response) - :rtype: ~azure.mgmt.consumption.models.TagsResult + :rtype: ~azure.mgmt.consumption.models.TagsResult or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.TagsResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.TagsResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -95,12 +95,14 @@ def get( pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('TagsResult', pipeline_response) + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TagsResult', pipeline_response) if cls: return cls(pipeline_response, deserialized, {})