From 47e44aa476f735157db1ee58e0016141dc1fa81a Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 14 Aug 2018 21:20:08 +0000 Subject: [PATCH 1/2] Generated from 9f3607b94b9c3f9b6c2fa12ae00ed71a80d42699 Updated reports api documentation --- .../costmanagement/cost_management_client.py | 5 - .../mgmt/costmanagement/models/__init__.py | 24 - .../models/cost_management_client_enums.py | 19 - .../costmanagement/models/report_config.py | 69 --- .../report_config_delivery_destination.py | 46 -- .../report_config_delivery_destination_py3.py | 46 -- .../models/report_config_delivery_info.py | 36 -- .../models/report_config_delivery_info_py3.py | 36 -- .../models/report_config_list_result.py | 36 -- .../models/report_config_list_result_py3.py | 36 -- .../models/report_config_py3.py | 69 --- .../models/report_config_recurrence_period.py | 39 -- .../report_config_recurrence_period_py3.py | 39 -- .../models/report_config_schedule.py | 49 -- .../models/report_config_schedule_py3.py | 49 -- .../costmanagement/operations/__init__.py | 2 - .../operations/report_config_operations.py | 514 ------------------ 17 files changed, 1114 deletions(-) delete mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config.py delete mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_delivery_destination.py delete mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_delivery_destination_py3.py delete mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_delivery_info.py delete mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_delivery_info_py3.py delete mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_list_result.py delete mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_list_result_py3.py delete mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_py3.py delete mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_recurrence_period.py delete mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_recurrence_period_py3.py delete mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_schedule.py delete mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_schedule_py3.py delete mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/report_config_operations.py diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/cost_management_client.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/cost_management_client.py index ca11633b2d39..8d452bb9ea9d 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/cost_management_client.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/cost_management_client.py @@ -15,7 +15,6 @@ from .version import VERSION from msrest.pipeline import ClientRawResponse import uuid -from .operations.report_config_operations import ReportConfigOperations from .operations.billing_account_dimensions_operations import BillingAccountDimensionsOperations from .operations.subscription_dimensions_operations import SubscriptionDimensionsOperations from .operations.resource_group_dimensions_operations import ResourceGroupDimensionsOperations @@ -60,8 +59,6 @@ class CostManagementClient(SDKClient): :ivar config: Configuration for client. :vartype config: CostManagementClientConfiguration - :ivar report_config: ReportConfig operations - :vartype report_config: azure.mgmt.costmanagement.operations.ReportConfigOperations :ivar billing_account_dimensions: BillingAccountDimensions operations :vartype billing_account_dimensions: azure.mgmt.costmanagement.operations.BillingAccountDimensionsOperations :ivar subscription_dimensions: SubscriptionDimensions operations @@ -88,8 +85,6 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) - self.report_config = ReportConfigOperations( - self._client, self.config, self._serialize, self._deserialize) self.billing_account_dimensions = BillingAccountDimensionsOperations( self._client, self.config, self._serialize, self._deserialize) self.subscription_dimensions = SubscriptionDimensionsOperations( diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py index b78e1d4f6727..f1b334a29a42 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py @@ -13,10 +13,6 @@ from .error_details_py3 import ErrorDetails from .error_response_py3 import ErrorResponse, ErrorResponseException from .resource_py3 import Resource - from .report_config_recurrence_period_py3 import ReportConfigRecurrencePeriod - from .report_config_schedule_py3 import ReportConfigSchedule - from .report_config_delivery_destination_py3 import ReportConfigDeliveryDestination - from .report_config_delivery_info_py3 import ReportConfigDeliveryInfo from .report_config_time_period_py3 import ReportConfigTimePeriod from .report_config_dataset_configuration_py3 import ReportConfigDatasetConfiguration from .report_config_aggregation_py3 import ReportConfigAggregation @@ -25,8 +21,6 @@ from .report_config_filter_py3 import ReportConfigFilter from .report_config_dataset_py3 import ReportConfigDataset from .report_config_definition_py3 import ReportConfigDefinition - from .report_config_py3 import ReportConfig - from .report_config_list_result_py3 import ReportConfigListResult from .dimension_py3 import Dimension from .query_column_py3 import QueryColumn from .query_py3 import Query @@ -34,10 +28,6 @@ from .error_details import ErrorDetails from .error_response import ErrorResponse, ErrorResponseException from .resource import Resource - from .report_config_recurrence_period import ReportConfigRecurrencePeriod - from .report_config_schedule import ReportConfigSchedule - from .report_config_delivery_destination import ReportConfigDeliveryDestination - from .report_config_delivery_info import ReportConfigDeliveryInfo from .report_config_time_period import ReportConfigTimePeriod from .report_config_dataset_configuration import ReportConfigDatasetConfiguration from .report_config_aggregation import ReportConfigAggregation @@ -46,17 +36,12 @@ from .report_config_filter import ReportConfigFilter from .report_config_dataset import ReportConfigDataset from .report_config_definition import ReportConfigDefinition - from .report_config import ReportConfig - from .report_config_list_result import ReportConfigListResult from .dimension import Dimension from .query_column import QueryColumn from .query import Query from .dimension_paged import DimensionPaged from .query_paged import QueryPaged from .cost_management_client_enums import ( - StatusType, - RecurrenceType, - FormatType, TimeframeType, GranularityType, ReportConfigColumnType, @@ -66,10 +51,6 @@ 'ErrorDetails', 'ErrorResponse', 'ErrorResponseException', 'Resource', - 'ReportConfigRecurrencePeriod', - 'ReportConfigSchedule', - 'ReportConfigDeliveryDestination', - 'ReportConfigDeliveryInfo', 'ReportConfigTimePeriod', 'ReportConfigDatasetConfiguration', 'ReportConfigAggregation', @@ -78,16 +59,11 @@ 'ReportConfigFilter', 'ReportConfigDataset', 'ReportConfigDefinition', - 'ReportConfig', - 'ReportConfigListResult', 'Dimension', 'QueryColumn', 'Query', 'DimensionPaged', 'QueryPaged', - 'StatusType', - 'RecurrenceType', - 'FormatType', 'TimeframeType', 'GranularityType', 'ReportConfigColumnType', diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/cost_management_client_enums.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/cost_management_client_enums.py index 2cbcb89895ef..254441a1035b 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/cost_management_client_enums.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/cost_management_client_enums.py @@ -12,25 +12,6 @@ from enum import Enum -class StatusType(str, Enum): - - active = "Active" - inactive = "Inactive" - - -class RecurrenceType(str, Enum): - - daily = "Daily" - weekly = "Weekly" - monthly = "Monthly" - annually = "Annually" - - -class FormatType(str, Enum): - - csv = "Csv" - - class TimeframeType(str, Enum): week_to_date = "WeekToDate" diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config.py deleted file mode 100644 index 44e2cdde8778..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config.py +++ /dev/null @@ -1,69 +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 ReportConfig(Resource): - """A report config 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 - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :param schedule: Has schedule information for the report config. - :type schedule: ~azure.mgmt.costmanagement.models.ReportConfigSchedule - :param format: The format of the report being delivered. Possible values - include: 'Csv' - :type format: str or ~azure.mgmt.costmanagement.models.FormatType - :param delivery_info: Required. Has delivery information for the report - config. - :type delivery_info: - ~azure.mgmt.costmanagement.models.ReportConfigDeliveryInfo - :param definition: Required. Has definition for the report config. - :type definition: ~azure.mgmt.costmanagement.models.ReportConfigDefinition - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'tags': {'readonly': True}, - 'delivery_info': {'required': True}, - 'definition': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'schedule': {'key': 'properties.schedule', 'type': 'ReportConfigSchedule'}, - 'format': {'key': 'properties.format', 'type': 'str'}, - 'delivery_info': {'key': 'properties.deliveryInfo', 'type': 'ReportConfigDeliveryInfo'}, - 'definition': {'key': 'properties.definition', 'type': 'ReportConfigDefinition'}, - } - - def __init__(self, **kwargs): - super(ReportConfig, self).__init__(**kwargs) - self.schedule = kwargs.get('schedule', None) - self.format = kwargs.get('format', None) - self.delivery_info = kwargs.get('delivery_info', None) - self.definition = kwargs.get('definition', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_delivery_destination.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_delivery_destination.py deleted file mode 100644 index e4fc2853a093..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_delivery_destination.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 ReportConfigDeliveryDestination(Model): - """The destination information for the delivery of the report. - - All required parameters must be populated in order to send to Azure. - - :param resource_id: Required. The resource id of the storage account where - reports will be delivered. - :type resource_id: str - :param container: Required. The name of the container where reports will - be uploaded. - :type container: str - :param root_folder_path: The name of the directory where reports will be - uploaded. - :type root_folder_path: str - """ - - _validation = { - 'resource_id': {'required': True}, - 'container': {'required': True}, - } - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'container': {'key': 'container', 'type': 'str'}, - 'root_folder_path': {'key': 'rootFolderPath', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ReportConfigDeliveryDestination, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.container = kwargs.get('container', None) - self.root_folder_path = kwargs.get('root_folder_path', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_delivery_destination_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_delivery_destination_py3.py deleted file mode 100644 index 1e9bf4499672..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_delivery_destination_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 ReportConfigDeliveryDestination(Model): - """The destination information for the delivery of the report. - - All required parameters must be populated in order to send to Azure. - - :param resource_id: Required. The resource id of the storage account where - reports will be delivered. - :type resource_id: str - :param container: Required. The name of the container where reports will - be uploaded. - :type container: str - :param root_folder_path: The name of the directory where reports will be - uploaded. - :type root_folder_path: str - """ - - _validation = { - 'resource_id': {'required': True}, - 'container': {'required': True}, - } - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'container': {'key': 'container', 'type': 'str'}, - 'root_folder_path': {'key': 'rootFolderPath', 'type': 'str'}, - } - - def __init__(self, *, resource_id: str, container: str, root_folder_path: str=None, **kwargs) -> None: - super(ReportConfigDeliveryDestination, self).__init__(**kwargs) - self.resource_id = resource_id - self.container = container - self.root_folder_path = root_folder_path diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_delivery_info.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_delivery_info.py deleted file mode 100644 index a3caa7e883d8..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_delivery_info.py +++ /dev/null @@ -1,36 +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 ReportConfigDeliveryInfo(Model): - """The delivery information associated with a report config. - - All required parameters must be populated in order to send to Azure. - - :param destination: Required. Has destination for the report being - delivered. - :type destination: - ~azure.mgmt.costmanagement.models.ReportConfigDeliveryDestination - """ - - _validation = { - 'destination': {'required': True}, - } - - _attribute_map = { - 'destination': {'key': 'destination', 'type': 'ReportConfigDeliveryDestination'}, - } - - def __init__(self, **kwargs): - super(ReportConfigDeliveryInfo, self).__init__(**kwargs) - self.destination = kwargs.get('destination', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_delivery_info_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_delivery_info_py3.py deleted file mode 100644 index 22b90721c3f0..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_delivery_info_py3.py +++ /dev/null @@ -1,36 +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 ReportConfigDeliveryInfo(Model): - """The delivery information associated with a report config. - - All required parameters must be populated in order to send to Azure. - - :param destination: Required. Has destination for the report being - delivered. - :type destination: - ~azure.mgmt.costmanagement.models.ReportConfigDeliveryDestination - """ - - _validation = { - 'destination': {'required': True}, - } - - _attribute_map = { - 'destination': {'key': 'destination', 'type': 'ReportConfigDeliveryDestination'}, - } - - def __init__(self, *, destination, **kwargs) -> None: - super(ReportConfigDeliveryInfo, self).__init__(**kwargs) - self.destination = destination diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_list_result.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_list_result.py deleted file mode 100644 index 9299cb815d0f..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_list_result.py +++ /dev/null @@ -1,36 +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 ReportConfigListResult(Model): - """Result of listing report configs. It contains a list of available report - configurations in the scope provided. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar value: The list of report configs. - :vartype value: list[~azure.mgmt.costmanagement.models.ReportConfig] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ReportConfig]'}, - } - - def __init__(self, **kwargs): - super(ReportConfigListResult, self).__init__(**kwargs) - self.value = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_list_result_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_list_result_py3.py deleted file mode 100644 index f8811e6328d5..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_list_result_py3.py +++ /dev/null @@ -1,36 +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 ReportConfigListResult(Model): - """Result of listing report configs. It contains a list of available report - configurations in the scope provided. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar value: The list of report configs. - :vartype value: list[~azure.mgmt.costmanagement.models.ReportConfig] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ReportConfig]'}, - } - - def __init__(self, **kwargs) -> None: - super(ReportConfigListResult, self).__init__(**kwargs) - self.value = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_py3.py deleted file mode 100644 index c505d604b545..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_py3.py +++ /dev/null @@ -1,69 +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 ReportConfig(Resource): - """A report config 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 - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :param schedule: Has schedule information for the report config. - :type schedule: ~azure.mgmt.costmanagement.models.ReportConfigSchedule - :param format: The format of the report being delivered. Possible values - include: 'Csv' - :type format: str or ~azure.mgmt.costmanagement.models.FormatType - :param delivery_info: Required. Has delivery information for the report - config. - :type delivery_info: - ~azure.mgmt.costmanagement.models.ReportConfigDeliveryInfo - :param definition: Required. Has definition for the report config. - :type definition: ~azure.mgmt.costmanagement.models.ReportConfigDefinition - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'tags': {'readonly': True}, - 'delivery_info': {'required': True}, - 'definition': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'schedule': {'key': 'properties.schedule', 'type': 'ReportConfigSchedule'}, - 'format': {'key': 'properties.format', 'type': 'str'}, - 'delivery_info': {'key': 'properties.deliveryInfo', 'type': 'ReportConfigDeliveryInfo'}, - 'definition': {'key': 'properties.definition', 'type': 'ReportConfigDefinition'}, - } - - def __init__(self, *, delivery_info, definition, schedule=None, format=None, **kwargs) -> None: - super(ReportConfig, self).__init__(**kwargs) - self.schedule = schedule - self.format = format - self.delivery_info = delivery_info - self.definition = definition diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_recurrence_period.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_recurrence_period.py deleted file mode 100644 index 43ec79a04d79..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_recurrence_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 ReportConfigRecurrencePeriod(Model): - """The start and end date for recurrence schedule. - - All required parameters must be populated in order to send to Azure. - - :param from_property: Required. The start date of recurrence. - :type from_property: datetime - :param to: The end date of recurrence. If not provided, we default this to - 10 years from the start date. - :type to: datetime - """ - - _validation = { - 'from_property': {'required': True}, - } - - _attribute_map = { - 'from_property': {'key': 'from', 'type': 'iso-8601'}, - 'to': {'key': 'to', 'type': 'iso-8601'}, - } - - def __init__(self, **kwargs): - super(ReportConfigRecurrencePeriod, self).__init__(**kwargs) - self.from_property = kwargs.get('from_property', None) - self.to = kwargs.get('to', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_recurrence_period_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_recurrence_period_py3.py deleted file mode 100644 index fc6495614479..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_recurrence_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 ReportConfigRecurrencePeriod(Model): - """The start and end date for recurrence schedule. - - All required parameters must be populated in order to send to Azure. - - :param from_property: Required. The start date of recurrence. - :type from_property: datetime - :param to: The end date of recurrence. If not provided, we default this to - 10 years from the start date. - :type to: datetime - """ - - _validation = { - 'from_property': {'required': True}, - } - - _attribute_map = { - 'from_property': {'key': 'from', 'type': 'iso-8601'}, - 'to': {'key': 'to', 'type': 'iso-8601'}, - } - - def __init__(self, *, from_property, to=None, **kwargs) -> None: - super(ReportConfigRecurrencePeriod, self).__init__(**kwargs) - self.from_property = from_property - self.to = to diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_schedule.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_schedule.py deleted file mode 100644 index 58ffe987a834..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_schedule.py +++ /dev/null @@ -1,49 +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 ReportConfigSchedule(Model): - """The schedule associated with a report config. - - All required parameters must be populated in order to send to Azure. - - :param status: The status of the schedule. Whether active or not. If - inactive, the report's scheduled execution is paused. Possible values - include: 'Active', 'Inactive' - :type status: str or ~azure.mgmt.costmanagement.models.StatusType - :param recurrence: Required. The schedule recurrence. Possible values - include: 'Daily', 'Weekly', 'Monthly', 'Annually' - :type recurrence: str or ~azure.mgmt.costmanagement.models.RecurrenceType - :param recurrence_period: Required. Has start and end date of the - recurrence. The start date must be in future. If present, the end date - must be greater than start date. - :type recurrence_period: - ~azure.mgmt.costmanagement.models.ReportConfigRecurrencePeriod - """ - - _validation = { - 'recurrence': {'required': True}, - 'recurrence_period': {'required': True}, - } - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'recurrence': {'key': 'recurrence', 'type': 'str'}, - 'recurrence_period': {'key': 'recurrencePeriod', 'type': 'ReportConfigRecurrencePeriod'}, - } - - def __init__(self, **kwargs): - super(ReportConfigSchedule, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.recurrence = kwargs.get('recurrence', None) - self.recurrence_period = kwargs.get('recurrence_period', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_schedule_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_schedule_py3.py deleted file mode 100644 index b951b0adcdc3..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_schedule_py3.py +++ /dev/null @@ -1,49 +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 ReportConfigSchedule(Model): - """The schedule associated with a report config. - - All required parameters must be populated in order to send to Azure. - - :param status: The status of the schedule. Whether active or not. If - inactive, the report's scheduled execution is paused. Possible values - include: 'Active', 'Inactive' - :type status: str or ~azure.mgmt.costmanagement.models.StatusType - :param recurrence: Required. The schedule recurrence. Possible values - include: 'Daily', 'Weekly', 'Monthly', 'Annually' - :type recurrence: str or ~azure.mgmt.costmanagement.models.RecurrenceType - :param recurrence_period: Required. Has start and end date of the - recurrence. The start date must be in future. If present, the end date - must be greater than start date. - :type recurrence_period: - ~azure.mgmt.costmanagement.models.ReportConfigRecurrencePeriod - """ - - _validation = { - 'recurrence': {'required': True}, - 'recurrence_period': {'required': True}, - } - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'recurrence': {'key': 'recurrence', 'type': 'str'}, - 'recurrence_period': {'key': 'recurrencePeriod', 'type': 'ReportConfigRecurrencePeriod'}, - } - - def __init__(self, *, recurrence, recurrence_period, status=None, **kwargs) -> None: - super(ReportConfigSchedule, self).__init__(**kwargs) - self.status = status - self.recurrence = recurrence - self.recurrence_period = recurrence_period diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py index 2ccef72c986f..901296d55758 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py @@ -9,13 +9,11 @@ # regenerated. # -------------------------------------------------------------------------- -from .report_config_operations import ReportConfigOperations from .billing_account_dimensions_operations import BillingAccountDimensionsOperations from .subscription_dimensions_operations import SubscriptionDimensionsOperations from .resource_group_dimensions_operations import ResourceGroupDimensionsOperations __all__ = [ - 'ReportConfigOperations', 'BillingAccountDimensionsOperations', 'SubscriptionDimensionsOperations', 'ResourceGroupDimensionsOperations', diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/report_config_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/report_config_operations.py deleted file mode 100644 index 255dc64a915e..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/report_config_operations.py +++ /dev/null @@ -1,514 +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 ReportConfigOperations(object): - """ReportConfigOperations 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 2018-05-31. Constant value: "2018-05-31". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-05-31" - - self.config = config - - def list( - self, custom_headers=None, raw=False, **operation_config): - """Lists all report configs for a subscription. - - :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: ReportConfigListResult or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.costmanagement.models.ReportConfigListResult or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # 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 = {} - 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('ReportConfigListResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CostManagement/reportconfigs'} - - def list_by_resource_group_name( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): - """Lists all report configs for a resource group under a subscription. - - :param resource_group_name: Azure Resource Group Name. - :type resource_group_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: ReportConfigListResult or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.costmanagement.models.ReportConfigListResult or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list_by_resource_group_name.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_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('ReportConfigListResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_by_resource_group_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CostManagement/reportconfigs'} - - def get( - self, report_config_name, custom_headers=None, raw=False, **operation_config): - """Gets the report config for a subscription by report config name. - - :param report_config_name: Report Config Name. - :type report_config_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: ReportConfig or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.costmanagement.models.ReportConfig 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'), - 'reportConfigName': self._serialize.url("report_config_name", report_config_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('ReportConfig', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CostManagement/reportconfigs/{reportConfigName}'} - - def create_or_update( - self, report_config_name, parameters, custom_headers=None, raw=False, **operation_config): - """The operation to create or update a report config. 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 report_config_name: Report Config Name. - :type report_config_name: str - :param parameters: Parameters supplied to the CreateOrUpdate Report - Config operation. - :type parameters: ~azure.mgmt.costmanagement.models.ReportConfig - :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: ReportConfig or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.costmanagement.models.ReportConfig or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.create_or_update.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'reportConfigName': self._serialize.url("report_config_name", report_config_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, 'ReportConfig') - - # 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('ReportConfig', response) - if response.status_code == 201: - deserialized = self._deserialize('ReportConfig', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CostManagement/reportconfigs/{reportConfigName}'} - - def delete( - self, report_config_name, custom_headers=None, raw=False, **operation_config): - """The operation to delete a report. - - :param report_config_name: Report Config Name. - :type report_config_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 = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'reportConfigName': self._serialize.url("report_config_name", report_config_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': '/subscriptions/{subscriptionId}/providers/Microsoft.CostManagement/reportconfigs/{reportConfigName}'} - - def get_by_resource_group_name( - self, resource_group_name, report_config_name, custom_headers=None, raw=False, **operation_config): - """Gets the report config for a resource group under a subscription by - report config name. - - :param resource_group_name: Azure Resource Group Name. - :type resource_group_name: str - :param report_config_name: Report Config Name. - :type report_config_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: ReportConfig or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.costmanagement.models.ReportConfig or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get_by_resource_group_name.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'reportConfigName': self._serialize.url("report_config_name", report_config_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('ReportConfig', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_by_resource_group_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CostManagement/reportconfigs/{reportConfigName}'} - - def create_or_update_by_resource_group_name( - self, resource_group_name, report_config_name, parameters, custom_headers=None, raw=False, **operation_config): - """The operation to create or update a report config. 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 resource_group_name: Azure Resource Group Name. - :type resource_group_name: str - :param report_config_name: Report Config Name. - :type report_config_name: str - :param parameters: Parameters supplied to the CreateOrUpdate Report - Config operation. - :type parameters: ~azure.mgmt.costmanagement.models.ReportConfig - :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: ReportConfig or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.costmanagement.models.ReportConfig or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.create_or_update_by_resource_group_name.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'reportConfigName': self._serialize.url("report_config_name", report_config_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, 'ReportConfig') - - # 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('ReportConfig', response) - if response.status_code == 201: - deserialized = self._deserialize('ReportConfig', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create_or_update_by_resource_group_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CostManagement/reportconfigs/{reportConfigName}'} - - def delete_by_resource_group_name( - self, resource_group_name, report_config_name, custom_headers=None, raw=False, **operation_config): - """The operation to delete a report config. - - :param resource_group_name: Azure Resource Group Name. - :type resource_group_name: str - :param report_config_name: Report Config Name. - :type report_config_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_by_resource_group_name.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'reportConfigName': self._serialize.url("report_config_name", report_config_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_by_resource_group_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CostManagement/reportconfigs/{reportConfigName}'} From b16d9a9fcb13a49c54feee1ba54dcd28d1cd5b44 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 21 Aug 2018 21:51:12 +0000 Subject: [PATCH 2/2] Generated from 41ff04d4ffb063505850fbecd4dd6061f4072f29 Undo remove of API from stable version --- .../costmanagement/cost_management_client.py | 5 + .../mgmt/costmanagement/models/__init__.py | 24 + .../models/cost_management_client_enums.py | 19 + .../costmanagement/models/report_config.py | 69 +++ .../report_config_delivery_destination.py | 46 ++ .../report_config_delivery_destination_py3.py | 46 ++ .../models/report_config_delivery_info.py | 36 ++ .../models/report_config_delivery_info_py3.py | 36 ++ .../models/report_config_list_result.py | 36 ++ .../models/report_config_list_result_py3.py | 36 ++ .../models/report_config_py3.py | 69 +++ .../models/report_config_recurrence_period.py | 39 ++ .../report_config_recurrence_period_py3.py | 39 ++ .../models/report_config_schedule.py | 49 ++ .../models/report_config_schedule_py3.py | 49 ++ .../costmanagement/operations/__init__.py | 2 + .../operations/report_config_operations.py | 514 ++++++++++++++++++ 17 files changed, 1114 insertions(+) create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_delivery_destination.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_delivery_destination_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_delivery_info.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_delivery_info_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_list_result.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_list_result_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_recurrence_period.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_recurrence_period_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_schedule.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_schedule_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/report_config_operations.py diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/cost_management_client.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/cost_management_client.py index 8d452bb9ea9d..ca11633b2d39 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/cost_management_client.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/cost_management_client.py @@ -15,6 +15,7 @@ from .version import VERSION from msrest.pipeline import ClientRawResponse import uuid +from .operations.report_config_operations import ReportConfigOperations from .operations.billing_account_dimensions_operations import BillingAccountDimensionsOperations from .operations.subscription_dimensions_operations import SubscriptionDimensionsOperations from .operations.resource_group_dimensions_operations import ResourceGroupDimensionsOperations @@ -59,6 +60,8 @@ class CostManagementClient(SDKClient): :ivar config: Configuration for client. :vartype config: CostManagementClientConfiguration + :ivar report_config: ReportConfig operations + :vartype report_config: azure.mgmt.costmanagement.operations.ReportConfigOperations :ivar billing_account_dimensions: BillingAccountDimensions operations :vartype billing_account_dimensions: azure.mgmt.costmanagement.operations.BillingAccountDimensionsOperations :ivar subscription_dimensions: SubscriptionDimensions operations @@ -85,6 +88,8 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) + self.report_config = ReportConfigOperations( + self._client, self.config, self._serialize, self._deserialize) self.billing_account_dimensions = BillingAccountDimensionsOperations( self._client, self.config, self._serialize, self._deserialize) self.subscription_dimensions = SubscriptionDimensionsOperations( diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py index f1b334a29a42..b78e1d4f6727 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py @@ -13,6 +13,10 @@ from .error_details_py3 import ErrorDetails from .error_response_py3 import ErrorResponse, ErrorResponseException from .resource_py3 import Resource + from .report_config_recurrence_period_py3 import ReportConfigRecurrencePeriod + from .report_config_schedule_py3 import ReportConfigSchedule + from .report_config_delivery_destination_py3 import ReportConfigDeliveryDestination + from .report_config_delivery_info_py3 import ReportConfigDeliveryInfo from .report_config_time_period_py3 import ReportConfigTimePeriod from .report_config_dataset_configuration_py3 import ReportConfigDatasetConfiguration from .report_config_aggregation_py3 import ReportConfigAggregation @@ -21,6 +25,8 @@ from .report_config_filter_py3 import ReportConfigFilter from .report_config_dataset_py3 import ReportConfigDataset from .report_config_definition_py3 import ReportConfigDefinition + from .report_config_py3 import ReportConfig + from .report_config_list_result_py3 import ReportConfigListResult from .dimension_py3 import Dimension from .query_column_py3 import QueryColumn from .query_py3 import Query @@ -28,6 +34,10 @@ from .error_details import ErrorDetails from .error_response import ErrorResponse, ErrorResponseException from .resource import Resource + from .report_config_recurrence_period import ReportConfigRecurrencePeriod + from .report_config_schedule import ReportConfigSchedule + from .report_config_delivery_destination import ReportConfigDeliveryDestination + from .report_config_delivery_info import ReportConfigDeliveryInfo from .report_config_time_period import ReportConfigTimePeriod from .report_config_dataset_configuration import ReportConfigDatasetConfiguration from .report_config_aggregation import ReportConfigAggregation @@ -36,12 +46,17 @@ from .report_config_filter import ReportConfigFilter from .report_config_dataset import ReportConfigDataset from .report_config_definition import ReportConfigDefinition + from .report_config import ReportConfig + from .report_config_list_result import ReportConfigListResult from .dimension import Dimension from .query_column import QueryColumn from .query import Query from .dimension_paged import DimensionPaged from .query_paged import QueryPaged from .cost_management_client_enums import ( + StatusType, + RecurrenceType, + FormatType, TimeframeType, GranularityType, ReportConfigColumnType, @@ -51,6 +66,10 @@ 'ErrorDetails', 'ErrorResponse', 'ErrorResponseException', 'Resource', + 'ReportConfigRecurrencePeriod', + 'ReportConfigSchedule', + 'ReportConfigDeliveryDestination', + 'ReportConfigDeliveryInfo', 'ReportConfigTimePeriod', 'ReportConfigDatasetConfiguration', 'ReportConfigAggregation', @@ -59,11 +78,16 @@ 'ReportConfigFilter', 'ReportConfigDataset', 'ReportConfigDefinition', + 'ReportConfig', + 'ReportConfigListResult', 'Dimension', 'QueryColumn', 'Query', 'DimensionPaged', 'QueryPaged', + 'StatusType', + 'RecurrenceType', + 'FormatType', 'TimeframeType', 'GranularityType', 'ReportConfigColumnType', diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/cost_management_client_enums.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/cost_management_client_enums.py index 254441a1035b..2cbcb89895ef 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/cost_management_client_enums.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/cost_management_client_enums.py @@ -12,6 +12,25 @@ from enum import Enum +class StatusType(str, Enum): + + active = "Active" + inactive = "Inactive" + + +class RecurrenceType(str, Enum): + + daily = "Daily" + weekly = "Weekly" + monthly = "Monthly" + annually = "Annually" + + +class FormatType(str, Enum): + + csv = "Csv" + + class TimeframeType(str, Enum): week_to_date = "WeekToDate" diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config.py new file mode 100644 index 000000000000..44e2cdde8778 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config.py @@ -0,0 +1,69 @@ +# 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 ReportConfig(Resource): + """A report config 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 + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :param schedule: Has schedule information for the report config. + :type schedule: ~azure.mgmt.costmanagement.models.ReportConfigSchedule + :param format: The format of the report being delivered. Possible values + include: 'Csv' + :type format: str or ~azure.mgmt.costmanagement.models.FormatType + :param delivery_info: Required. Has delivery information for the report + config. + :type delivery_info: + ~azure.mgmt.costmanagement.models.ReportConfigDeliveryInfo + :param definition: Required. Has definition for the report config. + :type definition: ~azure.mgmt.costmanagement.models.ReportConfigDefinition + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'delivery_info': {'required': True}, + 'definition': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'schedule': {'key': 'properties.schedule', 'type': 'ReportConfigSchedule'}, + 'format': {'key': 'properties.format', 'type': 'str'}, + 'delivery_info': {'key': 'properties.deliveryInfo', 'type': 'ReportConfigDeliveryInfo'}, + 'definition': {'key': 'properties.definition', 'type': 'ReportConfigDefinition'}, + } + + def __init__(self, **kwargs): + super(ReportConfig, self).__init__(**kwargs) + self.schedule = kwargs.get('schedule', None) + self.format = kwargs.get('format', None) + self.delivery_info = kwargs.get('delivery_info', None) + self.definition = kwargs.get('definition', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_delivery_destination.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_delivery_destination.py new file mode 100644 index 000000000000..e4fc2853a093 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_delivery_destination.py @@ -0,0 +1,46 @@ +# 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 ReportConfigDeliveryDestination(Model): + """The destination information for the delivery of the report. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. The resource id of the storage account where + reports will be delivered. + :type resource_id: str + :param container: Required. The name of the container where reports will + be uploaded. + :type container: str + :param root_folder_path: The name of the directory where reports will be + uploaded. + :type root_folder_path: str + """ + + _validation = { + 'resource_id': {'required': True}, + 'container': {'required': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'container': {'key': 'container', 'type': 'str'}, + 'root_folder_path': {'key': 'rootFolderPath', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ReportConfigDeliveryDestination, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.container = kwargs.get('container', None) + self.root_folder_path = kwargs.get('root_folder_path', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_delivery_destination_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_delivery_destination_py3.py new file mode 100644 index 000000000000..1e9bf4499672 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_delivery_destination_py3.py @@ -0,0 +1,46 @@ +# 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 ReportConfigDeliveryDestination(Model): + """The destination information for the delivery of the report. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. The resource id of the storage account where + reports will be delivered. + :type resource_id: str + :param container: Required. The name of the container where reports will + be uploaded. + :type container: str + :param root_folder_path: The name of the directory where reports will be + uploaded. + :type root_folder_path: str + """ + + _validation = { + 'resource_id': {'required': True}, + 'container': {'required': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'container': {'key': 'container', 'type': 'str'}, + 'root_folder_path': {'key': 'rootFolderPath', 'type': 'str'}, + } + + def __init__(self, *, resource_id: str, container: str, root_folder_path: str=None, **kwargs) -> None: + super(ReportConfigDeliveryDestination, self).__init__(**kwargs) + self.resource_id = resource_id + self.container = container + self.root_folder_path = root_folder_path diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_delivery_info.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_delivery_info.py new file mode 100644 index 000000000000..a3caa7e883d8 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_delivery_info.py @@ -0,0 +1,36 @@ +# 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 ReportConfigDeliveryInfo(Model): + """The delivery information associated with a report config. + + All required parameters must be populated in order to send to Azure. + + :param destination: Required. Has destination for the report being + delivered. + :type destination: + ~azure.mgmt.costmanagement.models.ReportConfigDeliveryDestination + """ + + _validation = { + 'destination': {'required': True}, + } + + _attribute_map = { + 'destination': {'key': 'destination', 'type': 'ReportConfigDeliveryDestination'}, + } + + def __init__(self, **kwargs): + super(ReportConfigDeliveryInfo, self).__init__(**kwargs) + self.destination = kwargs.get('destination', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_delivery_info_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_delivery_info_py3.py new file mode 100644 index 000000000000..22b90721c3f0 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_delivery_info_py3.py @@ -0,0 +1,36 @@ +# 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 ReportConfigDeliveryInfo(Model): + """The delivery information associated with a report config. + + All required parameters must be populated in order to send to Azure. + + :param destination: Required. Has destination for the report being + delivered. + :type destination: + ~azure.mgmt.costmanagement.models.ReportConfigDeliveryDestination + """ + + _validation = { + 'destination': {'required': True}, + } + + _attribute_map = { + 'destination': {'key': 'destination', 'type': 'ReportConfigDeliveryDestination'}, + } + + def __init__(self, *, destination, **kwargs) -> None: + super(ReportConfigDeliveryInfo, self).__init__(**kwargs) + self.destination = destination diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_list_result.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_list_result.py new file mode 100644 index 000000000000..9299cb815d0f --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_list_result.py @@ -0,0 +1,36 @@ +# 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 ReportConfigListResult(Model): + """Result of listing report configs. It contains a list of available report + configurations in the scope provided. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of report configs. + :vartype value: list[~azure.mgmt.costmanagement.models.ReportConfig] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ReportConfig]'}, + } + + def __init__(self, **kwargs): + super(ReportConfigListResult, self).__init__(**kwargs) + self.value = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_list_result_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_list_result_py3.py new file mode 100644 index 000000000000..f8811e6328d5 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_list_result_py3.py @@ -0,0 +1,36 @@ +# 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 ReportConfigListResult(Model): + """Result of listing report configs. It contains a list of available report + configurations in the scope provided. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of report configs. + :vartype value: list[~azure.mgmt.costmanagement.models.ReportConfig] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ReportConfig]'}, + } + + def __init__(self, **kwargs) -> None: + super(ReportConfigListResult, self).__init__(**kwargs) + self.value = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_py3.py new file mode 100644 index 000000000000..c505d604b545 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_py3.py @@ -0,0 +1,69 @@ +# 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 ReportConfig(Resource): + """A report config 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 + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :param schedule: Has schedule information for the report config. + :type schedule: ~azure.mgmt.costmanagement.models.ReportConfigSchedule + :param format: The format of the report being delivered. Possible values + include: 'Csv' + :type format: str or ~azure.mgmt.costmanagement.models.FormatType + :param delivery_info: Required. Has delivery information for the report + config. + :type delivery_info: + ~azure.mgmt.costmanagement.models.ReportConfigDeliveryInfo + :param definition: Required. Has definition for the report config. + :type definition: ~azure.mgmt.costmanagement.models.ReportConfigDefinition + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'delivery_info': {'required': True}, + 'definition': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'schedule': {'key': 'properties.schedule', 'type': 'ReportConfigSchedule'}, + 'format': {'key': 'properties.format', 'type': 'str'}, + 'delivery_info': {'key': 'properties.deliveryInfo', 'type': 'ReportConfigDeliveryInfo'}, + 'definition': {'key': 'properties.definition', 'type': 'ReportConfigDefinition'}, + } + + def __init__(self, *, delivery_info, definition, schedule=None, format=None, **kwargs) -> None: + super(ReportConfig, self).__init__(**kwargs) + self.schedule = schedule + self.format = format + self.delivery_info = delivery_info + self.definition = definition diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_recurrence_period.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_recurrence_period.py new file mode 100644 index 000000000000..43ec79a04d79 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_recurrence_period.py @@ -0,0 +1,39 @@ +# 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 ReportConfigRecurrencePeriod(Model): + """The start and end date for recurrence schedule. + + All required parameters must be populated in order to send to Azure. + + :param from_property: Required. The start date of recurrence. + :type from_property: datetime + :param to: The end date of recurrence. If not provided, we default this to + 10 years from the start date. + :type to: datetime + """ + + _validation = { + 'from_property': {'required': True}, + } + + _attribute_map = { + 'from_property': {'key': 'from', 'type': 'iso-8601'}, + 'to': {'key': 'to', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(ReportConfigRecurrencePeriod, self).__init__(**kwargs) + self.from_property = kwargs.get('from_property', None) + self.to = kwargs.get('to', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_recurrence_period_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_recurrence_period_py3.py new file mode 100644 index 000000000000..fc6495614479 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_recurrence_period_py3.py @@ -0,0 +1,39 @@ +# 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 ReportConfigRecurrencePeriod(Model): + """The start and end date for recurrence schedule. + + All required parameters must be populated in order to send to Azure. + + :param from_property: Required. The start date of recurrence. + :type from_property: datetime + :param to: The end date of recurrence. If not provided, we default this to + 10 years from the start date. + :type to: datetime + """ + + _validation = { + 'from_property': {'required': True}, + } + + _attribute_map = { + 'from_property': {'key': 'from', 'type': 'iso-8601'}, + 'to': {'key': 'to', 'type': 'iso-8601'}, + } + + def __init__(self, *, from_property, to=None, **kwargs) -> None: + super(ReportConfigRecurrencePeriod, self).__init__(**kwargs) + self.from_property = from_property + self.to = to diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_schedule.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_schedule.py new file mode 100644 index 000000000000..58ffe987a834 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_schedule.py @@ -0,0 +1,49 @@ +# 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 ReportConfigSchedule(Model): + """The schedule associated with a report config. + + All required parameters must be populated in order to send to Azure. + + :param status: The status of the schedule. Whether active or not. If + inactive, the report's scheduled execution is paused. Possible values + include: 'Active', 'Inactive' + :type status: str or ~azure.mgmt.costmanagement.models.StatusType + :param recurrence: Required. The schedule recurrence. Possible values + include: 'Daily', 'Weekly', 'Monthly', 'Annually' + :type recurrence: str or ~azure.mgmt.costmanagement.models.RecurrenceType + :param recurrence_period: Required. Has start and end date of the + recurrence. The start date must be in future. If present, the end date + must be greater than start date. + :type recurrence_period: + ~azure.mgmt.costmanagement.models.ReportConfigRecurrencePeriod + """ + + _validation = { + 'recurrence': {'required': True}, + 'recurrence_period': {'required': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'recurrence': {'key': 'recurrence', 'type': 'str'}, + 'recurrence_period': {'key': 'recurrencePeriod', 'type': 'ReportConfigRecurrencePeriod'}, + } + + def __init__(self, **kwargs): + super(ReportConfigSchedule, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.recurrence = kwargs.get('recurrence', None) + self.recurrence_period = kwargs.get('recurrence_period', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_schedule_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_schedule_py3.py new file mode 100644 index 000000000000..b951b0adcdc3 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_schedule_py3.py @@ -0,0 +1,49 @@ +# 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 ReportConfigSchedule(Model): + """The schedule associated with a report config. + + All required parameters must be populated in order to send to Azure. + + :param status: The status of the schedule. Whether active or not. If + inactive, the report's scheduled execution is paused. Possible values + include: 'Active', 'Inactive' + :type status: str or ~azure.mgmt.costmanagement.models.StatusType + :param recurrence: Required. The schedule recurrence. Possible values + include: 'Daily', 'Weekly', 'Monthly', 'Annually' + :type recurrence: str or ~azure.mgmt.costmanagement.models.RecurrenceType + :param recurrence_period: Required. Has start and end date of the + recurrence. The start date must be in future. If present, the end date + must be greater than start date. + :type recurrence_period: + ~azure.mgmt.costmanagement.models.ReportConfigRecurrencePeriod + """ + + _validation = { + 'recurrence': {'required': True}, + 'recurrence_period': {'required': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'recurrence': {'key': 'recurrence', 'type': 'str'}, + 'recurrence_period': {'key': 'recurrencePeriod', 'type': 'ReportConfigRecurrencePeriod'}, + } + + def __init__(self, *, recurrence, recurrence_period, status=None, **kwargs) -> None: + super(ReportConfigSchedule, self).__init__(**kwargs) + self.status = status + self.recurrence = recurrence + self.recurrence_period = recurrence_period diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py index 901296d55758..2ccef72c986f 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py @@ -9,11 +9,13 @@ # regenerated. # -------------------------------------------------------------------------- +from .report_config_operations import ReportConfigOperations from .billing_account_dimensions_operations import BillingAccountDimensionsOperations from .subscription_dimensions_operations import SubscriptionDimensionsOperations from .resource_group_dimensions_operations import ResourceGroupDimensionsOperations __all__ = [ + 'ReportConfigOperations', 'BillingAccountDimensionsOperations', 'SubscriptionDimensionsOperations', 'ResourceGroupDimensionsOperations', diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/report_config_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/report_config_operations.py new file mode 100644 index 000000000000..255dc64a915e --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/report_config_operations.py @@ -0,0 +1,514 @@ +# 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 ReportConfigOperations(object): + """ReportConfigOperations 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 2018-05-31. Constant value: "2018-05-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-05-31" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all report configs for a subscription. + + :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: ReportConfigListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.costmanagement.models.ReportConfigListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # 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 = {} + 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('ReportConfigListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CostManagement/reportconfigs'} + + def list_by_resource_group_name( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Lists all report configs for a resource group under a subscription. + + :param resource_group_name: Azure Resource Group Name. + :type resource_group_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: ReportConfigListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.costmanagement.models.ReportConfigListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_by_resource_group_name.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_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('ReportConfigListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_resource_group_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CostManagement/reportconfigs'} + + def get( + self, report_config_name, custom_headers=None, raw=False, **operation_config): + """Gets the report config for a subscription by report config name. + + :param report_config_name: Report Config Name. + :type report_config_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: ReportConfig or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.costmanagement.models.ReportConfig 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'), + 'reportConfigName': self._serialize.url("report_config_name", report_config_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('ReportConfig', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CostManagement/reportconfigs/{reportConfigName}'} + + def create_or_update( + self, report_config_name, parameters, custom_headers=None, raw=False, **operation_config): + """The operation to create or update a report config. 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 report_config_name: Report Config Name. + :type report_config_name: str + :param parameters: Parameters supplied to the CreateOrUpdate Report + Config operation. + :type parameters: ~azure.mgmt.costmanagement.models.ReportConfig + :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: ReportConfig or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.costmanagement.models.ReportConfig or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'reportConfigName': self._serialize.url("report_config_name", report_config_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, 'ReportConfig') + + # 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('ReportConfig', response) + if response.status_code == 201: + deserialized = self._deserialize('ReportConfig', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CostManagement/reportconfigs/{reportConfigName}'} + + def delete( + self, report_config_name, custom_headers=None, raw=False, **operation_config): + """The operation to delete a report. + + :param report_config_name: Report Config Name. + :type report_config_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 = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'reportConfigName': self._serialize.url("report_config_name", report_config_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': '/subscriptions/{subscriptionId}/providers/Microsoft.CostManagement/reportconfigs/{reportConfigName}'} + + def get_by_resource_group_name( + self, resource_group_name, report_config_name, custom_headers=None, raw=False, **operation_config): + """Gets the report config for a resource group under a subscription by + report config name. + + :param resource_group_name: Azure Resource Group Name. + :type resource_group_name: str + :param report_config_name: Report Config Name. + :type report_config_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: ReportConfig or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.costmanagement.models.ReportConfig or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_by_resource_group_name.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'reportConfigName': self._serialize.url("report_config_name", report_config_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('ReportConfig', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_by_resource_group_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CostManagement/reportconfigs/{reportConfigName}'} + + def create_or_update_by_resource_group_name( + self, resource_group_name, report_config_name, parameters, custom_headers=None, raw=False, **operation_config): + """The operation to create or update a report config. 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 resource_group_name: Azure Resource Group Name. + :type resource_group_name: str + :param report_config_name: Report Config Name. + :type report_config_name: str + :param parameters: Parameters supplied to the CreateOrUpdate Report + Config operation. + :type parameters: ~azure.mgmt.costmanagement.models.ReportConfig + :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: ReportConfig or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.costmanagement.models.ReportConfig or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update_by_resource_group_name.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'reportConfigName': self._serialize.url("report_config_name", report_config_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, 'ReportConfig') + + # 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('ReportConfig', response) + if response.status_code == 201: + deserialized = self._deserialize('ReportConfig', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update_by_resource_group_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CostManagement/reportconfigs/{reportConfigName}'} + + def delete_by_resource_group_name( + self, resource_group_name, report_config_name, custom_headers=None, raw=False, **operation_config): + """The operation to delete a report config. + + :param resource_group_name: Azure Resource Group Name. + :type resource_group_name: str + :param report_config_name: Report Config Name. + :type report_config_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_by_resource_group_name.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'reportConfigName': self._serialize.url("report_config_name", report_config_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_by_resource_group_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CostManagement/reportconfigs/{reportConfigName}'}