From 95cffbdc3bb05d58c2f70be95e03b2a7fff2a7de Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 13 Jul 2018 10:57:17 -0700 Subject: [PATCH 01/14] Generated from 58db2cd8519af2e0e6f428c7ab82da2891b440f5 (#2836) add README file for cost management --- .../azure/mgmt/costmanagement/__init__.py | 18 + .../costmanagement/cost_management_client.py | 316 +++++++++++ .../mgmt/costmanagement/models/__init__.py | 94 ++++ .../models/cost_management_client_enums.py | 50 ++ .../mgmt/costmanagement/models/dimension.py | 70 +++ .../costmanagement/models/dimension_paged.py | 27 + .../costmanagement/models/dimension_py3.py | 70 +++ .../costmanagement/models/error_details.py | 40 ++ .../models/error_details_py3.py | 40 ++ .../costmanagement/models/error_response.py | 42 ++ .../models/error_response_py3.py | 42 ++ .../azure/mgmt/costmanagement/models/query.py | 58 ++ .../costmanagement/models/query_column.py | 32 ++ .../costmanagement/models/query_column_py3.py | 32 ++ .../mgmt/costmanagement/models/query_paged.py | 27 + .../mgmt/costmanagement/models/query_py3.py | 58 ++ .../costmanagement/models/report_config.py | 69 +++ .../models/report_config_aggregation.py | 44 ++ .../models/report_config_aggregation_py3.py | 44 ++ .../report_config_comparison_expression.py | 49 ++ ...report_config_comparison_expression_py3.py | 49 ++ .../models/report_config_dataset.py | 58 ++ .../report_config_dataset_configuration.py | 30 + ...report_config_dataset_configuration_py3.py | 30 + .../models/report_config_dataset_py3.py | 58 ++ .../models/report_config_definition.py | 54 ++ .../models/report_config_definition_py3.py | 54 ++ .../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_filter.py | 55 ++ .../models/report_config_filter_py3.py | 55 ++ .../models/report_config_grouping.py | 41 ++ .../models/report_config_grouping_py3.py | 41 ++ .../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 ++ .../models/report_config_time_period.py | 39 ++ .../models/report_config_time_period_py3.py | 39 ++ .../mgmt/costmanagement/models/resource.py | 50 ++ .../costmanagement/models/resource_py3.py | 50 ++ .../costmanagement/operations/__init__.py | 22 + .../billing_account_dimensions_operations.py | 127 +++++ .../operations/report_config_operations.py | 516 ++++++++++++++++++ .../resource_group_dimensions_operations.py | 128 +++++ .../subscription_dimensions_operations.py | 125 +++++ .../azure/mgmt/costmanagement/version.py | 13 + 52 files changed, 3337 insertions(+) create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/__init__.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/cost_management_client.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/cost_management_client_enums.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/dimension.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/dimension_paged.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/dimension_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_response.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_response_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_column.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_column_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_paged.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_py3.py 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_aggregation.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_aggregation_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_comparison_expression.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_comparison_expression_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset_configuration.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset_configuration_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_definition.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_definition_py3.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_filter.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_filter_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_grouping.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_grouping_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/models/report_config_time_period.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_time_period_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/resource.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/resource_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/billing_account_dimensions_operations.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/report_config_operations.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/resource_group_dimensions_operations.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/subscription_dimensions_operations.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/version.py diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/__init__.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/__init__.py new file mode 100644 index 000000000000..b6ddbca6316a --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/__init__.py @@ -0,0 +1,18 @@ +# 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 .cost_management_client import CostManagementClient +from .version import VERSION + +__all__ = ['CostManagementClient'] + +__version__ = VERSION + diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/cost_management_client.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/cost_management_client.py new file mode 100644 index 000000000000..e48488727b9a --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/cost_management_client.py @@ -0,0 +1,316 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.service_client import SDKClient +from msrest import Serializer, Deserializer +from msrestazure import AzureConfiguration +from .version import VERSION +from 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 +from . import models + + +class CostManagementClientConfiguration(AzureConfiguration): + """Configuration for CostManagementClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Azure Subscription ID. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(CostManagementClientConfiguration, self).__init__(base_url) + + self.add_user_agent('azure-mgmt-costmanagement/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id + + +class CostManagementClient(SDKClient): + """CostManagementClient + + :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 + :vartype subscription_dimensions: azure.mgmt.costmanagement.operations.SubscriptionDimensionsOperations + :ivar resource_group_dimensions: ResourceGroupDimensions operations + :vartype resource_group_dimensions: azure.mgmt.costmanagement.operations.ResourceGroupDimensionsOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Azure Subscription ID. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = CostManagementClientConfiguration(credentials, subscription_id, base_url) + super(CostManagementClient, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2018-05-31' + 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( + self._client, self.config, self._serialize, self._deserialize) + self.resource_group_dimensions = ResourceGroupDimensionsOperations( + self._client, self.config, self._serialize, self._deserialize) + + def query_subscription( + self, parameters, custom_headers=None, raw=False, **operation_config): + """Lists the usage data for subscriptionId. + + :param parameters: Parameters supplied to the CreateOrUpdate Report + Config operation. + :type parameters: + ~azure.mgmt.costmanagement.models.ReportConfigDefinition + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Query + :rtype: + ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.query_subscription.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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + 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, 'ReportConfigDefinition') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + query_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CostManagement/Query'} + + def query_resource_group( + self, resource_group_name, parameters, custom_headers=None, raw=False, **operation_config): + """Lists the usage data for subscriptionId and resource group. + + :param resource_group_name: Azure Resource Group Name. + :type resource_group_name: str + :param parameters: Parameters supplied to the CreateOrUpdate Report + Config operation. + :type parameters: + ~azure.mgmt.costmanagement.models.ReportConfigDefinition + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Query + :rtype: + ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.query_resource_group.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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + 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, 'ReportConfigDefinition') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + query_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.CostManagement/Query'} + + def query_billing_account( + self, billing_account_id, parameters, custom_headers=None, raw=False, **operation_config): + """Lists the usage data for billing account. + + :param billing_account_id: BillingAccount ID + :type billing_account_id: str + :param parameters: Parameters supplied to the CreateOrUpdate Report + Config operation. + :type parameters: + ~azure.mgmt.costmanagement.models.ReportConfigDefinition + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Query + :rtype: + ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.query_billing_account.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + 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, 'ReportConfigDefinition') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + query_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/Query'} diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py new file mode 100644 index 000000000000..b78e1d4f6727 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py @@ -0,0 +1,94 @@ +# 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. +# -------------------------------------------------------------------------- + +try: + 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 + from .report_config_grouping_py3 import ReportConfigGrouping + from .report_config_comparison_expression_py3 import ReportConfigComparisonExpression + 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 +except (SyntaxError, ImportError): + 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 + from .report_config_grouping import ReportConfigGrouping + from .report_config_comparison_expression import ReportConfigComparisonExpression + 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, +) + +__all__ = [ + 'ErrorDetails', + 'ErrorResponse', 'ErrorResponseException', + 'Resource', + 'ReportConfigRecurrencePeriod', + 'ReportConfigSchedule', + 'ReportConfigDeliveryDestination', + 'ReportConfigDeliveryInfo', + 'ReportConfigTimePeriod', + 'ReportConfigDatasetConfiguration', + 'ReportConfigAggregation', + 'ReportConfigGrouping', + 'ReportConfigComparisonExpression', + '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 new file mode 100644 index 000000000000..2cbcb89895ef --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/cost_management_client_enums.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum + + +class 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" + month_to_date = "MonthToDate" + year_to_date = "YearToDate" + custom = "Custom" + + +class GranularityType(str, Enum): + + daily = "Daily" + + +class ReportConfigColumnType(str, Enum): + + tag = "Tag" + dimension = "Dimension" diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/dimension.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/dimension.py new file mode 100644 index 000000000000..78b3834a8f90 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/dimension.py @@ -0,0 +1,70 @@ +# 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 Dimension(Resource): + """Dimension. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :param data: + :type data: list[str] + :param total: + :type total: int + :param category: + :type category: str + :param usage_start: + :type usage_start: datetime + :param usage_end: + :type usage_end: datetime + :param next_link: + :type next_link: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'data': {'key': 'properties.data', 'type': '[str]'}, + 'total': {'key': 'properties.total', 'type': 'int'}, + 'category': {'key': 'properties.category', 'type': 'str'}, + 'usage_start': {'key': 'properties.usageStart', 'type': 'iso-8601'}, + 'usage_end': {'key': 'properties.usageEnd', 'type': 'iso-8601'}, + 'next_link': {'key': 'properties.nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Dimension, self).__init__(**kwargs) + self.data = kwargs.get('data', None) + self.total = kwargs.get('total', None) + self.category = kwargs.get('category', None) + self.usage_start = kwargs.get('usage_start', None) + self.usage_end = kwargs.get('usage_end', None) + self.next_link = kwargs.get('next_link', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/dimension_paged.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/dimension_paged.py new file mode 100644 index 000000000000..ef41cfaa70f2 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/dimension_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class DimensionPaged(Paged): + """ + A paging container for iterating over a list of :class:`Dimension ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Dimension]'} + } + + def __init__(self, *args, **kwargs): + + super(DimensionPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/dimension_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/dimension_py3.py new file mode 100644 index 000000000000..b1c8674f0194 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/dimension_py3.py @@ -0,0 +1,70 @@ +# 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 Dimension(Resource): + """Dimension. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :param data: + :type data: list[str] + :param total: + :type total: int + :param category: + :type category: str + :param usage_start: + :type usage_start: datetime + :param usage_end: + :type usage_end: datetime + :param next_link: + :type next_link: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'data': {'key': 'properties.data', 'type': '[str]'}, + 'total': {'key': 'properties.total', 'type': 'int'}, + 'category': {'key': 'properties.category', 'type': 'str'}, + 'usage_start': {'key': 'properties.usageStart', 'type': 'iso-8601'}, + 'usage_end': {'key': 'properties.usageEnd', 'type': 'iso-8601'}, + 'next_link': {'key': 'properties.nextLink', 'type': 'str'}, + } + + def __init__(self, *, data=None, total: int=None, category: str=None, usage_start=None, usage_end=None, next_link: str=None, **kwargs) -> None: + super(Dimension, self).__init__(**kwargs) + self.data = data + self.total = total + self.category = category + self.usage_start = usage_start + self.usage_end = usage_end + self.next_link = next_link diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details.py new file mode 100644 index 000000000000..03f3e23d2153 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ErrorDetails(Model): + """The details of the error. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: Error code. + :vartype code: str + :ivar message: Error message indicating why the operation failed. + :vartype message: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ErrorDetails, self).__init__(**kwargs) + self.code = None + self.message = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details_py3.py new file mode 100644 index 000000000000..f9e1adeac9fe --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ErrorDetails(Model): + """The details of the error. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: Error code. + :vartype code: str + :ivar message: Error message indicating why the operation failed. + :vartype message: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorDetails, self).__init__(**kwargs) + self.code = None + self.message = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_response.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_response.py new file mode 100644 index 000000000000..981621ff3605 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_response.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class ErrorResponse(Model): + """Error response indicates that the service is not able to process the + incoming request. The reason is provided in the error message. + + :param error: The details of the error. + :type error: ~azure.mgmt.costmanagement.models.ErrorDetails + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetails'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_response_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_response_py3.py new file mode 100644 index 000000000000..5d3046468167 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_response_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class ErrorResponse(Model): + """Error response indicates that the service is not able to process the + incoming request. The reason is provided in the error message. + + :param error: The details of the error. + :type error: ~azure.mgmt.costmanagement.models.ErrorDetails + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetails'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query.py new file mode 100644 index 000000000000..d2dd13ad3e7f --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query.py @@ -0,0 +1,58 @@ +# 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 Query(Resource): + """Query. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :param next_link: + :type next_link: str + :param columns: Array of columns + :type columns: list[~azure.mgmt.costmanagement.models.QueryColumn] + :param rows: + :type rows: list[list[object]] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'next_link': {'key': 'properties.nextLink', 'type': 'str'}, + 'columns': {'key': 'properties.columns', 'type': '[QueryColumn]'}, + 'rows': {'key': 'properties.rows', 'type': '[[object]]'}, + } + + def __init__(self, **kwargs): + super(Query, self).__init__(**kwargs) + self.next_link = kwargs.get('next_link', None) + self.columns = kwargs.get('columns', None) + self.rows = kwargs.get('rows', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_column.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_column.py new file mode 100644 index 000000000000..3aa1734245bf --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_column.py @@ -0,0 +1,32 @@ +# 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 QueryColumn(Model): + """QueryColumn. + + :param name: + :type name: str + :param type: + :type type: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(QueryColumn, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_column_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_column_py3.py new file mode 100644 index 000000000000..903dd9b8c11d --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_column_py3.py @@ -0,0 +1,32 @@ +# 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 QueryColumn(Model): + """QueryColumn. + + :param name: + :type name: str + :param type: + :type type: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, type: str=None, **kwargs) -> None: + super(QueryColumn, self).__init__(**kwargs) + self.name = name + self.type = type diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_paged.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_paged.py new file mode 100644 index 000000000000..fe30582676d5 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class QueryPaged(Paged): + """ + A paging container for iterating over a list of :class:`Query ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Query]'} + } + + def __init__(self, *args, **kwargs): + + super(QueryPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_py3.py new file mode 100644 index 000000000000..d0d08fb08457 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_py3.py @@ -0,0 +1,58 @@ +# 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 Query(Resource): + """Query. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :param next_link: + :type next_link: str + :param columns: Array of columns + :type columns: list[~azure.mgmt.costmanagement.models.QueryColumn] + :param rows: + :type rows: list[list[object]] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'next_link': {'key': 'properties.nextLink', 'type': 'str'}, + 'columns': {'key': 'properties.columns', 'type': '[QueryColumn]'}, + 'rows': {'key': 'properties.rows', 'type': '[[object]]'}, + } + + def __init__(self, *, next_link: str=None, columns=None, rows=None, **kwargs) -> None: + super(Query, self).__init__(**kwargs) + self.next_link = next_link + self.columns = columns + self.rows = rows 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_aggregation.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_aggregation.py new file mode 100644 index 000000000000..0f148c5e80c6 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_aggregation.py @@ -0,0 +1,44 @@ +# 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 ReportConfigAggregation(Model): + """The aggregation expression to be used in the report. + + 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. + + :param name: Required. The name of the column to aggregate. + :type name: str + :ivar function: Required. The name of the aggregation function to use. + Default value: "Sum" . + :vartype function: str + """ + + _validation = { + 'name': {'required': True}, + 'function': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'function': {'key': 'function', 'type': 'str'}, + } + + function = "Sum" + + def __init__(self, **kwargs): + super(ReportConfigAggregation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_aggregation_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_aggregation_py3.py new file mode 100644 index 000000000000..61cf2de5e8ed --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_aggregation_py3.py @@ -0,0 +1,44 @@ +# 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 ReportConfigAggregation(Model): + """The aggregation expression to be used in the report. + + 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. + + :param name: Required. The name of the column to aggregate. + :type name: str + :ivar function: Required. The name of the aggregation function to use. + Default value: "Sum" . + :vartype function: str + """ + + _validation = { + 'name': {'required': True}, + 'function': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'function': {'key': 'function', 'type': 'str'}, + } + + function = "Sum" + + def __init__(self, *, name: str, **kwargs) -> None: + super(ReportConfigAggregation, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_comparison_expression.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_comparison_expression.py new file mode 100644 index 000000000000..476e9efcb007 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_comparison_expression.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 ReportConfigComparisonExpression(Model): + """The comparison expression to be used in the report. + + 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. + + :param name: Required. The name of the column to use in comaprison. + :type name: str + :ivar operator: Required. The operator to use for comparison. Default + value: "In" . + :vartype operator: str + :param values: Required. Array of values to use for comparison + :type values: list[str] + """ + + _validation = { + 'name': {'required': True}, + 'operator': {'required': True, 'constant': True}, + 'values': {'required': True, 'min_items': 1}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + } + + operator = "In" + + def __init__(self, **kwargs): + super(ReportConfigComparisonExpression, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.values = kwargs.get('values', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_comparison_expression_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_comparison_expression_py3.py new file mode 100644 index 000000000000..dad044f5cbe6 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_comparison_expression_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 ReportConfigComparisonExpression(Model): + """The comparison expression to be used in the report. + + 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. + + :param name: Required. The name of the column to use in comaprison. + :type name: str + :ivar operator: Required. The operator to use for comparison. Default + value: "In" . + :vartype operator: str + :param values: Required. Array of values to use for comparison + :type values: list[str] + """ + + _validation = { + 'name': {'required': True}, + 'operator': {'required': True, 'constant': True}, + 'values': {'required': True, 'min_items': 1}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + } + + operator = "In" + + def __init__(self, *, name: str, values, **kwargs) -> None: + super(ReportConfigComparisonExpression, self).__init__(**kwargs) + self.name = name + self.values = values diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset.py new file mode 100644 index 000000000000..06ee725bbc9f --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset.py @@ -0,0 +1,58 @@ +# 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 ReportConfigDataset(Model): + """The definition of data present in the report. + + :param granularity: The granularity of rows in the report. Possible values + include: 'Daily' + :type granularity: str or + ~azure.mgmt.costmanagement.models.GranularityType + :param configuration: Has configuration information for the data in the + report. The configuration will be ignored if aggregation and grouping are + provided. + :type configuration: + ~azure.mgmt.costmanagement.models.ReportConfigDatasetConfiguration + :param aggregation: Dictionary of aggregation expression to use in the + report. The key of each item in the dictionary is the alias for the + aggregated column. Report can have upto 2 aggregation clauses. + :type aggregation: dict[str, + ~azure.mgmt.costmanagement.models.ReportConfigAggregation] + :param grouping: Array of group by expression to use in the report. Report + can have upto 2 group by clauses. + :type grouping: + list[~azure.mgmt.costmanagement.models.ReportConfigGrouping] + :param filter: Has filter expression to use in the report. + :type filter: ~azure.mgmt.costmanagement.models.ReportConfigFilter + """ + + _validation = { + 'grouping': {'max_items': 2}, + } + + _attribute_map = { + 'granularity': {'key': 'granularity', 'type': 'str'}, + 'configuration': {'key': 'configuration', 'type': 'ReportConfigDatasetConfiguration'}, + 'aggregation': {'key': 'aggregation', 'type': '{ReportConfigAggregation}'}, + 'grouping': {'key': 'grouping', 'type': '[ReportConfigGrouping]'}, + 'filter': {'key': 'filter', 'type': 'ReportConfigFilter'}, + } + + def __init__(self, **kwargs): + super(ReportConfigDataset, self).__init__(**kwargs) + self.granularity = kwargs.get('granularity', None) + self.configuration = kwargs.get('configuration', None) + self.aggregation = kwargs.get('aggregation', None) + self.grouping = kwargs.get('grouping', None) + self.filter = kwargs.get('filter', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset_configuration.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset_configuration.py new file mode 100644 index 000000000000..d22317c6e54c --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset_configuration.py @@ -0,0 +1,30 @@ +# 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 ReportConfigDatasetConfiguration(Model): + """The configuration of dataset in the report. + + :param columns: Array of column names to be included in the report. Any + valid report column name is allowed. If not provided, then report includes + all columns. + :type columns: list[str] + """ + + _attribute_map = { + 'columns': {'key': 'columns', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(ReportConfigDatasetConfiguration, self).__init__(**kwargs) + self.columns = kwargs.get('columns', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset_configuration_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset_configuration_py3.py new file mode 100644 index 000000000000..f0e9bc25d10e --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset_configuration_py3.py @@ -0,0 +1,30 @@ +# 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 ReportConfigDatasetConfiguration(Model): + """The configuration of dataset in the report. + + :param columns: Array of column names to be included in the report. Any + valid report column name is allowed. If not provided, then report includes + all columns. + :type columns: list[str] + """ + + _attribute_map = { + 'columns': {'key': 'columns', 'type': '[str]'}, + } + + def __init__(self, *, columns=None, **kwargs) -> None: + super(ReportConfigDatasetConfiguration, self).__init__(**kwargs) + self.columns = columns diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset_py3.py new file mode 100644 index 000000000000..02f8eb36cb64 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset_py3.py @@ -0,0 +1,58 @@ +# 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 ReportConfigDataset(Model): + """The definition of data present in the report. + + :param granularity: The granularity of rows in the report. Possible values + include: 'Daily' + :type granularity: str or + ~azure.mgmt.costmanagement.models.GranularityType + :param configuration: Has configuration information for the data in the + report. The configuration will be ignored if aggregation and grouping are + provided. + :type configuration: + ~azure.mgmt.costmanagement.models.ReportConfigDatasetConfiguration + :param aggregation: Dictionary of aggregation expression to use in the + report. The key of each item in the dictionary is the alias for the + aggregated column. Report can have upto 2 aggregation clauses. + :type aggregation: dict[str, + ~azure.mgmt.costmanagement.models.ReportConfigAggregation] + :param grouping: Array of group by expression to use in the report. Report + can have upto 2 group by clauses. + :type grouping: + list[~azure.mgmt.costmanagement.models.ReportConfigGrouping] + :param filter: Has filter expression to use in the report. + :type filter: ~azure.mgmt.costmanagement.models.ReportConfigFilter + """ + + _validation = { + 'grouping': {'max_items': 2}, + } + + _attribute_map = { + 'granularity': {'key': 'granularity', 'type': 'str'}, + 'configuration': {'key': 'configuration', 'type': 'ReportConfigDatasetConfiguration'}, + 'aggregation': {'key': 'aggregation', 'type': '{ReportConfigAggregation}'}, + 'grouping': {'key': 'grouping', 'type': '[ReportConfigGrouping]'}, + 'filter': {'key': 'filter', 'type': 'ReportConfigFilter'}, + } + + def __init__(self, *, granularity=None, configuration=None, aggregation=None, grouping=None, filter=None, **kwargs) -> None: + super(ReportConfigDataset, self).__init__(**kwargs) + self.granularity = granularity + self.configuration = configuration + self.aggregation = aggregation + self.grouping = grouping + self.filter = filter diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_definition.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_definition.py new file mode 100644 index 000000000000..bd45fb4bbf5b --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_definition.py @@ -0,0 +1,54 @@ +# 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 ReportConfigDefinition(Model): + """The definition of a report config. + + 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 type: Required. The type of the report. Default value: "Usage" . + :vartype type: str + :param timeframe: Required. The time frame for pulling data for the + report. If custom, then a specific time period must be provided. Possible + values include: 'WeekToDate', 'MonthToDate', 'YearToDate', 'Custom' + :type timeframe: str or ~azure.mgmt.costmanagement.models.TimeframeType + :param time_period: Has time period for pulling data for the report. + :type time_period: + ~azure.mgmt.costmanagement.models.ReportConfigTimePeriod + :param dataset: Has definition for data in this report config. + :type dataset: ~azure.mgmt.costmanagement.models.ReportConfigDataset + """ + + _validation = { + 'type': {'required': True, 'constant': True}, + 'timeframe': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'timeframe': {'key': 'timeframe', 'type': 'str'}, + 'time_period': {'key': 'timePeriod', 'type': 'ReportConfigTimePeriod'}, + 'dataset': {'key': 'dataset', 'type': 'ReportConfigDataset'}, + } + + type = "Usage" + + def __init__(self, **kwargs): + super(ReportConfigDefinition, self).__init__(**kwargs) + self.timeframe = kwargs.get('timeframe', None) + self.time_period = kwargs.get('time_period', None) + self.dataset = kwargs.get('dataset', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_definition_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_definition_py3.py new file mode 100644 index 000000000000..74f4a5df6e0d --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_definition_py3.py @@ -0,0 +1,54 @@ +# 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 ReportConfigDefinition(Model): + """The definition of a report config. + + 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 type: Required. The type of the report. Default value: "Usage" . + :vartype type: str + :param timeframe: Required. The time frame for pulling data for the + report. If custom, then a specific time period must be provided. Possible + values include: 'WeekToDate', 'MonthToDate', 'YearToDate', 'Custom' + :type timeframe: str or ~azure.mgmt.costmanagement.models.TimeframeType + :param time_period: Has time period for pulling data for the report. + :type time_period: + ~azure.mgmt.costmanagement.models.ReportConfigTimePeriod + :param dataset: Has definition for data in this report config. + :type dataset: ~azure.mgmt.costmanagement.models.ReportConfigDataset + """ + + _validation = { + 'type': {'required': True, 'constant': True}, + 'timeframe': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'timeframe': {'key': 'timeframe', 'type': 'str'}, + 'time_period': {'key': 'timePeriod', 'type': 'ReportConfigTimePeriod'}, + 'dataset': {'key': 'dataset', 'type': 'ReportConfigDataset'}, + } + + type = "Usage" + + def __init__(self, *, timeframe, time_period=None, dataset=None, **kwargs) -> None: + super(ReportConfigDefinition, self).__init__(**kwargs) + self.timeframe = timeframe + self.time_period = time_period + self.dataset = dataset 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_filter.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_filter.py new file mode 100644 index 000000000000..28cfde2c4e62 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_filter.py @@ -0,0 +1,55 @@ +# 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 ReportConfigFilter(Model): + """The filter expression to be used in the report. + + :param and_property: The logical "AND" expression. Must have atleast 2 + items. + :type and_property: + list[~azure.mgmt.costmanagement.models.ReportConfigFilter] + :param or_property: The logical "OR" expression. Must have atleast 2 + items. + :type or_property: + list[~azure.mgmt.costmanagement.models.ReportConfigFilter] + :param not_property: The logical "NOT" expression. + :type not_property: ~azure.mgmt.costmanagement.models.ReportConfigFilter + :param dimension: Has comparison expression for a dimension + :type dimension: + ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression + :param tag: Has comparison expression for a tag + :type tag: + ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression + """ + + _validation = { + 'and_property': {'min_items': 2}, + 'or_property': {'min_items': 2}, + } + + _attribute_map = { + 'and_property': {'key': 'and', 'type': '[ReportConfigFilter]'}, + 'or_property': {'key': 'or', 'type': '[ReportConfigFilter]'}, + 'not_property': {'key': 'not', 'type': 'ReportConfigFilter'}, + 'dimension': {'key': 'dimension', 'type': 'ReportConfigComparisonExpression'}, + 'tag': {'key': 'tag', 'type': 'ReportConfigComparisonExpression'}, + } + + def __init__(self, **kwargs): + super(ReportConfigFilter, self).__init__(**kwargs) + self.and_property = kwargs.get('and_property', None) + self.or_property = kwargs.get('or_property', None) + self.not_property = kwargs.get('not_property', None) + self.dimension = kwargs.get('dimension', None) + self.tag = kwargs.get('tag', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_filter_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_filter_py3.py new file mode 100644 index 000000000000..2cbd1466c50c --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_filter_py3.py @@ -0,0 +1,55 @@ +# 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 ReportConfigFilter(Model): + """The filter expression to be used in the report. + + :param and_property: The logical "AND" expression. Must have atleast 2 + items. + :type and_property: + list[~azure.mgmt.costmanagement.models.ReportConfigFilter] + :param or_property: The logical "OR" expression. Must have atleast 2 + items. + :type or_property: + list[~azure.mgmt.costmanagement.models.ReportConfigFilter] + :param not_property: The logical "NOT" expression. + :type not_property: ~azure.mgmt.costmanagement.models.ReportConfigFilter + :param dimension: Has comparison expression for a dimension + :type dimension: + ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression + :param tag: Has comparison expression for a tag + :type tag: + ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression + """ + + _validation = { + 'and_property': {'min_items': 2}, + 'or_property': {'min_items': 2}, + } + + _attribute_map = { + 'and_property': {'key': 'and', 'type': '[ReportConfigFilter]'}, + 'or_property': {'key': 'or', 'type': '[ReportConfigFilter]'}, + 'not_property': {'key': 'not', 'type': 'ReportConfigFilter'}, + 'dimension': {'key': 'dimension', 'type': 'ReportConfigComparisonExpression'}, + 'tag': {'key': 'tag', 'type': 'ReportConfigComparisonExpression'}, + } + + def __init__(self, *, and_property=None, or_property=None, not_property=None, dimension=None, tag=None, **kwargs) -> None: + super(ReportConfigFilter, self).__init__(**kwargs) + self.and_property = and_property + self.or_property = or_property + self.not_property = not_property + self.dimension = dimension + self.tag = tag diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_grouping.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_grouping.py new file mode 100644 index 000000000000..1396ac74d1c0 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_grouping.py @@ -0,0 +1,41 @@ +# 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 ReportConfigGrouping(Model): + """The group by expression to be used in the report. + + All required parameters must be populated in order to send to Azure. + + :param column_type: Required. Has type of the column to group. Possible + values include: 'Tag', 'Dimension' + :type column_type: str or + ~azure.mgmt.costmanagement.models.ReportConfigColumnType + :param name: Required. The name of the column to group. + :type name: str + """ + + _validation = { + 'column_type': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'column_type': {'key': 'columnType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ReportConfigGrouping, self).__init__(**kwargs) + self.column_type = kwargs.get('column_type', None) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_grouping_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_grouping_py3.py new file mode 100644 index 000000000000..e40f57c8e869 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_grouping_py3.py @@ -0,0 +1,41 @@ +# 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 ReportConfigGrouping(Model): + """The group by expression to be used in the report. + + All required parameters must be populated in order to send to Azure. + + :param column_type: Required. Has type of the column to group. Possible + values include: 'Tag', 'Dimension' + :type column_type: str or + ~azure.mgmt.costmanagement.models.ReportConfigColumnType + :param name: Required. The name of the column to group. + :type name: str + """ + + _validation = { + 'column_type': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'column_type': {'key': 'columnType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, column_type, name: str, **kwargs) -> None: + super(ReportConfigGrouping, self).__init__(**kwargs) + self.column_type = column_type + self.name = name 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/models/report_config_time_period.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_time_period.py new file mode 100644 index 000000000000..bc09d4547bb3 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_time_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 ReportConfigTimePeriod(Model): + """The start and end date for pulling data for the report. + + All required parameters must be populated in order to send to Azure. + + :param from_property: Required. The start date to pull data from. + :type from_property: datetime + :param to: Required. The end date to pull data to. + :type to: datetime + """ + + _validation = { + 'from_property': {'required': True}, + 'to': {'required': True}, + } + + _attribute_map = { + 'from_property': {'key': 'from', 'type': 'iso-8601'}, + 'to': {'key': 'to', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(ReportConfigTimePeriod, 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_time_period_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_time_period_py3.py new file mode 100644 index 000000000000..c98826663a11 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_time_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 ReportConfigTimePeriod(Model): + """The start and end date for pulling data for the report. + + All required parameters must be populated in order to send to Azure. + + :param from_property: Required. The start date to pull data from. + :type from_property: datetime + :param to: Required. The end date to pull data to. + :type to: datetime + """ + + _validation = { + 'from_property': {'required': True}, + 'to': {'required': True}, + } + + _attribute_map = { + 'from_property': {'key': 'from', 'type': 'iso-8601'}, + 'to': {'key': 'to', 'type': 'iso-8601'}, + } + + def __init__(self, *, from_property, to, **kwargs) -> None: + super(ReportConfigTimePeriod, self).__init__(**kwargs) + self.from_property = from_property + self.to = to diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/resource.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/resource.py new file mode 100644 index 000000000000..08e36f3f8091 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/resource.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """The Resource model definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.tags = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/resource_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/resource_py3.py new file mode 100644 index 000000000000..38b4ca3ee6af --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/resource_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """The Resource model definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.tags = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py new file mode 100644 index 000000000000..2ccef72c986f --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py @@ -0,0 +1,22 @@ +# 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 .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/billing_account_dimensions_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/billing_account_dimensions_operations.py new file mode 100644 index 000000000000..18a1ccbb7c61 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/billing_account_dimensions_operations.py @@ -0,0 +1,127 @@ +# 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 BillingAccountDimensionsOperations(object): + """BillingAccountDimensionsOperations 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, billing_account_id, filter=None, expand=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config): + """Lists the dimensions by billingAccount Id. + + :param billing_account_id: BillingAccount ID + :type billing_account_id: str + :param filter: May be used to filter dimensions by + properties/category, properties/usageStart, properties/usageEnd. + Supported operators are 'eq','lt', 'gt', 'le', 'ge'. + :type filter: str + :param expand: May be used to expand the properties/data within a + dimension dategory. By default, data is not included when listing + dimensions. + :type expand: str + :param skiptoken: Skiptoken is only used if a previous operation + returned a partial result. If a previous response contains a nextLink + element, the value of the nextLink element will include a skiptoken + parameter that specifies a starting point to use for subsequent calls. + :type skiptoken: str + :param top: May be used to limit the number of results to the most + recent N dimension data. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Dimension + :rtype: + ~azure.mgmt.costmanagement.models.DimensionPaged[~azure.mgmt.costmanagement.models.Dimension] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + 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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.DimensionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DimensionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/dimensions'} 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..52034fba0576 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/report_config_operations.py @@ -0,0 +1,516 @@ +# 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, 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['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) + response = self._client.send( + request, header_parameters, body_content, 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 = {} + 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 and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, 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['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) + response = self._client.send( + request, header_parameters, body_content, 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 = {} + 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 and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, 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}'} diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/resource_group_dimensions_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/resource_group_dimensions_operations.py new file mode 100644 index 000000000000..2fb11ace7f82 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/resource_group_dimensions_operations.py @@ -0,0 +1,128 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ResourceGroupDimensionsOperations(object): + """ResourceGroupDimensionsOperations 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, resource_group_name, filter=None, expand=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config): + """Lists the dimensions by resource group Id. + + :param resource_group_name: Azure Resource Group Name. + :type resource_group_name: str + :param filter: May be used to filter dimensions by + properties/category, properties/usageStart, properties/usageEnd. + Supported operators are 'eq','lt', 'gt', 'le', 'ge'. + :type filter: str + :param expand: May be used to expand the properties/data within a + dimension dategory. By default, data is not included when listing + dimensions. + :type expand: str + :param skiptoken: Skiptoken is only used if a previous operation + returned a partial result. If a previous response contains a nextLink + element, the value of the nextLink element will include a skiptoken + parameter that specifies a starting point to use for subsequent calls. + :type skiptoken: str + :param top: May be used to limit the number of results to the most + recent N dimension data. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Dimension + :rtype: + ~azure.mgmt.costmanagement.models.DimensionPaged[~azure.mgmt.costmanagement.models.Dimension] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + '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') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + 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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.DimensionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DimensionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CostManagement/dimensions'} diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/subscription_dimensions_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/subscription_dimensions_operations.py new file mode 100644 index 000000000000..059102c9b25d --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/subscription_dimensions_operations.py @@ -0,0 +1,125 @@ +# 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 SubscriptionDimensionsOperations(object): + """SubscriptionDimensionsOperations 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, filter=None, expand=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config): + """Lists the dimensions by subscription Id. + + :param filter: May be used to filter dimensions by + properties/category, properties/usageStart, properties/usageEnd. + Supported operators are 'eq','lt', 'gt', 'le', 'ge'. + :type filter: str + :param expand: May be used to expand the properties/data within a + dimension dategory. By default, data is not included when listing + dimensions. + :type expand: str + :param skiptoken: Skiptoken is only used if a previous operation + returned a partial result. If a previous response contains a nextLink + element, the value of the nextLink element will include a skiptoken + parameter that specifies a starting point to use for subsequent calls. + :type skiptoken: str + :param top: May be used to limit the number of results to the most + recent N dimension data. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Dimension + :rtype: + ~azure.mgmt.costmanagement.models.DimensionPaged[~azure.mgmt.costmanagement.models.Dimension] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + 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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.DimensionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DimensionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CostManagement/dimensions'} diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/version.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/version.py new file mode 100644 index 000000000000..9c644827672b --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/version.py @@ -0,0 +1,13 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "1.2.0" + From f37ff2a147333b387c2f92c33d3d88edd6c93019 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 2 Aug 2018 13:26:38 -0700 Subject: [PATCH 02/14] Generated from 7d375b2ce4c679c5e3a1f63185925ca83422c098 (#3068) Add Connector resource type as preview to CostManagement RP * Initial commit for Microsoft.CostManagement 2018-09-01-preview * Add Connector resource type as preview to CostManagement RP --- .../costmanagement/cost_management_client.py | 18 ++++---- .../billing_account_dimensions_operations.py | 7 ++- .../operations/report_config_operations.py | 46 +++++++++---------- .../resource_group_dimensions_operations.py | 7 ++- .../subscription_dimensions_operations.py | 7 ++- 5 files changed, 40 insertions(+), 45 deletions(-) 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 e48488727b9a..ca11633b2d39 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/cost_management_client.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/cost_management_client.py @@ -136,6 +136,7 @@ def internal_paging(next_link=None, raw=False): # 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()) @@ -148,9 +149,8 @@ def internal_paging(next_link=None, raw=False): body_content = self._serialize.body(parameters, 'ReportConfigDefinition') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -210,6 +210,7 @@ def internal_paging(next_link=None, raw=False): # 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()) @@ -222,9 +223,8 @@ def internal_paging(next_link=None, raw=False): body_content = self._serialize.body(parameters, 'ReportConfigDefinition') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -283,6 +283,7 @@ def internal_paging(next_link=None, raw=False): # 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()) @@ -295,9 +296,8 @@ def internal_paging(next_link=None, raw=False): body_content = self._serialize.body(parameters, 'ReportConfigDefinition') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/billing_account_dimensions_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/billing_account_dimensions_operations.py index 18a1ccbb7c61..46155cdb1698 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/billing_account_dimensions_operations.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/billing_account_dimensions_operations.py @@ -97,7 +97,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -106,9 +106,8 @@ def internal_paging(next_link=None, raw=False): 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) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + 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) 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 index 52034fba0576..255dc64a915e 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/report_config_operations.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/report_config_operations.py @@ -64,7 +64,7 @@ def list( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -73,8 +73,8 @@ def list( 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) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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) @@ -122,7 +122,7 @@ def list_by_resource_group_name( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -131,8 +131,8 @@ def list_by_resource_group_name( 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) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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) @@ -180,7 +180,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -189,8 +189,8 @@ def get( 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) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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) @@ -244,6 +244,7 @@ def create_or_update( # 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()) @@ -256,9 +257,8 @@ def create_or_update( body_content = self._serialize.body(parameters, 'ReportConfig') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + 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) @@ -307,7 +307,6 @@ def delete( # Construct headers header_parameters = {} - 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: @@ -316,8 +315,8 @@ def delete( 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) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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) @@ -362,7 +361,7 @@ def get_by_resource_group_name( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -371,8 +370,8 @@ def get_by_resource_group_name( 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) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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) @@ -429,6 +428,7 @@ def create_or_update_by_resource_group_name( # 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()) @@ -441,9 +441,8 @@ def create_or_update_by_resource_group_name( body_content = self._serialize.body(parameters, 'ReportConfig') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + 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) @@ -495,7 +494,6 @@ def delete_by_resource_group_name( # Construct headers header_parameters = {} - 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: @@ -504,8 +502,8 @@ def delete_by_resource_group_name( 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) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/resource_group_dimensions_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/resource_group_dimensions_operations.py index 2fb11ace7f82..ed8950494a63 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/resource_group_dimensions_operations.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/resource_group_dimensions_operations.py @@ -98,7 +98,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -107,9 +107,8 @@ def internal_paging(next_link=None, raw=False): 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) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + 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) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/subscription_dimensions_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/subscription_dimensions_operations.py index 059102c9b25d..a49658d4b763 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/subscription_dimensions_operations.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/subscription_dimensions_operations.py @@ -95,7 +95,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -104,9 +104,8 @@ def internal_paging(next_link=None, raw=False): 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) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + 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) From 69327e8badc3b9ea242f73bdad5494387a44da08 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 27 Aug 2018 13:59:38 -0700 Subject: [PATCH 03/14] [AutoPR cost-management/resource-manager] Reports API moved from stable to preview version with addition of documentation of a couple of new APIs (#3145) * Generated from 9f3607b94b9c3f9b6c2fa12ae00ed71a80d42699 Updated reports api documentation * Generated from 41ff04d4ffb063505850fbecd4dd6061f4072f29 Undo remove of API from stable version From 18172d8046380fed1ba6465ba813bcb50f89d119 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 2 Oct 2018 17:07:07 -0700 Subject: [PATCH 04/14] [AutoPR cost-management/resource-manager] Fixing examples and adding missed properties (#3480) * Generated from 73f83b4c51d265aca17132381382f60da78d5f7a Fixing examples and adding missed properties * Packaging update of azure-mgmt-costmanagement --- azure-mgmt-costmanagement/HISTORY.rst | 9 ++ azure-mgmt-costmanagement/MANIFEST.in | 1 + azure-mgmt-costmanagement/README.rst | 49 ++++++++++ azure-mgmt-costmanagement/azure/__init__.py | 1 + .../azure/mgmt/__init__.py | 1 + .../costmanagement/cost_management_client.py | 5 + .../mgmt/costmanagement/models/__init__.py | 8 ++ .../mgmt/costmanagement/models/operation.py | 39 ++++++++ .../models/operation_display.py | 46 +++++++++ .../models/operation_display_py3.py | 46 +++++++++ .../costmanagement/models/operation_paged.py | 27 ++++++ .../costmanagement/models/operation_py3.py | 39 ++++++++ .../costmanagement/operations/__init__.py | 2 + .../costmanagement/operations/operations.py | 96 +++++++++++++++++++ azure-mgmt-costmanagement/sdk_packaging.toml | 7 ++ azure-mgmt-costmanagement/setup.cfg | 2 + azure-mgmt-costmanagement/setup.py | 87 +++++++++++++++++ 17 files changed, 465 insertions(+) create mode 100644 azure-mgmt-costmanagement/HISTORY.rst create mode 100644 azure-mgmt-costmanagement/MANIFEST.in create mode 100644 azure-mgmt-costmanagement/README.rst create mode 100644 azure-mgmt-costmanagement/azure/__init__.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/__init__.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation_display.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation_display_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation_paged.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/operations.py create mode 100644 azure-mgmt-costmanagement/sdk_packaging.toml create mode 100644 azure-mgmt-costmanagement/setup.cfg create mode 100644 azure-mgmt-costmanagement/setup.py diff --git a/azure-mgmt-costmanagement/HISTORY.rst b/azure-mgmt-costmanagement/HISTORY.rst new file mode 100644 index 000000000000..8924d5d6c445 --- /dev/null +++ b/azure-mgmt-costmanagement/HISTORY.rst @@ -0,0 +1,9 @@ +.. :changelog: + +Release History +=============== + +0.1.0 (1970-01-01) +++++++++++++++++++ + +* Initial Release diff --git a/azure-mgmt-costmanagement/MANIFEST.in b/azure-mgmt-costmanagement/MANIFEST.in new file mode 100644 index 000000000000..bb37a2723dae --- /dev/null +++ b/azure-mgmt-costmanagement/MANIFEST.in @@ -0,0 +1 @@ +include *.rst diff --git a/azure-mgmt-costmanagement/README.rst b/azure-mgmt-costmanagement/README.rst new file mode 100644 index 000000000000..45de4e6b43dd --- /dev/null +++ b/azure-mgmt-costmanagement/README.rst @@ -0,0 +1,49 @@ +Microsoft Azure SDK for Python +============================== + +This is the Microsoft Azure MyService Management Client Library. + +Azure Resource Manager (ARM) is the next generation of management APIs that +replace the old Azure Service Management (ASM). + +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. + +For the older Azure Service Management (ASM) libraries, see +`azure-servicemanagement-legacy `__ library. + +For a more complete set of Azure libraries, see the `azure `__ bundle package. + + +Compatibility +============= + +**IMPORTANT**: If you have an earlier version of the azure package +(version < 1.0), you should uninstall it before installing this package. + +You can check the version using pip: + +.. code:: shell + + pip freeze + +If you see azure==0.11.0 (or any version below 1.0), uninstall it first: + +.. code:: shell + + pip uninstall azure + + +Usage +===== + +For code examples, see `MyService Management +`__ +on docs.microsoft.com. + + +Provide Feedback +================ + +If you encounter any bugs or have suggestions, please file an issue in the +`Issues `__ +section of the project. diff --git a/azure-mgmt-costmanagement/azure/__init__.py b/azure-mgmt-costmanagement/azure/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/azure-mgmt-costmanagement/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-mgmt-costmanagement/azure/mgmt/__init__.py b/azure-mgmt-costmanagement/azure/mgmt/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file 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..1ac9432eb07e 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/cost_management_client.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/cost_management_client.py @@ -19,6 +19,7 @@ from .operations.billing_account_dimensions_operations import BillingAccountDimensionsOperations from .operations.subscription_dimensions_operations import SubscriptionDimensionsOperations from .operations.resource_group_dimensions_operations import ResourceGroupDimensionsOperations +from .operations.operations import Operations from . import models @@ -68,6 +69,8 @@ class CostManagementClient(SDKClient): :vartype subscription_dimensions: azure.mgmt.costmanagement.operations.SubscriptionDimensionsOperations :ivar resource_group_dimensions: ResourceGroupDimensions operations :vartype resource_group_dimensions: azure.mgmt.costmanagement.operations.ResourceGroupDimensionsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.costmanagement.operations.Operations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -96,6 +99,8 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.resource_group_dimensions = ResourceGroupDimensionsOperations( self._client, self.config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) def query_subscription( self, parameters, custom_headers=None, raw=False, **operation_config): diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py index b78e1d4f6727..71b14053e1a6 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py @@ -30,6 +30,8 @@ from .dimension_py3 import Dimension from .query_column_py3 import QueryColumn from .query_py3 import Query + from .operation_display_py3 import OperationDisplay + from .operation_py3 import Operation except (SyntaxError, ImportError): from .error_details import ErrorDetails from .error_response import ErrorResponse, ErrorResponseException @@ -51,8 +53,11 @@ from .dimension import Dimension from .query_column import QueryColumn from .query import Query + from .operation_display import OperationDisplay + from .operation import Operation from .dimension_paged import DimensionPaged from .query_paged import QueryPaged +from .operation_paged import OperationPaged from .cost_management_client_enums import ( StatusType, RecurrenceType, @@ -83,8 +88,11 @@ 'Dimension', 'QueryColumn', 'Query', + 'OperationDisplay', + 'Operation', 'DimensionPaged', 'QueryPaged', + 'OperationPaged', 'StatusType', 'RecurrenceType', 'FormatType', diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation.py new file mode 100644 index 000000000000..c5965e54743a --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation.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 Operation(Model): + """A Cost management REST API operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Operation name: {provider}/{resource}/{operation}. + :vartype name: str + :param display: The object that represents the operation. + :type display: ~azure.mgmt.costmanagement.models.OperationDisplay + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = kwargs.get('display', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation_display.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation_display.py new file mode 100644 index 000000000000..e85e6e2a6647 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation_display.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 OperationDisplay(Model): + """The object that represents the operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: Service provider: Microsoft.CostManagement. + :vartype provider: str + :ivar resource: Resource on which the operation is performed: Dimensions, + Query. + :vartype resource: str + :ivar operation: Operation type: Read, write, delete, etc. + :vartype operation: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation_display_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation_display_py3.py new file mode 100644 index 000000000000..63ff2a7e14df --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation_display_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 OperationDisplay(Model): + """The object that represents the operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: Service provider: Microsoft.CostManagement. + :vartype provider: str + :ivar resource: Resource on which the operation is performed: Dimensions, + Query. + :vartype resource: str + :ivar operation: Operation type: Read, write, delete, etc. + :vartype operation: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation_paged.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation_paged.py new file mode 100644 index 000000000000..2127f26e1525 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation_py3.py new file mode 100644 index 000000000000..c69e983617b9 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation_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 Operation(Model): + """A Cost management REST API operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Operation name: {provider}/{resource}/{operation}. + :vartype name: str + :param display: The object that represents the operation. + :type display: ~azure.mgmt.costmanagement.models.OperationDisplay + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, *, display=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = display diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py index 2ccef72c986f..93ee3e3ea6df 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py @@ -13,10 +13,12 @@ from .billing_account_dimensions_operations import BillingAccountDimensionsOperations from .subscription_dimensions_operations import SubscriptionDimensionsOperations from .resource_group_dimensions_operations import ResourceGroupDimensionsOperations +from .operations import Operations __all__ = [ 'ReportConfigOperations', 'BillingAccountDimensionsOperations', 'SubscriptionDimensionsOperations', 'ResourceGroupDimensionsOperations', + 'Operations', ] diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/operations.py new file mode 100644 index 000000000000..aa2c9606c7ee --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/operations.py @@ -0,0 +1,96 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class Operations(object): + """Operations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 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 of the available consumption REST API operations. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Operation + :rtype: + ~azure.mgmt.costmanagement.models.OperationPaged[~azure.mgmt.costmanagement.models.Operation] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.CostManagement/operations'} diff --git a/azure-mgmt-costmanagement/sdk_packaging.toml b/azure-mgmt-costmanagement/sdk_packaging.toml new file mode 100644 index 000000000000..bd14e24054ab --- /dev/null +++ b/azure-mgmt-costmanagement/sdk_packaging.toml @@ -0,0 +1,7 @@ +[packaging] +package_name = "azure-mgmt-costmanagement" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "MyService Management" +package_doc_id = "" +is_stable = false +is_arm = true diff --git a/azure-mgmt-costmanagement/setup.cfg b/azure-mgmt-costmanagement/setup.cfg new file mode 100644 index 000000000000..3c6e79cf31da --- /dev/null +++ b/azure-mgmt-costmanagement/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/azure-mgmt-costmanagement/setup.py b/azure-mgmt-costmanagement/setup.py new file mode 100644 index 000000000000..4161d00c6322 --- /dev/null +++ b/azure-mgmt-costmanagement/setup.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python + +#------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +#-------------------------------------------------------------------------- + +import re +import os.path +from io import open +from setuptools import find_packages, setup + +# Change the PACKAGE_NAME only to change folder and different name +PACKAGE_NAME = "azure-mgmt-costmanagement" +PACKAGE_PPRINT_NAME = "MyService Management" + +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace('-', '/') +# a-b-c => a.b.c +namespace_name = PACKAGE_NAME.replace('-', '.') + +# azure v0.x is not compatible with this package +# azure v0.x used to have a __version__ attribute (newer versions don't) +try: + import azure + try: + ver = azure.__version__ + raise Exception( + 'This package is incompatible with azure=={}. '.format(ver) + + 'Uninstall it with "pip uninstall azure".' + ) + except AttributeError: + pass +except ImportError: + pass + +# Version extraction inspired from 'requests' +with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd: + version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', + fd.read(), re.MULTILINE).group(1) + +if not version: + raise RuntimeError('Cannot find version information') + +with open('README.rst', encoding='utf-8') as f: + readme = f.read() +with open('HISTORY.rst', encoding='utf-8') as f: + history = f.read() + +setup( + name=PACKAGE_NAME, + version=version, + description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), + long_description=readme + '\n\n' + history, + license='MIT License', + author='Microsoft Corporation', + author_email='azpysdkhelp@microsoft.com', + url='https://github.com/Azure/azure-sdk-for-python', + classifiers=[ + 'Development Status :: 4 - Beta', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'License :: OSI Approved :: MIT License', + ], + zip_safe=False, + packages=find_packages(exclude=[ + 'tests', + # Exclude packages that will be covered by PEP420 or nspkg + 'azure', + 'azure.mgmt', + ]), + install_requires=[ + 'msrest>=0.5.0', + 'msrestazure>=0.4.32,<2.0.0', + 'azure-common~=1.1', + ], + extras_require={ + ":python_version<'3.0'": ['azure-mgmt-nspkg'], + } +) From 0ca6c34497746dcbd6b73a9cb9ab9e2957e6b44b Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 3 Dec 2018 23:12:20 -0800 Subject: [PATCH 05/14] [AutoPR cost-management/resource-manager] typo: Microsoft.CostManagement (#3929) * Generated from 56aef8383527613e2ee15566cd34c6b92fd07647 typo: Microsoft.CostManagement - acount -> account - dategory -> category - upto -> up to - atleast -> at least - comaprison -> comparison - exeuction -> execution - occuring -> occurring - overriden -> overridden - managment -. management * Packaging update of azure-mgmt-costmanagement --- azure-mgmt-costmanagement/MANIFEST.in | 3 +++ .../models/report_config_comparison_expression.py | 2 +- .../models/report_config_comparison_expression_py3.py | 2 +- .../azure/mgmt/costmanagement/models/report_config_dataset.py | 4 ++-- .../mgmt/costmanagement/models/report_config_dataset_py3.py | 4 ++-- .../azure/mgmt/costmanagement/models/report_config_filter.py | 4 ++-- .../mgmt/costmanagement/models/report_config_filter_py3.py | 4 ++-- .../operations/billing_account_dimensions_operations.py | 2 +- .../operations/resource_group_dimensions_operations.py | 2 +- .../operations/subscription_dimensions_operations.py | 2 +- 10 files changed, 16 insertions(+), 13 deletions(-) diff --git a/azure-mgmt-costmanagement/MANIFEST.in b/azure-mgmt-costmanagement/MANIFEST.in index bb37a2723dae..6ceb27f7a96e 100644 --- a/azure-mgmt-costmanagement/MANIFEST.in +++ b/azure-mgmt-costmanagement/MANIFEST.in @@ -1 +1,4 @@ include *.rst +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_comparison_expression.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_comparison_expression.py index 476e9efcb007..f83b560bfdb6 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_comparison_expression.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_comparison_expression.py @@ -20,7 +20,7 @@ class ReportConfigComparisonExpression(Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the column to use in comaprison. + :param name: Required. The name of the column to use in comparison. :type name: str :ivar operator: Required. The operator to use for comparison. Default value: "In" . diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_comparison_expression_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_comparison_expression_py3.py index dad044f5cbe6..efdeb11ba56d 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_comparison_expression_py3.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_comparison_expression_py3.py @@ -20,7 +20,7 @@ class ReportConfigComparisonExpression(Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the column to use in comaprison. + :param name: Required. The name of the column to use in comparison. :type name: str :ivar operator: Required. The operator to use for comparison. Default value: "In" . diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset.py index 06ee725bbc9f..379de034502a 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset.py @@ -26,11 +26,11 @@ class ReportConfigDataset(Model): ~azure.mgmt.costmanagement.models.ReportConfigDatasetConfiguration :param aggregation: Dictionary of aggregation expression to use in the report. The key of each item in the dictionary is the alias for the - aggregated column. Report can have upto 2 aggregation clauses. + aggregated column. Report can have up to 2 aggregation clauses. :type aggregation: dict[str, ~azure.mgmt.costmanagement.models.ReportConfigAggregation] :param grouping: Array of group by expression to use in the report. Report - can have upto 2 group by clauses. + can have up to 2 group by clauses. :type grouping: list[~azure.mgmt.costmanagement.models.ReportConfigGrouping] :param filter: Has filter expression to use in the report. diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset_py3.py index 02f8eb36cb64..7ccb79537f8b 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset_py3.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset_py3.py @@ -26,11 +26,11 @@ class ReportConfigDataset(Model): ~azure.mgmt.costmanagement.models.ReportConfigDatasetConfiguration :param aggregation: Dictionary of aggregation expression to use in the report. The key of each item in the dictionary is the alias for the - aggregated column. Report can have upto 2 aggregation clauses. + aggregated column. Report can have up to 2 aggregation clauses. :type aggregation: dict[str, ~azure.mgmt.costmanagement.models.ReportConfigAggregation] :param grouping: Array of group by expression to use in the report. Report - can have upto 2 group by clauses. + can have up to 2 group by clauses. :type grouping: list[~azure.mgmt.costmanagement.models.ReportConfigGrouping] :param filter: Has filter expression to use in the report. diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_filter.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_filter.py index 28cfde2c4e62..9802f5634ccc 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_filter.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_filter.py @@ -15,11 +15,11 @@ class ReportConfigFilter(Model): """The filter expression to be used in the report. - :param and_property: The logical "AND" expression. Must have atleast 2 + :param and_property: The logical "AND" expression. Must have at least 2 items. :type and_property: list[~azure.mgmt.costmanagement.models.ReportConfigFilter] - :param or_property: The logical "OR" expression. Must have atleast 2 + :param or_property: The logical "OR" expression. Must have at least 2 items. :type or_property: list[~azure.mgmt.costmanagement.models.ReportConfigFilter] diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_filter_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_filter_py3.py index 2cbd1466c50c..43521afa34eb 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_filter_py3.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_filter_py3.py @@ -15,11 +15,11 @@ class ReportConfigFilter(Model): """The filter expression to be used in the report. - :param and_property: The logical "AND" expression. Must have atleast 2 + :param and_property: The logical "AND" expression. Must have at least 2 items. :type and_property: list[~azure.mgmt.costmanagement.models.ReportConfigFilter] - :param or_property: The logical "OR" expression. Must have atleast 2 + :param or_property: The logical "OR" expression. Must have at least 2 items. :type or_property: list[~azure.mgmt.costmanagement.models.ReportConfigFilter] diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/billing_account_dimensions_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/billing_account_dimensions_operations.py index 46155cdb1698..4ef732e976ed 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/billing_account_dimensions_operations.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/billing_account_dimensions_operations.py @@ -47,7 +47,7 @@ def list( Supported operators are 'eq','lt', 'gt', 'le', 'ge'. :type filter: str :param expand: May be used to expand the properties/data within a - dimension dategory. By default, data is not included when listing + dimension category. By default, data is not included when listing dimensions. :type expand: str :param skiptoken: Skiptoken is only used if a previous operation diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/resource_group_dimensions_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/resource_group_dimensions_operations.py index ed8950494a63..ed03023fd3bd 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/resource_group_dimensions_operations.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/resource_group_dimensions_operations.py @@ -47,7 +47,7 @@ def list( Supported operators are 'eq','lt', 'gt', 'le', 'ge'. :type filter: str :param expand: May be used to expand the properties/data within a - dimension dategory. By default, data is not included when listing + dimension category. By default, data is not included when listing dimensions. :type expand: str :param skiptoken: Skiptoken is only used if a previous operation diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/subscription_dimensions_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/subscription_dimensions_operations.py index a49658d4b763..6bdbde4f71ed 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/subscription_dimensions_operations.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/subscription_dimensions_operations.py @@ -45,7 +45,7 @@ def list( Supported operators are 'eq','lt', 'gt', 'le', 'ge'. :type filter: str :param expand: May be used to expand the properties/data within a - dimension dategory. By default, data is not included when listing + dimension category. By default, data is not included when listing dimensions. :type expand: str :param skiptoken: Skiptoken is only used if a previous operation From 02d8f52f00b5dfd0f4f4510a2380176df08abe52 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 17 Jan 2019 13:02:45 -0800 Subject: [PATCH 06/14] Generated from 855ab2ed573e2d8fe8a65f8a8e638e8a9b033759 (#4202) Suppress OperationsAPIImplementation error for Microsoft.Billing --- .../costmanagement/cost_management_client.py | 269 +------- .../mgmt/costmanagement/models/__init__.py | 65 +- .../models/connector_collection_error_info.py | 51 ++ .../connector_collection_error_info_py3.py | 51 ++ .../models/connector_collection_info.py | 52 ++ .../models/connector_collection_info_py3.py | 52 ++ .../models/connector_definition.py | 112 ++++ .../models/connector_definition_paged.py | 27 + .../models/connector_definition_py3.py | 112 ++++ .../models/cost_management_client_enums.py | 39 +- .../mgmt/costmanagement/models/dimension.py | 12 + .../costmanagement/models/dimension_py3.py | 14 +- .../mgmt/costmanagement/models/entity_info.py | 102 ++++ .../models/entity_info_paged.py | 27 + .../costmanagement/models/entity_info_py3.py | 102 ++++ ..._result.py => entity_parent_group_info.py} | 24 +- .../models/entity_parent_group_info_py3.py | 30 + .../mgmt/costmanagement/models/error_base.py | 46 ++ ...g_list_result_py3.py => error_base_py3.py} | 28 +- .../costmanagement/models/error_details.py | 13 +- .../models/error_details_py3.py | 15 +- .../external_billing_account_definition.py | 60 ++ ...ternal_billing_account_definition_paged.py | 27 + ...external_billing_account_definition_py3.py | 60 ++ .../external_subscription_definition.py | 65 ++ .../external_subscription_definition_paged.py | 27 + .../external_subscription_definition_py3.py | 65 ++ .../costmanagement/models/report_config.py | 69 --- .../report_config_comparison_expression.py | 14 +- ...report_config_comparison_expression_py3.py | 16 +- .../models/report_config_dataset.py | 6 +- .../models/report_config_dataset_py3.py | 8 +- .../models/report_config_definition.py | 5 +- .../models/report_config_definition_py3.py | 5 +- .../report_config_delivery_destination.py | 46 -- .../report_config_delivery_destination_py3.py | 46 -- .../models/report_config_delivery_info_py3.py | 36 -- .../models/report_config_grouping.py | 15 +- .../models/report_config_grouping_py3.py | 17 +- .../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 -- ...ivery_info.py => report_config_sorting.py} | 23 +- .../models/report_config_sorting_py3.py | 39 ++ .../costmanagement/operations/__init__.py | 22 +- .../billing_account_dimensions_operations.py | 126 ---- .../operations/cloud_connector_operations.py | 334 ++++++++++ .../operations/dimensions_operations.py | 576 ++++++++++++++++++ ...s_operations.py => entities_operations.py} | 67 +- .../external_billing_account_operations.py | 156 +++++ .../external_subscription_operations.py | 339 +++++++++++ .../operations/forecast_operations.py | 480 +++++++++++++++ .../costmanagement/operations/operations.py | 4 +- .../operations/query_operations.py | 480 +++++++++++++++ .../operations/report_config_operations.py | 514 ---------------- .../resource_group_dimensions_operations.py | 127 ---- 58 files changed, 3745 insertions(+), 1617 deletions(-) create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_error_info.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_error_info_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_info.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_info_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_definition.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_definition_paged.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_definition_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_info.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_info_paged.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_info_py3.py rename azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/{report_config_list_result.py => entity_parent_group_info.py} (50%) create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_parent_group_info_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_base.py rename azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/{report_config_list_result_py3.py => error_base_py3.py} (50%) create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_billing_account_definition.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_billing_account_definition_paged.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_billing_account_definition_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_subscription_definition.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_subscription_definition_paged.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_subscription_definition_py3.py 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_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 rename azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/{report_config_delivery_info.py => report_config_sorting.py} (52%) create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_sorting_py3.py delete mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/billing_account_dimensions_operations.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/cloud_connector_operations.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/dimensions_operations.py rename azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/{subscription_dimensions_operations.py => entities_operations.py} (53%) create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/external_billing_account_operations.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/external_subscription_operations.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/forecast_operations.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/query_operations.py delete mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/report_config_operations.py delete mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/resource_group_dimensions_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 1ac9432eb07e..7c6ed75c6e33 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/cost_management_client.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/cost_management_client.py @@ -13,12 +13,13 @@ from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration 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 +from .operations.dimensions_operations import DimensionsOperations +from .operations.query_operations import QueryOperations +from .operations.forecast_operations import ForecastOperations +from .operations.cloud_connector_operations import CloudConnectorOperations +from .operations.external_billing_account_operations import ExternalBillingAccountOperations +from .operations.external_subscription_operations import ExternalSubscriptionOperations +from .operations.entities_operations import EntitiesOperations from .operations.operations import Operations from . import models @@ -61,14 +62,20 @@ 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 - :vartype subscription_dimensions: azure.mgmt.costmanagement.operations.SubscriptionDimensionsOperations - :ivar resource_group_dimensions: ResourceGroupDimensions operations - :vartype resource_group_dimensions: azure.mgmt.costmanagement.operations.ResourceGroupDimensionsOperations + :ivar dimensions: Dimensions operations + :vartype dimensions: azure.mgmt.costmanagement.operations.DimensionsOperations + :ivar query: Query operations + :vartype query: azure.mgmt.costmanagement.operations.QueryOperations + :ivar forecast: Forecast operations + :vartype forecast: azure.mgmt.costmanagement.operations.ForecastOperations + :ivar cloud_connector: CloudConnector operations + :vartype cloud_connector: azure.mgmt.costmanagement.operations.CloudConnectorOperations + :ivar external_billing_account: ExternalBillingAccount operations + :vartype external_billing_account: azure.mgmt.costmanagement.operations.ExternalBillingAccountOperations + :ivar external_subscription: ExternalSubscription operations + :vartype external_subscription: azure.mgmt.costmanagement.operations.ExternalSubscriptionOperations + :ivar entities: Entities operations + :vartype entities: azure.mgmt.costmanagement.operations.EntitiesOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.costmanagement.operations.Operations @@ -87,235 +94,23 @@ def __init__( super(CostManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2018-05-31' + self.api_version = '2019-03-01-preview' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) - self.report_config = ReportConfigOperations( + self.dimensions = DimensionsOperations( self._client, self.config, self._serialize, self._deserialize) - self.billing_account_dimensions = BillingAccountDimensionsOperations( + self.query = QueryOperations( self._client, self.config, self._serialize, self._deserialize) - self.subscription_dimensions = SubscriptionDimensionsOperations( + self.forecast = ForecastOperations( self._client, self.config, self._serialize, self._deserialize) - self.resource_group_dimensions = ResourceGroupDimensionsOperations( + self.cloud_connector = CloudConnectorOperations( + self._client, self.config, self._serialize, self._deserialize) + self.external_billing_account = ExternalBillingAccountOperations( + self._client, self.config, self._serialize, self._deserialize) + self.external_subscription = ExternalSubscriptionOperations( + self._client, self.config, self._serialize, self._deserialize) + self.entities = EntitiesOperations( self._client, self.config, self._serialize, self._deserialize) self.operations = Operations( self._client, self.config, self._serialize, self._deserialize) - - def query_subscription( - self, parameters, custom_headers=None, raw=False, **operation_config): - """Lists the usage data for subscriptionId. - - :param parameters: Parameters supplied to the CreateOrUpdate Report - Config operation. - :type parameters: - ~azure.mgmt.costmanagement.models.ReportConfigDefinition - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Query - :rtype: - ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.query_subscription.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') - - else: - url = next_link - query_parameters = {} - - # 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, 'ReportConfigDefinition') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - query_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CostManagement/Query'} - - def query_resource_group( - self, resource_group_name, parameters, custom_headers=None, raw=False, **operation_config): - """Lists the usage data for subscriptionId and resource group. - - :param resource_group_name: Azure Resource Group Name. - :type resource_group_name: str - :param parameters: Parameters supplied to the CreateOrUpdate Report - Config operation. - :type parameters: - ~azure.mgmt.costmanagement.models.ReportConfigDefinition - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Query - :rtype: - ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.query_resource_group.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') - - else: - url = next_link - query_parameters = {} - - # 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, 'ReportConfigDefinition') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - query_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.CostManagement/Query'} - - def query_billing_account( - self, billing_account_id, parameters, custom_headers=None, raw=False, **operation_config): - """Lists the usage data for billing account. - - :param billing_account_id: BillingAccount ID - :type billing_account_id: str - :param parameters: Parameters supplied to the CreateOrUpdate Report - Config operation. - :type parameters: - ~azure.mgmt.costmanagement.models.ReportConfigDefinition - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Query - :rtype: - ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.query_billing_account.metadata['url'] - path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # 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, 'ReportConfigDefinition') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - query_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/Query'} diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py index 71b14053e1a6..7e3edca4af5e 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py @@ -10,93 +10,110 @@ # -------------------------------------------------------------------------- try: + from .error_base_py3 import ErrorBase 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 from .report_config_grouping_py3 import ReportConfigGrouping + from .report_config_sorting_py3 import ReportConfigSorting from .report_config_comparison_expression_py3 import ReportConfigComparisonExpression 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 + from .connector_collection_error_info_py3 import ConnectorCollectionErrorInfo + from .connector_collection_info_py3 import ConnectorCollectionInfo + from .connector_definition_py3 import ConnectorDefinition + from .external_billing_account_definition_py3 import ExternalBillingAccountDefinition + from .external_subscription_definition_py3 import ExternalSubscriptionDefinition + from .entity_parent_group_info_py3 import EntityParentGroupInfo + from .entity_info_py3 import EntityInfo from .operation_display_py3 import OperationDisplay from .operation_py3 import Operation except (SyntaxError, ImportError): + from .error_base import ErrorBase 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 from .report_config_grouping import ReportConfigGrouping + from .report_config_sorting import ReportConfigSorting from .report_config_comparison_expression import ReportConfigComparisonExpression 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 .connector_collection_error_info import ConnectorCollectionErrorInfo + from .connector_collection_info import ConnectorCollectionInfo + from .connector_definition import ConnectorDefinition + from .external_billing_account_definition import ExternalBillingAccountDefinition + from .external_subscription_definition import ExternalSubscriptionDefinition + from .entity_parent_group_info import EntityParentGroupInfo + from .entity_info import EntityInfo from .operation_display import OperationDisplay from .operation import Operation from .dimension_paged import DimensionPaged from .query_paged import QueryPaged +from .connector_definition_paged import ConnectorDefinitionPaged +from .external_billing_account_definition_paged import ExternalBillingAccountDefinitionPaged +from .external_subscription_definition_paged import ExternalSubscriptionDefinitionPaged +from .entity_info_paged import EntityInfoPaged from .operation_paged import OperationPaged from .cost_management_client_enums import ( - StatusType, - RecurrenceType, - FormatType, TimeframeType, GranularityType, ReportConfigColumnType, + OperatorType, + ConnectorStatus, + ConnectorBillingModel, ) __all__ = [ + 'ErrorBase', 'ErrorDetails', 'ErrorResponse', 'ErrorResponseException', 'Resource', - 'ReportConfigRecurrencePeriod', - 'ReportConfigSchedule', - 'ReportConfigDeliveryDestination', - 'ReportConfigDeliveryInfo', 'ReportConfigTimePeriod', 'ReportConfigDatasetConfiguration', 'ReportConfigAggregation', 'ReportConfigGrouping', + 'ReportConfigSorting', 'ReportConfigComparisonExpression', 'ReportConfigFilter', 'ReportConfigDataset', 'ReportConfigDefinition', - 'ReportConfig', - 'ReportConfigListResult', 'Dimension', 'QueryColumn', 'Query', + 'ConnectorCollectionErrorInfo', + 'ConnectorCollectionInfo', + 'ConnectorDefinition', + 'ExternalBillingAccountDefinition', + 'ExternalSubscriptionDefinition', + 'EntityParentGroupInfo', + 'EntityInfo', 'OperationDisplay', 'Operation', 'DimensionPaged', 'QueryPaged', + 'ConnectorDefinitionPaged', + 'ExternalBillingAccountDefinitionPaged', + 'ExternalSubscriptionDefinitionPaged', + 'EntityInfoPaged', 'OperationPaged', - 'StatusType', - 'RecurrenceType', - 'FormatType', 'TimeframeType', 'GranularityType', 'ReportConfigColumnType', + 'OperatorType', + 'ConnectorStatus', + 'ConnectorBillingModel', ] diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_error_info.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_error_info.py new file mode 100644 index 000000000000..74d4eb5288f1 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_error_info.py @@ -0,0 +1,51 @@ +# 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 ConnectorCollectionErrorInfo(Model): + """Details of any error encountered on last collection attempt. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar error_message: Detailed error message + :vartype error_message: str + :ivar error_inner_message: External Provider error message + :vartype error_inner_message: str + :ivar error_code: Short error code + :vartype error_code: str + :ivar error_start_time: Time the error started occurring (Last time error + occurred in lastChecked) + :vartype error_start_time: datetime + """ + + _validation = { + 'error_message': {'readonly': True}, + 'error_inner_message': {'readonly': True}, + 'error_code': {'readonly': True}, + 'error_start_time': {'readonly': True}, + } + + _attribute_map = { + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + 'error_inner_message': {'key': 'errorInnerMessage', 'type': 'str'}, + 'error_code': {'key': 'errorCode', 'type': 'str'}, + 'error_start_time': {'key': 'errorStartTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(ConnectorCollectionErrorInfo, self).__init__(**kwargs) + self.error_message = None + self.error_inner_message = None + self.error_code = None + self.error_start_time = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_error_info_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_error_info_py3.py new file mode 100644 index 000000000000..8d26ae24a8ca --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_error_info_py3.py @@ -0,0 +1,51 @@ +# 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 ConnectorCollectionErrorInfo(Model): + """Details of any error encountered on last collection attempt. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar error_message: Detailed error message + :vartype error_message: str + :ivar error_inner_message: External Provider error message + :vartype error_inner_message: str + :ivar error_code: Short error code + :vartype error_code: str + :ivar error_start_time: Time the error started occurring (Last time error + occurred in lastChecked) + :vartype error_start_time: datetime + """ + + _validation = { + 'error_message': {'readonly': True}, + 'error_inner_message': {'readonly': True}, + 'error_code': {'readonly': True}, + 'error_start_time': {'readonly': True}, + } + + _attribute_map = { + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + 'error_inner_message': {'key': 'errorInnerMessage', 'type': 'str'}, + 'error_code': {'key': 'errorCode', 'type': 'str'}, + 'error_start_time': {'key': 'errorStartTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs) -> None: + super(ConnectorCollectionErrorInfo, self).__init__(**kwargs) + self.error_message = None + self.error_inner_message = None + self.error_code = None + self.error_start_time = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_info.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_info.py new file mode 100644 index 000000000000..ad4397017060 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_info.py @@ -0,0 +1,52 @@ +# 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 ConnectorCollectionInfo(Model): + """Collection and ingestion information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar last_checked: Last time the data acquisition process initiated + connecting to the external provider + :vartype last_checked: datetime + :ivar source_last_updated: Source timestamp of external data currently + available in Azure (eg AWS last processed CUR file timestamp) + :vartype source_last_updated: datetime + :ivar last_updated: Last time the external data was updated into Azure + :vartype last_updated: datetime + :param error: Error information of last collection + :type error: + ~azure.mgmt.costmanagement.models.ConnectorCollectionErrorInfo + """ + + _validation = { + 'last_checked': {'readonly': True}, + 'source_last_updated': {'readonly': True}, + 'last_updated': {'readonly': True}, + } + + _attribute_map = { + 'last_checked': {'key': 'lastChecked', 'type': 'iso-8601'}, + 'source_last_updated': {'key': 'sourceLastUpdated', 'type': 'iso-8601'}, + 'last_updated': {'key': 'lastUpdated', 'type': 'iso-8601'}, + 'error': {'key': 'error', 'type': 'ConnectorCollectionErrorInfo'}, + } + + def __init__(self, **kwargs): + super(ConnectorCollectionInfo, self).__init__(**kwargs) + self.last_checked = None + self.source_last_updated = None + self.last_updated = None + self.error = kwargs.get('error', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_info_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_info_py3.py new file mode 100644 index 000000000000..ce4cfe464f52 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_info_py3.py @@ -0,0 +1,52 @@ +# 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 ConnectorCollectionInfo(Model): + """Collection and ingestion information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar last_checked: Last time the data acquisition process initiated + connecting to the external provider + :vartype last_checked: datetime + :ivar source_last_updated: Source timestamp of external data currently + available in Azure (eg AWS last processed CUR file timestamp) + :vartype source_last_updated: datetime + :ivar last_updated: Last time the external data was updated into Azure + :vartype last_updated: datetime + :param error: Error information of last collection + :type error: + ~azure.mgmt.costmanagement.models.ConnectorCollectionErrorInfo + """ + + _validation = { + 'last_checked': {'readonly': True}, + 'source_last_updated': {'readonly': True}, + 'last_updated': {'readonly': True}, + } + + _attribute_map = { + 'last_checked': {'key': 'lastChecked', 'type': 'iso-8601'}, + 'source_last_updated': {'key': 'sourceLastUpdated', 'type': 'iso-8601'}, + 'last_updated': {'key': 'lastUpdated', 'type': 'iso-8601'}, + 'error': {'key': 'error', 'type': 'ConnectorCollectionErrorInfo'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(ConnectorCollectionInfo, self).__init__(**kwargs) + self.last_checked = None + self.source_last_updated = None + self.last_updated = None + self.error = error diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_definition.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_definition.py new file mode 100644 index 000000000000..1c52fbbed1a0 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_definition.py @@ -0,0 +1,112 @@ +# 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 ConnectorDefinition(Model): + """The Connector model definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param kind: Connector kind (eg aws) + :type kind: str + :ivar id: Connector id + :vartype id: str + :ivar name: Connector name + :vartype name: str + :ivar type: Connector type + :vartype type: str + :param display_name: Connector DisplayName + :type display_name: str + :ivar provider_account_id: Connector providerAccountId (determined from + credentials) + :vartype provider_account_id: str + :param credentials_key: Credentials authentication key (eg AWS ARN) + :type credentials_key: str + :param credentials_secret: Credentials secret (eg AWS ExternalId) + :type credentials_secret: str + :param report_id: Identifying source report. (For AWS this is a CUR report + name, defined with Daily and with Resources) + :type report_id: str + :ivar created_on: Connector definition creation datetime + :vartype created_on: datetime + :ivar modified_on: Connector last modified datetime + :vartype modified_on: datetime + :param status: Connector status. Possible values include: 'active', + 'error', 'suspended' + :type status: str or ~azure.mgmt.costmanagement.models.ConnectorStatus + :param default_management_group_id: Default ManagementGroupId + :type default_management_group_id: str + :param subscription_id: Billing SubscriptionId + :type subscription_id: str + :param billing_model: Connector billing model. Possible values include: + 'trial', 'autoUpgrade', 'premium', 'expired' + :type billing_model: str or + ~azure.mgmt.costmanagement.models.ConnectorBillingModel + :ivar days_trial_remaining: Number of days remaining of trial + :vartype days_trial_remaining: int + :ivar collection_info: Collection information + :vartype collection_info: + ~azure.mgmt.costmanagement.models.ConnectorCollectionInfo + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provider_account_id': {'readonly': True}, + 'created_on': {'readonly': True}, + 'modified_on': {'readonly': True}, + 'days_trial_remaining': {'readonly': True}, + 'collection_info': {'readonly': True}, + } + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'provider_account_id': {'key': 'properties.providerAccountId', 'type': 'str'}, + 'credentials_key': {'key': 'properties.credentialsKey', 'type': 'str'}, + 'credentials_secret': {'key': 'properties.credentialsSecret', 'type': 'str'}, + 'report_id': {'key': 'properties.reportId', 'type': 'str'}, + 'created_on': {'key': 'properties.createdOn', 'type': 'iso-8601'}, + 'modified_on': {'key': 'properties.modifiedOn', 'type': 'iso-8601'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'default_management_group_id': {'key': 'properties.defaultManagementGroupId', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + 'billing_model': {'key': 'properties.billingModel', 'type': 'str'}, + 'days_trial_remaining': {'key': 'properties.daysTrialRemaining', 'type': 'int'}, + 'collection_info': {'key': 'properties.collectionInfo', 'type': 'ConnectorCollectionInfo'}, + } + + def __init__(self, **kwargs): + super(ConnectorDefinition, self).__init__(**kwargs) + self.kind = kwargs.get('kind', None) + self.id = None + self.name = None + self.type = None + self.display_name = kwargs.get('display_name', None) + self.provider_account_id = None + self.credentials_key = kwargs.get('credentials_key', None) + self.credentials_secret = kwargs.get('credentials_secret', None) + self.report_id = kwargs.get('report_id', None) + self.created_on = None + self.modified_on = None + self.status = kwargs.get('status', None) + self.default_management_group_id = kwargs.get('default_management_group_id', None) + self.subscription_id = kwargs.get('subscription_id', None) + self.billing_model = kwargs.get('billing_model', None) + self.days_trial_remaining = None + self.collection_info = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_definition_paged.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_definition_paged.py new file mode 100644 index 000000000000..23e223c92208 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_definition_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class ConnectorDefinitionPaged(Paged): + """ + A paging container for iterating over a list of :class:`ConnectorDefinition ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ConnectorDefinition]'} + } + + def __init__(self, *args, **kwargs): + + super(ConnectorDefinitionPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_definition_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_definition_py3.py new file mode 100644 index 000000000000..39c96d302e55 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_definition_py3.py @@ -0,0 +1,112 @@ +# 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 ConnectorDefinition(Model): + """The Connector model definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param kind: Connector kind (eg aws) + :type kind: str + :ivar id: Connector id + :vartype id: str + :ivar name: Connector name + :vartype name: str + :ivar type: Connector type + :vartype type: str + :param display_name: Connector DisplayName + :type display_name: str + :ivar provider_account_id: Connector providerAccountId (determined from + credentials) + :vartype provider_account_id: str + :param credentials_key: Credentials authentication key (eg AWS ARN) + :type credentials_key: str + :param credentials_secret: Credentials secret (eg AWS ExternalId) + :type credentials_secret: str + :param report_id: Identifying source report. (For AWS this is a CUR report + name, defined with Daily and with Resources) + :type report_id: str + :ivar created_on: Connector definition creation datetime + :vartype created_on: datetime + :ivar modified_on: Connector last modified datetime + :vartype modified_on: datetime + :param status: Connector status. Possible values include: 'active', + 'error', 'suspended' + :type status: str or ~azure.mgmt.costmanagement.models.ConnectorStatus + :param default_management_group_id: Default ManagementGroupId + :type default_management_group_id: str + :param subscription_id: Billing SubscriptionId + :type subscription_id: str + :param billing_model: Connector billing model. Possible values include: + 'trial', 'autoUpgrade', 'premium', 'expired' + :type billing_model: str or + ~azure.mgmt.costmanagement.models.ConnectorBillingModel + :ivar days_trial_remaining: Number of days remaining of trial + :vartype days_trial_remaining: int + :ivar collection_info: Collection information + :vartype collection_info: + ~azure.mgmt.costmanagement.models.ConnectorCollectionInfo + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provider_account_id': {'readonly': True}, + 'created_on': {'readonly': True}, + 'modified_on': {'readonly': True}, + 'days_trial_remaining': {'readonly': True}, + 'collection_info': {'readonly': True}, + } + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'provider_account_id': {'key': 'properties.providerAccountId', 'type': 'str'}, + 'credentials_key': {'key': 'properties.credentialsKey', 'type': 'str'}, + 'credentials_secret': {'key': 'properties.credentialsSecret', 'type': 'str'}, + 'report_id': {'key': 'properties.reportId', 'type': 'str'}, + 'created_on': {'key': 'properties.createdOn', 'type': 'iso-8601'}, + 'modified_on': {'key': 'properties.modifiedOn', 'type': 'iso-8601'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'default_management_group_id': {'key': 'properties.defaultManagementGroupId', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + 'billing_model': {'key': 'properties.billingModel', 'type': 'str'}, + 'days_trial_remaining': {'key': 'properties.daysTrialRemaining', 'type': 'int'}, + 'collection_info': {'key': 'properties.collectionInfo', 'type': 'ConnectorCollectionInfo'}, + } + + def __init__(self, *, kind: str=None, display_name: str=None, credentials_key: str=None, credentials_secret: str=None, report_id: str=None, status=None, default_management_group_id: str=None, subscription_id: str=None, billing_model=None, **kwargs) -> None: + super(ConnectorDefinition, self).__init__(**kwargs) + self.kind = kind + self.id = None + self.name = None + self.type = None + self.display_name = display_name + self.provider_account_id = None + self.credentials_key = credentials_key + self.credentials_secret = credentials_secret + self.report_id = report_id + self.created_on = None + self.modified_on = None + self.status = status + self.default_management_group_id = default_management_group_id + self.subscription_id = subscription_id + self.billing_model = billing_model + self.days_trial_remaining = None + self.collection_info = None 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..24088511f298 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,39 +12,42 @@ from enum import Enum -class StatusType(str, Enum): +class TimeframeType(str, Enum): - active = "Active" - inactive = "Inactive" + week_to_date = "WeekToDate" + month_to_date = "MonthToDate" + year_to_date = "YearToDate" + custom = "Custom" -class RecurrenceType(str, Enum): +class GranularityType(str, Enum): daily = "Daily" - weekly = "Weekly" monthly = "Monthly" - annually = "Annually" -class FormatType(str, Enum): +class ReportConfigColumnType(str, Enum): - csv = "Csv" + tag = "Tag" + dimension = "Dimension" -class TimeframeType(str, Enum): +class OperatorType(str, Enum): - week_to_date = "WeekToDate" - month_to_date = "MonthToDate" - year_to_date = "YearToDate" - custom = "Custom" + in_enum = "In" + contains = "Contains" -class GranularityType(str, Enum): +class ConnectorStatus(str, Enum): - daily = "Daily" + active = "active" + error = "error" + suspended = "suspended" -class ReportConfigColumnType(str, Enum): +class ConnectorBillingModel(str, Enum): - tag = "Tag" - dimension = "Dimension" + trial = "trial" + auto_upgrade = "autoUpgrade" + premium = "premium" + expired = "expired" diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/dimension.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/dimension.py index 78b3834a8f90..8a54c783616d 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/dimension.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/dimension.py @@ -26,6 +26,12 @@ class Dimension(Resource): :vartype type: str :ivar tags: Resource tags. :vartype tags: dict[str, str] + :param description: + :type description: str + :param filter_enabled: + :type filter_enabled: bool + :param grouping_enabled: + :type grouping_enabled: bool :param data: :type data: list[str] :param total: @@ -52,6 +58,9 @@ class Dimension(Resource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'filter_enabled': {'key': 'properties.filterEnabled', 'type': 'bool'}, + 'grouping_enabled': {'key': 'properties.groupingEnabled', 'type': 'bool'}, 'data': {'key': 'properties.data', 'type': '[str]'}, 'total': {'key': 'properties.total', 'type': 'int'}, 'category': {'key': 'properties.category', 'type': 'str'}, @@ -62,6 +71,9 @@ class Dimension(Resource): def __init__(self, **kwargs): super(Dimension, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.filter_enabled = kwargs.get('filter_enabled', None) + self.grouping_enabled = kwargs.get('grouping_enabled', None) self.data = kwargs.get('data', None) self.total = kwargs.get('total', None) self.category = kwargs.get('category', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/dimension_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/dimension_py3.py index b1c8674f0194..ae7f8d7ca51f 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/dimension_py3.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/dimension_py3.py @@ -26,6 +26,12 @@ class Dimension(Resource): :vartype type: str :ivar tags: Resource tags. :vartype tags: dict[str, str] + :param description: + :type description: str + :param filter_enabled: + :type filter_enabled: bool + :param grouping_enabled: + :type grouping_enabled: bool :param data: :type data: list[str] :param total: @@ -52,6 +58,9 @@ class Dimension(Resource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'filter_enabled': {'key': 'properties.filterEnabled', 'type': 'bool'}, + 'grouping_enabled': {'key': 'properties.groupingEnabled', 'type': 'bool'}, 'data': {'key': 'properties.data', 'type': '[str]'}, 'total': {'key': 'properties.total', 'type': 'int'}, 'category': {'key': 'properties.category', 'type': 'str'}, @@ -60,8 +69,11 @@ class Dimension(Resource): 'next_link': {'key': 'properties.nextLink', 'type': 'str'}, } - def __init__(self, *, data=None, total: int=None, category: str=None, usage_start=None, usage_end=None, next_link: str=None, **kwargs) -> None: + def __init__(self, *, description: str=None, filter_enabled: bool=None, grouping_enabled: bool=None, data=None, total: int=None, category: str=None, usage_start=None, usage_end=None, next_link: str=None, **kwargs) -> None: super(Dimension, self).__init__(**kwargs) + self.description = description + self.filter_enabled = filter_enabled + self.grouping_enabled = grouping_enabled self.data = data self.total = total self.category = category diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_info.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_info.py new file mode 100644 index 000000000000..996a86f4e81d --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_info.py @@ -0,0 +1,102 @@ +# 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 EntityInfo(Model): + """The entity. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The fully qualified ID for the entity. For example, + /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + :vartype id: str + :ivar type: The type of the resource. For example, + /providers/Microsoft.Management/managementGroups + :vartype type: str + :ivar name: The name of the entity. For example, + 00000000-0000-0000-0000-000000000000 + :vartype name: str + :ivar kind: The kind of the resource + :vartype kind: str + :param tenant_id: The AAD Tenant ID associated with the entity. For + example, 00000000-0000-0000-0000-000000000000 + :type tenant_id: str + :param display_name: The friendly name of the management group. + :type display_name: str + :param parent: Parent. + :type parent: ~azure.mgmt.costmanagement.models.EntityParentGroupInfo + :param permissions: Permissions. Possible values include: 'noaccess', + 'view', 'edit', 'delete' + :type permissions: str or ~azure.mgmt.costmanagement.models.enum + :param inherited_permissions: Inherited Permissions. Possible values + include: 'noaccess', 'view', 'edit', 'delete' + :type inherited_permissions: str or ~azure.mgmt.costmanagement.models.enum + :param number_of_descendants: Number of Descendants. + :type number_of_descendants: int + :param number_of_children: Number of Children. Number of children is the + number of Groups and Subscriptions that are exactly one level underneath + the current Group. + :type number_of_children: int + :param number_of_child_groups: Number of Child Groups. Number of child + groups is the number of Groups that are exactly one level underneath the + current Group. + :type number_of_child_groups: int + :param parent_display_name_chain: The parent display name chain from the + root group to the immediate parent + :type parent_display_name_chain: list[str] + :param parent_name_chain: The parent name chain from the root group to the + immediate parent + :type parent_name_chain: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'parent': {'key': 'properties.parent', 'type': 'EntityParentGroupInfo'}, + 'permissions': {'key': 'properties.permissions', 'type': 'str'}, + 'inherited_permissions': {'key': 'properties.inheritedPermissions', 'type': 'str'}, + 'number_of_descendants': {'key': 'properties.numberOfDescendants', 'type': 'int'}, + 'number_of_children': {'key': 'properties.numberOfChildren', 'type': 'int'}, + 'number_of_child_groups': {'key': 'properties.numberOfChildGroups', 'type': 'int'}, + 'parent_display_name_chain': {'key': 'properties.parentDisplayNameChain', 'type': '[str]'}, + 'parent_name_chain': {'key': 'properties.parentNameChain', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(EntityInfo, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.kind = None + self.tenant_id = kwargs.get('tenant_id', None) + self.display_name = kwargs.get('display_name', None) + self.parent = kwargs.get('parent', None) + self.permissions = kwargs.get('permissions', None) + self.inherited_permissions = kwargs.get('inherited_permissions', None) + self.number_of_descendants = kwargs.get('number_of_descendants', None) + self.number_of_children = kwargs.get('number_of_children', None) + self.number_of_child_groups = kwargs.get('number_of_child_groups', None) + self.parent_display_name_chain = kwargs.get('parent_display_name_chain', None) + self.parent_name_chain = kwargs.get('parent_name_chain', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_info_paged.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_info_paged.py new file mode 100644 index 000000000000..d7a741cef532 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_info_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class EntityInfoPaged(Paged): + """ + A paging container for iterating over a list of :class:`EntityInfo ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[EntityInfo]'} + } + + def __init__(self, *args, **kwargs): + + super(EntityInfoPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_info_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_info_py3.py new file mode 100644 index 000000000000..7f44120d0fd9 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_info_py3.py @@ -0,0 +1,102 @@ +# 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 EntityInfo(Model): + """The entity. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The fully qualified ID for the entity. For example, + /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + :vartype id: str + :ivar type: The type of the resource. For example, + /providers/Microsoft.Management/managementGroups + :vartype type: str + :ivar name: The name of the entity. For example, + 00000000-0000-0000-0000-000000000000 + :vartype name: str + :ivar kind: The kind of the resource + :vartype kind: str + :param tenant_id: The AAD Tenant ID associated with the entity. For + example, 00000000-0000-0000-0000-000000000000 + :type tenant_id: str + :param display_name: The friendly name of the management group. + :type display_name: str + :param parent: Parent. + :type parent: ~azure.mgmt.costmanagement.models.EntityParentGroupInfo + :param permissions: Permissions. Possible values include: 'noaccess', + 'view', 'edit', 'delete' + :type permissions: str or ~azure.mgmt.costmanagement.models.enum + :param inherited_permissions: Inherited Permissions. Possible values + include: 'noaccess', 'view', 'edit', 'delete' + :type inherited_permissions: str or ~azure.mgmt.costmanagement.models.enum + :param number_of_descendants: Number of Descendants. + :type number_of_descendants: int + :param number_of_children: Number of Children. Number of children is the + number of Groups and Subscriptions that are exactly one level underneath + the current Group. + :type number_of_children: int + :param number_of_child_groups: Number of Child Groups. Number of child + groups is the number of Groups that are exactly one level underneath the + current Group. + :type number_of_child_groups: int + :param parent_display_name_chain: The parent display name chain from the + root group to the immediate parent + :type parent_display_name_chain: list[str] + :param parent_name_chain: The parent name chain from the root group to the + immediate parent + :type parent_name_chain: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'parent': {'key': 'properties.parent', 'type': 'EntityParentGroupInfo'}, + 'permissions': {'key': 'properties.permissions', 'type': 'str'}, + 'inherited_permissions': {'key': 'properties.inheritedPermissions', 'type': 'str'}, + 'number_of_descendants': {'key': 'properties.numberOfDescendants', 'type': 'int'}, + 'number_of_children': {'key': 'properties.numberOfChildren', 'type': 'int'}, + 'number_of_child_groups': {'key': 'properties.numberOfChildGroups', 'type': 'int'}, + 'parent_display_name_chain': {'key': 'properties.parentDisplayNameChain', 'type': '[str]'}, + 'parent_name_chain': {'key': 'properties.parentNameChain', 'type': '[str]'}, + } + + def __init__(self, *, tenant_id: str=None, display_name: str=None, parent=None, permissions=None, inherited_permissions=None, number_of_descendants: int=None, number_of_children: int=None, number_of_child_groups: int=None, parent_display_name_chain=None, parent_name_chain=None, **kwargs) -> None: + super(EntityInfo, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.kind = None + self.tenant_id = tenant_id + self.display_name = display_name + self.parent = parent + self.permissions = permissions + self.inherited_permissions = inherited_permissions + self.number_of_descendants = number_of_descendants + self.number_of_children = number_of_children + self.number_of_child_groups = number_of_child_groups + self.parent_display_name_chain = parent_display_name_chain + self.parent_name_chain = parent_name_chain diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_list_result.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_parent_group_info.py similarity index 50% rename from azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_list_result.py rename to azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_parent_group_info.py index 9299cb815d0f..7e26dca6f12c 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_list_result.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_parent_group_info.py @@ -12,25 +12,19 @@ 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. +class EntityParentGroupInfo(Model): + """(Optional) The ID of the parent management group. - 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] + :param id: The fully qualified ID for the parent management group. For + example, + /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + :type id: str """ - _validation = { - 'value': {'readonly': True}, - } - _attribute_map = { - 'value': {'key': 'value', 'type': '[ReportConfig]'}, + 'id': {'key': 'id', 'type': 'str'}, } def __init__(self, **kwargs): - super(ReportConfigListResult, self).__init__(**kwargs) - self.value = None + super(EntityParentGroupInfo, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_parent_group_info_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_parent_group_info_py3.py new file mode 100644 index 000000000000..b0275df6a41f --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_parent_group_info_py3.py @@ -0,0 +1,30 @@ +# 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 EntityParentGroupInfo(Model): + """(Optional) The ID of the parent management group. + + :param id: The fully qualified ID for the parent management group. For + example, + /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(EntityParentGroupInfo, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_base.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_base.py new file mode 100644 index 000000000000..06850f19f08c --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_base.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 ErrorBase(Model): + """The details of the error. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: A machine readable error code. + :vartype code: str + :ivar message: A human readable error message. + :vartype message: str + :ivar target: Indicates which property in the request is responsible for + the error. + :vartype target: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ErrorBase, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = 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/error_base_py3.py similarity index 50% rename from azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_list_result_py3.py rename to azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_base_py3.py index f8811e6328d5..ce93c67b953b 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_list_result_py3.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_base_py3.py @@ -12,25 +12,35 @@ 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. +class ErrorBase(Model): + """The details of the error. 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] + :ivar code: A machine readable error code. + :vartype code: str + :ivar message: A human readable error message. + :vartype message: str + :ivar target: Indicates which property in the request is responsible for + the error. + :vartype target: str """ _validation = { - 'value': {'readonly': True}, + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[ReportConfig]'}, + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, } def __init__(self, **kwargs) -> None: - super(ReportConfigListResult, self).__init__(**kwargs) - self.value = None + super(ErrorBase, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details.py index 03f3e23d2153..0c5831e7ee91 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details.py @@ -18,10 +18,15 @@ class ErrorDetails(Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar code: Error code. + :ivar code: A machine readable error code. :vartype code: str - :ivar message: Error message indicating why the operation failed. + :ivar message: A human readable error message. :vartype message: str + :param target: Indicates which property in the request is responsible for + the error. + :type target: str + :param details: error details. + :type details: list[~azure.mgmt.costmanagement.models.ErrorBase] """ _validation = { @@ -32,9 +37,13 @@ class ErrorDetails(Model): _attribute_map = { 'code': {'key': 'code', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorBase]'}, } def __init__(self, **kwargs): super(ErrorDetails, self).__init__(**kwargs) self.code = None self.message = None + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details_py3.py index f9e1adeac9fe..3d4a63c6ab50 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details_py3.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details_py3.py @@ -18,10 +18,15 @@ class ErrorDetails(Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar code: Error code. + :ivar code: A machine readable error code. :vartype code: str - :ivar message: Error message indicating why the operation failed. + :ivar message: A human readable error message. :vartype message: str + :param target: Indicates which property in the request is responsible for + the error. + :type target: str + :param details: error details. + :type details: list[~azure.mgmt.costmanagement.models.ErrorBase] """ _validation = { @@ -32,9 +37,13 @@ class ErrorDetails(Model): _attribute_map = { 'code': {'key': 'code', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorBase]'}, } - def __init__(self, **kwargs) -> None: + def __init__(self, *, target: str=None, details=None, **kwargs) -> None: super(ErrorDetails, self).__init__(**kwargs) self.code = None self.message = None + self.target = target + self.details = details diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_billing_account_definition.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_billing_account_definition.py new file mode 100644 index 000000000000..5d18ffc55489 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_billing_account_definition.py @@ -0,0 +1,60 @@ +# 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 ExternalBillingAccountDefinition(Model): + """The ExternalBillingAccount model definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: ExternalBillingAccount id + :vartype id: str + :ivar name: ExternalBillingAccount name + :vartype name: str + :ivar type: ExternalBillingAccount type + :vartype type: str + :ivar kind: ExternalBillingAccount kind (eg aws) + :vartype kind: str + :ivar display_name: ExternalBillingAccount DisplayName + :vartype display_name: str + :ivar connector_id: Underlying ConnectorId + :vartype connector_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'readonly': True}, + 'display_name': {'readonly': True}, + 'connector_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'connector_id': {'key': 'properties.connectorId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ExternalBillingAccountDefinition, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.kind = None + self.display_name = None + self.connector_id = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_billing_account_definition_paged.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_billing_account_definition_paged.py new file mode 100644 index 000000000000..ecb1d48256b3 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_billing_account_definition_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class ExternalBillingAccountDefinitionPaged(Paged): + """ + A paging container for iterating over a list of :class:`ExternalBillingAccountDefinition ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ExternalBillingAccountDefinition]'} + } + + def __init__(self, *args, **kwargs): + + super(ExternalBillingAccountDefinitionPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_billing_account_definition_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_billing_account_definition_py3.py new file mode 100644 index 000000000000..7d1a93a5b22b --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_billing_account_definition_py3.py @@ -0,0 +1,60 @@ +# 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 ExternalBillingAccountDefinition(Model): + """The ExternalBillingAccount model definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: ExternalBillingAccount id + :vartype id: str + :ivar name: ExternalBillingAccount name + :vartype name: str + :ivar type: ExternalBillingAccount type + :vartype type: str + :ivar kind: ExternalBillingAccount kind (eg aws) + :vartype kind: str + :ivar display_name: ExternalBillingAccount DisplayName + :vartype display_name: str + :ivar connector_id: Underlying ConnectorId + :vartype connector_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'readonly': True}, + 'display_name': {'readonly': True}, + 'connector_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'connector_id': {'key': 'properties.connectorId', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ExternalBillingAccountDefinition, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.kind = None + self.display_name = None + self.connector_id = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_subscription_definition.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_subscription_definition.py new file mode 100644 index 000000000000..b76ef94e4e4c --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_subscription_definition.py @@ -0,0 +1,65 @@ +# 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 ExternalSubscriptionDefinition(Model): + """The ExternalSubscription model definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: ExternalSubscription id + :vartype id: str + :ivar name: ExternalSubscription name + :vartype name: str + :ivar type: ExternalSubscription type + :vartype type: str + :ivar kind: ExternalSubscription kind (eg aws) + :vartype kind: str + :ivar display_name: ExternalSubscription DisplayName + :vartype display_name: str + :ivar management_group_id: Assigned ManagementGroupId + :vartype management_group_id: str + :ivar external_billing_account_id: Parent ExternalBillingAccountId + :vartype external_billing_account_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'readonly': True}, + 'display_name': {'readonly': True}, + 'management_group_id': {'readonly': True}, + 'external_billing_account_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'management_group_id': {'key': 'properties.managementGroupId', 'type': 'str'}, + 'external_billing_account_id': {'key': 'properties.externalBillingAccountId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ExternalSubscriptionDefinition, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.kind = None + self.display_name = None + self.management_group_id = None + self.external_billing_account_id = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_subscription_definition_paged.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_subscription_definition_paged.py new file mode 100644 index 000000000000..f137ed1927ec --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_subscription_definition_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class ExternalSubscriptionDefinitionPaged(Paged): + """ + A paging container for iterating over a list of :class:`ExternalSubscriptionDefinition ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ExternalSubscriptionDefinition]'} + } + + def __init__(self, *args, **kwargs): + + super(ExternalSubscriptionDefinitionPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_subscription_definition_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_subscription_definition_py3.py new file mode 100644 index 000000000000..5fa8fc479604 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_subscription_definition_py3.py @@ -0,0 +1,65 @@ +# 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 ExternalSubscriptionDefinition(Model): + """The ExternalSubscription model definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: ExternalSubscription id + :vartype id: str + :ivar name: ExternalSubscription name + :vartype name: str + :ivar type: ExternalSubscription type + :vartype type: str + :ivar kind: ExternalSubscription kind (eg aws) + :vartype kind: str + :ivar display_name: ExternalSubscription DisplayName + :vartype display_name: str + :ivar management_group_id: Assigned ManagementGroupId + :vartype management_group_id: str + :ivar external_billing_account_id: Parent ExternalBillingAccountId + :vartype external_billing_account_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'readonly': True}, + 'display_name': {'readonly': True}, + 'management_group_id': {'readonly': True}, + 'external_billing_account_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'management_group_id': {'key': 'properties.managementGroupId', 'type': 'str'}, + 'external_billing_account_id': {'key': 'properties.externalBillingAccountId', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ExternalSubscriptionDefinition, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.kind = None + self.display_name = None + self.management_group_id = None + self.external_billing_account_id = None 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_comparison_expression.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_comparison_expression.py index f83b560bfdb6..1969db241c17 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_comparison_expression.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_comparison_expression.py @@ -15,23 +15,20 @@ class ReportConfigComparisonExpression(Model): """The comparison expression to be used in the report. - 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. :param name: Required. The name of the column to use in comparison. :type name: str - :ivar operator: Required. The operator to use for comparison. Default - value: "In" . - :vartype operator: str + :param operator: Required. The operator to use for comparison. Possible + values include: 'In', 'Contains' + :type operator: str or ~azure.mgmt.costmanagement.models.OperatorType :param values: Required. Array of values to use for comparison :type values: list[str] """ _validation = { 'name': {'required': True}, - 'operator': {'required': True, 'constant': True}, + 'operator': {'required': True}, 'values': {'required': True, 'min_items': 1}, } @@ -41,9 +38,8 @@ class ReportConfigComparisonExpression(Model): 'values': {'key': 'values', 'type': '[str]'}, } - operator = "In" - def __init__(self, **kwargs): super(ReportConfigComparisonExpression, self).__init__(**kwargs) self.name = kwargs.get('name', None) + self.operator = kwargs.get('operator', None) self.values = kwargs.get('values', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_comparison_expression_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_comparison_expression_py3.py index efdeb11ba56d..27dc0cdc1ea7 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_comparison_expression_py3.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_comparison_expression_py3.py @@ -15,23 +15,20 @@ class ReportConfigComparisonExpression(Model): """The comparison expression to be used in the report. - 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. :param name: Required. The name of the column to use in comparison. :type name: str - :ivar operator: Required. The operator to use for comparison. Default - value: "In" . - :vartype operator: str + :param operator: Required. The operator to use for comparison. Possible + values include: 'In', 'Contains' + :type operator: str or ~azure.mgmt.costmanagement.models.OperatorType :param values: Required. Array of values to use for comparison :type values: list[str] """ _validation = { 'name': {'required': True}, - 'operator': {'required': True, 'constant': True}, + 'operator': {'required': True}, 'values': {'required': True, 'min_items': 1}, } @@ -41,9 +38,8 @@ class ReportConfigComparisonExpression(Model): 'values': {'key': 'values', 'type': '[str]'}, } - operator = "In" - - def __init__(self, *, name: str, values, **kwargs) -> None: + def __init__(self, *, name: str, operator, values, **kwargs) -> None: super(ReportConfigComparisonExpression, self).__init__(**kwargs) self.name = name + self.operator = operator self.values = values diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset.py index 379de034502a..c65641a3008c 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset.py @@ -16,7 +16,7 @@ class ReportConfigDataset(Model): """The definition of data present in the report. :param granularity: The granularity of rows in the report. Possible values - include: 'Daily' + include: 'Daily', 'Monthly' :type granularity: str or ~azure.mgmt.costmanagement.models.GranularityType :param configuration: Has configuration information for the data in the @@ -33,6 +33,8 @@ class ReportConfigDataset(Model): can have up to 2 group by clauses. :type grouping: list[~azure.mgmt.costmanagement.models.ReportConfigGrouping] + :param sorting: Array of order by expression to use in the report. + :type sorting: list[~azure.mgmt.costmanagement.models.ReportConfigSorting] :param filter: Has filter expression to use in the report. :type filter: ~azure.mgmt.costmanagement.models.ReportConfigFilter """ @@ -46,6 +48,7 @@ class ReportConfigDataset(Model): 'configuration': {'key': 'configuration', 'type': 'ReportConfigDatasetConfiguration'}, 'aggregation': {'key': 'aggregation', 'type': '{ReportConfigAggregation}'}, 'grouping': {'key': 'grouping', 'type': '[ReportConfigGrouping]'}, + 'sorting': {'key': 'sorting', 'type': '[ReportConfigSorting]'}, 'filter': {'key': 'filter', 'type': 'ReportConfigFilter'}, } @@ -55,4 +58,5 @@ def __init__(self, **kwargs): self.configuration = kwargs.get('configuration', None) self.aggregation = kwargs.get('aggregation', None) self.grouping = kwargs.get('grouping', None) + self.sorting = kwargs.get('sorting', None) self.filter = kwargs.get('filter', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset_py3.py index 7ccb79537f8b..1f263ac3f3b4 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset_py3.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset_py3.py @@ -16,7 +16,7 @@ class ReportConfigDataset(Model): """The definition of data present in the report. :param granularity: The granularity of rows in the report. Possible values - include: 'Daily' + include: 'Daily', 'Monthly' :type granularity: str or ~azure.mgmt.costmanagement.models.GranularityType :param configuration: Has configuration information for the data in the @@ -33,6 +33,8 @@ class ReportConfigDataset(Model): can have up to 2 group by clauses. :type grouping: list[~azure.mgmt.costmanagement.models.ReportConfigGrouping] + :param sorting: Array of order by expression to use in the report. + :type sorting: list[~azure.mgmt.costmanagement.models.ReportConfigSorting] :param filter: Has filter expression to use in the report. :type filter: ~azure.mgmt.costmanagement.models.ReportConfigFilter """ @@ -46,13 +48,15 @@ class ReportConfigDataset(Model): 'configuration': {'key': 'configuration', 'type': 'ReportConfigDatasetConfiguration'}, 'aggregation': {'key': 'aggregation', 'type': '{ReportConfigAggregation}'}, 'grouping': {'key': 'grouping', 'type': '[ReportConfigGrouping]'}, + 'sorting': {'key': 'sorting', 'type': '[ReportConfigSorting]'}, 'filter': {'key': 'filter', 'type': 'ReportConfigFilter'}, } - def __init__(self, *, granularity=None, configuration=None, aggregation=None, grouping=None, filter=None, **kwargs) -> None: + def __init__(self, *, granularity=None, configuration=None, aggregation=None, grouping=None, sorting=None, filter=None, **kwargs) -> None: super(ReportConfigDataset, self).__init__(**kwargs) self.granularity = granularity self.configuration = configuration self.aggregation = aggregation self.grouping = grouping + self.sorting = sorting self.filter = filter diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_definition.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_definition.py index bd45fb4bbf5b..ab46d7172b0d 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_definition.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_definition.py @@ -20,7 +20,10 @@ class ReportConfigDefinition(Model): All required parameters must be populated in order to send to Azure. - :ivar type: Required. The type of the report. Default value: "Usage" . + :ivar type: Required. The type of the report. Usage represents actual + usage, forecast represents forecasted data and UsageAndForecast represents + both usage and forecasted data. Actual usage and forecasted data can be + differentiated based on dates. Default value: "Usage" . :vartype type: str :param timeframe: Required. The time frame for pulling data for the report. If custom, then a specific time period must be provided. Possible diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_definition_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_definition_py3.py index 74f4a5df6e0d..4a03fa138934 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_definition_py3.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_definition_py3.py @@ -20,7 +20,10 @@ class ReportConfigDefinition(Model): All required parameters must be populated in order to send to Azure. - :ivar type: Required. The type of the report. Default value: "Usage" . + :ivar type: Required. The type of the report. Usage represents actual + usage, forecast represents forecasted data and UsageAndForecast represents + both usage and forecasted data. Actual usage and forecasted data can be + differentiated based on dates. Default value: "Usage" . :vartype type: str :param timeframe: Required. The time frame for pulling data for the report. If custom, then a specific time period must be provided. Possible 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_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_grouping.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_grouping.py index 1396ac74d1c0..09ca40f3cda5 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_grouping.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_grouping.py @@ -17,25 +17,26 @@ class ReportConfigGrouping(Model): All required parameters must be populated in order to send to Azure. - :param column_type: Required. Has type of the column to group. Possible - values include: 'Tag', 'Dimension' - :type column_type: str or + :param type: Required. Has type of the column to group. Possible values + include: 'Tag', 'Dimension' + :type type: str or ~azure.mgmt.costmanagement.models.ReportConfigColumnType - :param name: Required. The name of the column to group. + :param name: Required. The name of the column to group. This version + supports subscription lowest possible grain. :type name: str """ _validation = { - 'column_type': {'required': True}, + 'type': {'required': True}, 'name': {'required': True}, } _attribute_map = { - 'column_type': {'key': 'columnType', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, } def __init__(self, **kwargs): super(ReportConfigGrouping, self).__init__(**kwargs) - self.column_type = kwargs.get('column_type', None) + self.type = kwargs.get('type', None) self.name = kwargs.get('name', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_grouping_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_grouping_py3.py index e40f57c8e869..317bcf8f3d24 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_grouping_py3.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_grouping_py3.py @@ -17,25 +17,26 @@ class ReportConfigGrouping(Model): All required parameters must be populated in order to send to Azure. - :param column_type: Required. Has type of the column to group. Possible - values include: 'Tag', 'Dimension' - :type column_type: str or + :param type: Required. Has type of the column to group. Possible values + include: 'Tag', 'Dimension' + :type type: str or ~azure.mgmt.costmanagement.models.ReportConfigColumnType - :param name: Required. The name of the column to group. + :param name: Required. The name of the column to group. This version + supports subscription lowest possible grain. :type name: str """ _validation = { - 'column_type': {'required': True}, + 'type': {'required': True}, 'name': {'required': True}, } _attribute_map = { - 'column_type': {'key': 'columnType', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, *, column_type, name: str, **kwargs) -> None: + def __init__(self, *, type, name: str, **kwargs) -> None: super(ReportConfigGrouping, self).__init__(**kwargs) - self.column_type = column_type + self.type = type self.name = name 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/models/report_config_delivery_info.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_sorting.py similarity index 52% rename from azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_delivery_info.py rename to azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_sorting.py index a3caa7e883d8..897bdde4cee5 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_delivery_info.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_sorting.py @@ -12,25 +12,28 @@ from msrest.serialization import Model -class ReportConfigDeliveryInfo(Model): - """The delivery information associated with a report config. +class ReportConfigSorting(Model): + """The order by expression to be used in the report. 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 + :param direction: Direction of sort. Possible values include: 'Ascending', + 'Descending' + :type direction: str or ~azure.mgmt.costmanagement.models.enum + :param name: Required. The name of the column to sort. + :type name: str """ _validation = { - 'destination': {'required': True}, + 'name': {'required': True}, } _attribute_map = { - 'destination': {'key': 'destination', 'type': 'ReportConfigDeliveryDestination'}, + 'direction': {'key': 'direction', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, } def __init__(self, **kwargs): - super(ReportConfigDeliveryInfo, self).__init__(**kwargs) - self.destination = kwargs.get('destination', None) + super(ReportConfigSorting, self).__init__(**kwargs) + self.direction = kwargs.get('direction', None) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_sorting_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_sorting_py3.py new file mode 100644 index 000000000000..910397d8d51b --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_sorting_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 ReportConfigSorting(Model): + """The order by expression to be used in the report. + + All required parameters must be populated in order to send to Azure. + + :param direction: Direction of sort. Possible values include: 'Ascending', + 'Descending' + :type direction: str or ~azure.mgmt.costmanagement.models.enum + :param name: Required. The name of the column to sort. + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'direction': {'key': 'direction', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str, direction=None, **kwargs) -> None: + super(ReportConfigSorting, self).__init__(**kwargs) + self.direction = direction + self.name = name diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py index 93ee3e3ea6df..a255b445f443 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py @@ -9,16 +9,22 @@ # 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 +from .dimensions_operations import DimensionsOperations +from .query_operations import QueryOperations +from .forecast_operations import ForecastOperations +from .cloud_connector_operations import CloudConnectorOperations +from .external_billing_account_operations import ExternalBillingAccountOperations +from .external_subscription_operations import ExternalSubscriptionOperations +from .entities_operations import EntitiesOperations from .operations import Operations __all__ = [ - 'ReportConfigOperations', - 'BillingAccountDimensionsOperations', - 'SubscriptionDimensionsOperations', - 'ResourceGroupDimensionsOperations', + 'DimensionsOperations', + 'QueryOperations', + 'ForecastOperations', + 'CloudConnectorOperations', + 'ExternalBillingAccountOperations', + 'ExternalSubscriptionOperations', + 'EntitiesOperations', 'Operations', ] diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/billing_account_dimensions_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/billing_account_dimensions_operations.py deleted file mode 100644 index 4ef732e976ed..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/billing_account_dimensions_operations.py +++ /dev/null @@ -1,126 +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 BillingAccountDimensionsOperations(object): - """BillingAccountDimensionsOperations 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, billing_account_id, filter=None, expand=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config): - """Lists the dimensions by billingAccount Id. - - :param billing_account_id: BillingAccount ID - :type billing_account_id: str - :param filter: May be used to filter dimensions by - properties/category, properties/usageStart, properties/usageEnd. - Supported operators are 'eq','lt', 'gt', 'le', 'ge'. - :type filter: str - :param expand: May be used to expand the properties/data within a - dimension category. By default, data is not included when listing - dimensions. - :type expand: str - :param skiptoken: Skiptoken is only used if a previous operation - returned a partial result. If a previous response contains a nextLink - element, the value of the nextLink element will include a skiptoken - parameter that specifies a starting point to use for subsequent calls. - :type skiptoken: str - :param top: May be used to limit the number of results to the most - recent N dimension data. - :type top: int - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Dimension - :rtype: - ~azure.mgmt.costmanagement.models.DimensionPaged[~azure.mgmt.costmanagement.models.Dimension] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - if skiptoken is not None: - query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.DimensionPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.DimensionPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/dimensions'} diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/cloud_connector_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/cloud_connector_operations.py new file mode 100644 index 000000000000..1359df81699f --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/cloud_connector_operations.py @@ -0,0 +1,334 @@ +# 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 CloudConnectorOperations(object): + """CloudConnectorOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-03-01-preview. Constant value: "2019-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-03-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """List all cloud connector definitions. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ConnectorDefinition + :rtype: + ~azure.mgmt.costmanagement.models.ConnectorDefinitionPaged[~azure.mgmt.costmanagement.models.ConnectorDefinition] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ConnectorDefinitionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ConnectorDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.CostManagement/cloudConnectors'} + + def get( + self, connector_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Get a cloud connector definition. + + :param connector_name: Connector Name. + :type connector_name: str + :param expand: May be used to expand the collectionInfo property. By + default, collectionInfo is not included. + :type expand: 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: ConnectorDefinition or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.costmanagement.models.ConnectorDefinition or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'connectorName': self._serialize.url("connector_name", connector_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') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, '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('ConnectorDefinition', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.CostManagement/cloudConnectors/{connectorName}'} + + def create_or_update( + self, connector_name, connector, custom_headers=None, raw=False, **operation_config): + """Create or update a cloud connector definition. + + :param connector_name: Connector Name. + :type connector_name: str + :param connector: Connector details + :type connector: ~azure.mgmt.costmanagement.models.ConnectorDefinition + :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: ConnectorDefinition or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.costmanagement.models.ConnectorDefinition or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'connectorName': self._serialize.url("connector_name", connector_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(connector, 'ConnectorDefinition') + + # 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('ConnectorDefinition', response) + if response.status_code == 201: + deserialized = self._deserialize('ConnectorDefinition', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/providers/Microsoft.CostManagement/cloudConnectors/{connectorName}'} + + def delete( + self, connector_name, custom_headers=None, raw=False, **operation_config): + """Delete a cloud connector definition. + + :param connector_name: Connector Name. + :type connector_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 = { + 'connectorName': self._serialize.url("connector_name", connector_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': '/providers/Microsoft.CostManagement/cloudConnectors/{connectorName}'} + + def update( + self, connector_name, connector, custom_headers=None, raw=False, **operation_config): + """Update a cloud connector definition. + + :param connector_name: Connector Name. + :type connector_name: str + :param connector: Connector details + :type connector: ~azure.mgmt.costmanagement.models.ConnectorDefinition + :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: ConnectorDefinition or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.costmanagement.models.ConnectorDefinition or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'connectorName': self._serialize.url("connector_name", connector_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(connector, 'ConnectorDefinition') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + 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('ConnectorDefinition', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/providers/Microsoft.CostManagement/cloudConnectors/{connectorName}'} diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/dimensions_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/dimensions_operations.py new file mode 100644 index 000000000000..7c79563f7ab1 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/dimensions_operations.py @@ -0,0 +1,576 @@ +# 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 DimensionsOperations(object): + """DimensionsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-03-01-preview. Constant value: "2019-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-03-01-preview" + + self.config = config + + def list_by_billing_account( + self, billing_account_id, filter=None, expand=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config): + """Lists the dimensions by billingAccount Id. + + :param billing_account_id: BillingAccount ID + :type billing_account_id: str + :param filter: May be used to filter dimensions by + properties/category, properties/usageStart, properties/usageEnd. + Supported operators are 'eq','lt', 'gt', 'le', 'ge'. + :type filter: str + :param expand: May be used to expand the properties/data within a + dimension category. By default, data is not included when listing + dimensions. + :type expand: str + :param skiptoken: Skiptoken is only used if a previous operation + returned a partial result. If a previous response contains a nextLink + element, the value of the nextLink element will include a skiptoken + parameter that specifies a starting point to use for subsequent calls. + :type skiptoken: str + :param top: May be used to limit the number of results to the most + recent N dimension data. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Dimension + :rtype: + ~azure.mgmt.costmanagement.models.DimensionPaged[~azure.mgmt.costmanagement.models.Dimension] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_billing_account.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.DimensionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DimensionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/dimensions'} + + def list_by_enrollment_account( + self, billing_account_id, enrollment_account_id, filter=None, expand=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config): + """Lists the dimensions by Enrollment Account Id. + + :param billing_account_id: BillingAccount ID + :type billing_account_id: str + :param enrollment_account_id: Enrollment Account ID + :type enrollment_account_id: str + :param filter: May be used to filter dimensions by + properties/category, properties/usageStart, properties/usageEnd. + Supported operators are 'eq','lt', 'gt', 'le', 'ge'. + :type filter: str + :param expand: May be used to expand the properties/data within a + dimension category. By default, data is not included when listing + dimensions. + :type expand: str + :param skiptoken: Skiptoken is only used if a previous operation + returned a partial result. If a previous response contains a nextLink + element, the value of the nextLink element will include a skiptoken + parameter that specifies a starting point to use for subsequent calls. + :type skiptoken: str + :param top: May be used to limit the number of results to the most + recent N dimension data. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Dimension + :rtype: + ~azure.mgmt.costmanagement.models.DimensionPaged[~azure.mgmt.costmanagement.models.Dimension] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_enrollment_account.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), + 'enrollmentAccountId': self._serialize.url("enrollment_account_id", enrollment_account_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.DimensionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DimensionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_enrollment_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}/providers/Microsoft.CostManagement/dimensions'} + + def list_by_department( + self, billing_account_id, department_id, filter=None, expand=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config): + """Lists the dimensions by Department Id. + + :param billing_account_id: BillingAccount ID + :type billing_account_id: str + :param department_id: Department ID + :type department_id: str + :param filter: May be used to filter dimensions by + properties/category, properties/usageStart, properties/usageEnd. + Supported operators are 'eq','lt', 'gt', 'le', 'ge'. + :type filter: str + :param expand: May be used to expand the properties/data within a + dimension category. By default, data is not included when listing + dimensions. + :type expand: str + :param skiptoken: Skiptoken is only used if a previous operation + returned a partial result. If a previous response contains a nextLink + element, the value of the nextLink element will include a skiptoken + parameter that specifies a starting point to use for subsequent calls. + :type skiptoken: str + :param top: May be used to limit the number of results to the most + recent N dimension data. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Dimension + :rtype: + ~azure.mgmt.costmanagement.models.DimensionPaged[~azure.mgmt.costmanagement.models.Dimension] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_department.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), + 'departmentId': self._serialize.url("department_id", department_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.DimensionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DimensionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_department.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}/providers/Microsoft.CostManagement/dimensions'} + + def list_by_management_group( + self, management_group_id, filter=None, expand=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config): + """Lists the dimensions by managementGroup Id. + + :param management_group_id: ManagementGroup ID + :type management_group_id: str + :param filter: May be used to filter dimensions by + properties/category, properties/usageStart, properties/usageEnd. + Supported operators are 'eq','lt', 'gt', 'le', 'ge'. + :type filter: str + :param expand: May be used to expand the properties/data within a + dimension category. By default, data is not included when listing + dimensions. + :type expand: str + :param skiptoken: Skiptoken is only used if a previous operation + returned a partial result. If a previous response contains a nextLink + element, the value of the nextLink element will include a skiptoken + parameter that specifies a starting point to use for subsequent calls. + :type skiptoken: str + :param top: May be used to limit the number of results to the most + recent N dimension data. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Dimension + :rtype: + ~azure.mgmt.costmanagement.models.DimensionPaged[~azure.mgmt.costmanagement.models.Dimension] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_management_group.metadata['url'] + path_format_arguments = { + 'managementGroupId': self._serialize.url("management_group_id", management_group_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.DimensionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DimensionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_management_group.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.CostManagement/dimensions'} + + def list_by_subscription( + self, filter=None, expand=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config): + """Lists the dimensions by subscription Id. + + :param filter: May be used to filter dimensions by + properties/category, properties/usageStart, properties/usageEnd. + Supported operators are 'eq','lt', 'gt', 'le', 'ge'. + :type filter: str + :param expand: May be used to expand the properties/data within a + dimension category. By default, data is not included when listing + dimensions. + :type expand: str + :param skiptoken: Skiptoken is only used if a previous operation + returned a partial result. If a previous response contains a nextLink + element, the value of the nextLink element will include a skiptoken + parameter that specifies a starting point to use for subsequent calls. + :type skiptoken: str + :param top: May be used to limit the number of results to the most + recent N dimension data. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Dimension + :rtype: + ~azure.mgmt.costmanagement.models.DimensionPaged[~azure.mgmt.costmanagement.models.Dimension] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_subscription.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') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.DimensionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DimensionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CostManagement/dimensions'} + + def list_by_resource_group( + self, resource_group_name, filter=None, expand=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config): + """Lists the dimensions by resource group Id. + + :param resource_group_name: Azure Resource Group Name. + :type resource_group_name: str + :param filter: May be used to filter dimensions by + properties/category, properties/usageStart, properties/usageEnd. + Supported operators are 'eq','lt', 'gt', 'le', 'ge'. + :type filter: str + :param expand: May be used to expand the properties/data within a + dimension category. By default, data is not included when listing + dimensions. + :type expand: str + :param skiptoken: Skiptoken is only used if a previous operation + returned a partial result. If a previous response contains a nextLink + element, the value of the nextLink element will include a skiptoken + parameter that specifies a starting point to use for subsequent calls. + :type skiptoken: str + :param top: May be used to limit the number of results to the most + recent N dimension data. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Dimension + :rtype: + ~azure.mgmt.costmanagement.models.DimensionPaged[~azure.mgmt.costmanagement.models.Dimension] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource_group.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') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.DimensionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DimensionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CostManagement/dimensions'} diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/subscription_dimensions_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/entities_operations.py similarity index 53% rename from azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/subscription_dimensions_operations.py rename to azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/entities_operations.py index 6bdbde4f71ed..59721f2014ac 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/subscription_dimensions_operations.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/entities_operations.py @@ -15,14 +15,14 @@ from .. import models -class SubscriptionDimensionsOperations(object): - """SubscriptionDimensionsOperations operations. +class EntitiesOperations(object): + """EntitiesOperations 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". + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-03-01-preview. Constant value: "2019-03-01-preview". """ models = models @@ -32,38 +32,31 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-05-31" + self.api_version = "2019-03-01-preview" self.config = config - def list( - self, filter=None, expand=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config): - """Lists the dimensions by subscription Id. - - :param filter: May be used to filter dimensions by - properties/category, properties/usageStart, properties/usageEnd. - Supported operators are 'eq','lt', 'gt', 'le', 'ge'. - :type filter: str - :param expand: May be used to expand the properties/data within a - dimension category. By default, data is not included when listing - dimensions. - :type expand: str - :param skiptoken: Skiptoken is only used if a previous operation - returned a partial result. If a previous response contains a nextLink - element, the value of the nextLink element will include a skiptoken - parameter that specifies a starting point to use for subsequent calls. - :type skiptoken: str - :param top: May be used to limit the number of results to the most - recent N dimension data. - :type top: int + def list_by_management_group( + self, management_group_id, view=None, custom_headers=None, raw=False, **operation_config): + """List all entities (Management Groups, Subscriptions, + ExternalSubscriptions, etc.) focusing on a particular group for the + authenticated user. + + :param management_group_id: ManagementGroup ID + :type management_group_id: str + :param view: The view parameter allows clients to filter the type of + data that is returned by the getEntities call. Possible values + include: 'FullHierarchy', 'GroupsOnly', 'SubscriptionsOnly', + 'ExternalSubscriptionsOnly', 'Audit' + :type view: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of Dimension + :return: An iterator like instance of EntityInfo :rtype: - ~azure.mgmt.costmanagement.models.DimensionPaged[~azure.mgmt.costmanagement.models.Dimension] + ~azure.mgmt.costmanagement.models.EntityInfoPaged[~azure.mgmt.costmanagement.models.EntityInfo] :raises: :class:`ErrorResponseException` """ @@ -71,23 +64,17 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = self.list.metadata['url'] + url = self.list_by_management_group.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'managementGroupId': self._serialize.url("management_group_id", management_group_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - if skiptoken is not None: - query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) + if view is not None: + query_parameters['$view'] = self._serialize.query("view", view, 'str') else: url = next_link @@ -104,7 +91,7 @@ def internal_paging(next_link=None, raw=False): 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) + request = self._client.post(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: @@ -113,12 +100,12 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.DimensionPaged(internal_paging, self._deserialize.dependencies) + deserialized = models.EntityInfoPaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} - client_raw_response = models.DimensionPaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = models.EntityInfoPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CostManagement/dimensions'} + list_by_management_group.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.CostManagement/getEntities'} diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/external_billing_account_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/external_billing_account_operations.py new file mode 100644 index 000000000000..da2049233695 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/external_billing_account_operations.py @@ -0,0 +1,156 @@ +# 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 ExternalBillingAccountOperations(object): + """ExternalBillingAccountOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-03-01-preview. Constant value: "2019-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-03-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """List all ExternalBillingAccount definitions. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ExternalBillingAccountDefinition + :rtype: + ~azure.mgmt.costmanagement.models.ExternalBillingAccountDefinitionPaged[~azure.mgmt.costmanagement.models.ExternalBillingAccountDefinition] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ExternalBillingAccountDefinitionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ExternalBillingAccountDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.CostManagement/externalBillingAccounts'} + + def get( + self, external_billing_account_name, custom_headers=None, raw=False, **operation_config): + """Get a ExternalBillingAccount definition. + + :param external_billing_account_name: External Billing Account Name. + (eg 'aws-{PayerAccountId}') + :type external_billing_account_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: ExternalBillingAccountDefinition or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.costmanagement.models.ExternalBillingAccountDefinition or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'externalBillingAccountName': self._serialize.url("external_billing_account_name", external_billing_account_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('ExternalBillingAccountDefinition', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}'} diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/external_subscription_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/external_subscription_operations.py new file mode 100644 index 000000000000..6059b0c05e1d --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/external_subscription_operations.py @@ -0,0 +1,339 @@ +# 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 ExternalSubscriptionOperations(object): + """ExternalSubscriptionOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-03-01-preview. Constant value: "2019-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-03-01-preview" + + self.config = config + + def list_by_external_billing_account( + self, external_billing_account_name, custom_headers=None, raw=False, **operation_config): + """List all ExternalSubscriptions by ExternalBillingAccount definitions. + + :param external_billing_account_name: External Billing Account Name. + (eg 'aws-{PayerAccountId}') + :type external_billing_account_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: An iterator like instance of ExternalSubscriptionDefinition + :rtype: + ~azure.mgmt.costmanagement.models.ExternalSubscriptionDefinitionPaged[~azure.mgmt.costmanagement.models.ExternalSubscriptionDefinition] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_external_billing_account.metadata['url'] + path_format_arguments = { + 'externalBillingAccountName': self._serialize.url("external_billing_account_name", external_billing_account_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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ExternalSubscriptionDefinitionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ExternalSubscriptionDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_external_billing_account.metadata = {'url': '/providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}/externalSubscriptions'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """List all ExternalSubscription definitions. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ExternalSubscriptionDefinition + :rtype: + ~azure.mgmt.costmanagement.models.ExternalSubscriptionDefinitionPaged[~azure.mgmt.costmanagement.models.ExternalSubscriptionDefinition] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ExternalSubscriptionDefinitionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ExternalSubscriptionDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.CostManagement/externalSubscriptions'} + + def get( + self, external_subscription_name, custom_headers=None, raw=False, **operation_config): + """Get an ExternalSubscription definition. + + :param external_subscription_name: External Subscription Name. (eg + 'aws-{UsageAccountId}') + :type external_subscription_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: ExternalSubscriptionDefinition or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.costmanagement.models.ExternalSubscriptionDefinition or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'externalSubscriptionName': self._serialize.url("external_subscription_name", external_subscription_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('ExternalSubscriptionDefinition', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}'} + + def list_by_management_group( + self, management_group_id, custom_headers=None, raw=False, **operation_config): + """List all ExternalSubscription definitions for Management Group. + + :param management_group_id: ManagementGroup ID + :type management_group_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ExternalSubscriptionDefinition + :rtype: + ~azure.mgmt.costmanagement.models.ExternalSubscriptionDefinitionPaged[~azure.mgmt.costmanagement.models.ExternalSubscriptionDefinition] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_management_group.metadata['url'] + path_format_arguments = { + 'managementGroupId': self._serialize.url("management_group_id", management_group_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ExternalSubscriptionDefinitionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ExternalSubscriptionDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_management_group.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.CostManagement/externalSubscriptions'} + + def update_by_management_group( + self, management_group_id, external_subscription_name, custom_headers=None, raw=False, **operation_config): + """Associates ExternalSubscription with the management group. + + :param management_group_id: ManagementGroup ID + :type management_group_id: str + :param external_subscription_name: External Subscription Name. (eg + 'aws-{UsageAccountId}') + :type external_subscription_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.update_by_management_group.metadata['url'] + path_format_arguments = { + 'managementGroupId': self._serialize.url("management_group_id", management_group_id, 'str'), + 'externalSubscriptionName': self._serialize.url("external_subscription_name", external_subscription_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.put(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + update_by_management_group.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}'} diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/forecast_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/forecast_operations.py new file mode 100644 index 000000000000..1020f3179d4d --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/forecast_operations.py @@ -0,0 +1,480 @@ +# 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 ForecastOperations(object): + """ForecastOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-03-01-preview. Constant value: "2019-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-03-01-preview" + + self.config = config + + def usage_by_subscription( + self, parameters, custom_headers=None, raw=False, **operation_config): + """Forecast the usage data for subscriptionId. + + :param parameters: Parameters supplied to the CreateOrUpdate Report + Config operation. + :type parameters: + ~azure.mgmt.costmanagement.models.ReportConfigDefinition + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Query + :rtype: + ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.usage_by_subscription.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') + + else: + url = next_link + query_parameters = {} + + # 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, 'ReportConfigDefinition') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + usage_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CostManagement/Forecast'} + + def usage_by_resource_group( + self, resource_group_name, parameters, custom_headers=None, raw=False, **operation_config): + """Forecast the usage data for subscriptionId and resource group. + + :param resource_group_name: Azure Resource Group Name. + :type resource_group_name: str + :param parameters: Parameters supplied to the CreateOrUpdate Report + Config operation. + :type parameters: + ~azure.mgmt.costmanagement.models.ReportConfigDefinition + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Query + :rtype: + ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.usage_by_resource_group.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') + + else: + url = next_link + query_parameters = {} + + # 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, 'ReportConfigDefinition') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + usage_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.CostManagement/Forecast'} + + def usage_by_billing_account( + self, billing_account_id, parameters, custom_headers=None, raw=False, **operation_config): + """Forecast the usage data for billing account. + + :param billing_account_id: BillingAccount ID + :type billing_account_id: str + :param parameters: Parameters supplied to the CreateOrUpdate Report + Config operation. + :type parameters: + ~azure.mgmt.costmanagement.models.ReportConfigDefinition + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Query + :rtype: + ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.usage_by_billing_account.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # 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, 'ReportConfigDefinition') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + usage_by_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/Forecast'} + + def usage_by_enrollment_account( + self, billing_account_id, enrollment_account_id, parameters, custom_headers=None, raw=False, **operation_config): + """Forecast the usage data for an enrollment account. + + :param billing_account_id: BillingAccount ID + :type billing_account_id: str + :param enrollment_account_id: Enrollment Account ID + :type enrollment_account_id: str + :param parameters: Parameters supplied to the CreateOrUpdate Report + Config operation. + :type parameters: + ~azure.mgmt.costmanagement.models.ReportConfigDefinition + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Query + :rtype: + ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.usage_by_enrollment_account.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), + 'enrollmentAccountId': self._serialize.url("enrollment_account_id", enrollment_account_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # 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, 'ReportConfigDefinition') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + usage_by_enrollment_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}/providers/Microsoft.CostManagement/Forecast'} + + def usage_by_department( + self, billing_account_id, department_id, parameters, custom_headers=None, raw=False, **operation_config): + """Forecast the usage data for department. + + :param billing_account_id: BillingAccount ID + :type billing_account_id: str + :param department_id: Department ID + :type department_id: str + :param parameters: Parameters supplied to the CreateOrUpdate Report + Config operation. + :type parameters: + ~azure.mgmt.costmanagement.models.ReportConfigDefinition + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Query + :rtype: + ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.usage_by_department.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), + 'departmentId': self._serialize.url("department_id", department_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') + + else: + url = next_link + query_parameters = {} + + # 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, 'ReportConfigDefinition') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + usage_by_department.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}/providers/Microsoft.CostManagement/Forecast'} + + def usage_by_managment_group( + self, management_group_id, parameters, custom_headers=None, raw=False, **operation_config): + """Lists the usage data for management group. + + :param management_group_id: ManagementGroup ID + :type management_group_id: str + :param parameters: Parameters supplied to the CreateOrUpdate Report + Config operation. + :type parameters: + ~azure.mgmt.costmanagement.models.ReportConfigDefinition + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Query + :rtype: + ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.usage_by_managment_group.metadata['url'] + path_format_arguments = { + 'managementGroupId': self._serialize.url("management_group_id", management_group_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # 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, 'ReportConfigDefinition') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + usage_by_managment_group.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.CostManagement/Forecast'} diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/operations.py index aa2c9606c7ee..13ec9cafe5f1 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/operations.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/operations.py @@ -22,7 +22,7 @@ class Operations(object): :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". + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-03-01-preview. Constant value: "2019-03-01-preview". """ models = models @@ -32,7 +32,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-05-31" + self.api_version = "2019-03-01-preview" self.config = config diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/query_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/query_operations.py new file mode 100644 index 000000000000..1591a2381db5 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/query_operations.py @@ -0,0 +1,480 @@ +# 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 QueryOperations(object): + """QueryOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-03-01-preview. Constant value: "2019-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-03-01-preview" + + self.config = config + + def usage_by_subscription( + self, parameters, custom_headers=None, raw=False, **operation_config): + """Query the usage data for subscriptionId. + + :param parameters: Parameters supplied to the CreateOrUpdate Report + Config operation. + :type parameters: + ~azure.mgmt.costmanagement.models.ReportConfigDefinition + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Query + :rtype: + ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.usage_by_subscription.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') + + else: + url = next_link + query_parameters = {} + + # 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, 'ReportConfigDefinition') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + usage_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CostManagement/Query'} + + def usage_by_resource_group( + self, resource_group_name, parameters, custom_headers=None, raw=False, **operation_config): + """Query the usage data for subscriptionId and resource group. + + :param resource_group_name: Azure Resource Group Name. + :type resource_group_name: str + :param parameters: Parameters supplied to the CreateOrUpdate Report + Config operation. + :type parameters: + ~azure.mgmt.costmanagement.models.ReportConfigDefinition + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Query + :rtype: + ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.usage_by_resource_group.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') + + else: + url = next_link + query_parameters = {} + + # 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, 'ReportConfigDefinition') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + usage_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.CostManagement/Query'} + + def usage_by_billing_account( + self, billing_account_id, parameters, custom_headers=None, raw=False, **operation_config): + """Query the usage data for billing account. + + :param billing_account_id: BillingAccount ID + :type billing_account_id: str + :param parameters: Parameters supplied to the CreateOrUpdate Report + Config operation. + :type parameters: + ~azure.mgmt.costmanagement.models.ReportConfigDefinition + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Query + :rtype: + ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.usage_by_billing_account.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # 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, 'ReportConfigDefinition') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + usage_by_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/Query'} + + def usage_by_enrollment_account( + self, billing_account_id, enrollment_account_id, parameters, custom_headers=None, raw=False, **operation_config): + """Query the usage data for an enrollment account. + + :param billing_account_id: BillingAccount ID + :type billing_account_id: str + :param enrollment_account_id: Enrollment Account ID + :type enrollment_account_id: str + :param parameters: Parameters supplied to the CreateOrUpdate Report + Config operation. + :type parameters: + ~azure.mgmt.costmanagement.models.ReportConfigDefinition + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Query + :rtype: + ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.usage_by_enrollment_account.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), + 'enrollmentAccountId': self._serialize.url("enrollment_account_id", enrollment_account_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # 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, 'ReportConfigDefinition') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + usage_by_enrollment_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}/providers/Microsoft.CostManagement/Query'} + + def usage_by_department( + self, billing_account_id, department_id, parameters, custom_headers=None, raw=False, **operation_config): + """Query the usage data for department. + + :param billing_account_id: BillingAccount ID + :type billing_account_id: str + :param department_id: Department ID + :type department_id: str + :param parameters: Parameters supplied to the CreateOrUpdate Report + Config operation. + :type parameters: + ~azure.mgmt.costmanagement.models.ReportConfigDefinition + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Query + :rtype: + ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.usage_by_department.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), + 'departmentId': self._serialize.url("department_id", department_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') + + else: + url = next_link + query_parameters = {} + + # 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, 'ReportConfigDefinition') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + usage_by_department.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}/providers/Microsoft.CostManagement/Query'} + + def usage_by_managment_group( + self, management_group_id, parameters, custom_headers=None, raw=False, **operation_config): + """Lists the usage data for management group. + + :param management_group_id: ManagementGroup ID + :type management_group_id: str + :param parameters: Parameters supplied to the CreateOrUpdate Report + Config operation. + :type parameters: + ~azure.mgmt.costmanagement.models.ReportConfigDefinition + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Query + :rtype: + ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.usage_by_managment_group.metadata['url'] + path_format_arguments = { + 'managementGroupId': self._serialize.url("management_group_id", management_group_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # 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, 'ReportConfigDefinition') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + usage_by_managment_group.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.CostManagement/Query'} 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}'} diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/resource_group_dimensions_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/resource_group_dimensions_operations.py deleted file mode 100644 index ed03023fd3bd..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/resource_group_dimensions_operations.py +++ /dev/null @@ -1,127 +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 ResourceGroupDimensionsOperations(object): - """ResourceGroupDimensionsOperations 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, resource_group_name, filter=None, expand=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config): - """Lists the dimensions by resource group Id. - - :param resource_group_name: Azure Resource Group Name. - :type resource_group_name: str - :param filter: May be used to filter dimensions by - properties/category, properties/usageStart, properties/usageEnd. - Supported operators are 'eq','lt', 'gt', 'le', 'ge'. - :type filter: str - :param expand: May be used to expand the properties/data within a - dimension category. By default, data is not included when listing - dimensions. - :type expand: str - :param skiptoken: Skiptoken is only used if a previous operation - returned a partial result. If a previous response contains a nextLink - element, the value of the nextLink element will include a skiptoken - parameter that specifies a starting point to use for subsequent calls. - :type skiptoken: str - :param top: May be used to limit the number of results to the most - recent N dimension data. - :type top: int - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Dimension - :rtype: - ~azure.mgmt.costmanagement.models.DimensionPaged[~azure.mgmt.costmanagement.models.Dimension] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - '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') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - if skiptoken is not None: - query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.DimensionPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.DimensionPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CostManagement/dimensions'} From 943a55470b3cb73a057958ca4c00ae054711f4c8 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 4 Feb 2019 10:09:11 -0800 Subject: [PATCH 07/14] [AutoPR cost-management/resource-manager] PR - Introduce new API version (2019-01-01) with new (Export-related APIs) introduced (#4291) * Generated from 1fd359a4268074a5afb5b0706411b500260ea8ac readme updated to update tag package name per reviewers suggestion to fix check errors. * Packaging update of azure-mgmt-costmanagement * Generated from 8b2e7a5828fed35240abcbd92caca0f5a612a470 Based on ARM review introduced the use of 'scope' and abstracted out different scopes for API paths defined * Generated from fe55f184a9e5d9b66823d36ffe90a8a89411da2b ARM review based changes. * Generated from 97b0e06c068c2403ec16aa2ecea95e4c79d4d65a ARM review based change. Updated path to represent 'scope'. * Generated from 526b0925dc38b30e76398f351a475a013b77cac7 updated query parameter scope to include management group path --- azure-mgmt-costmanagement/README.rst | 19 - .../costmanagement/cost_management_client.py | 30 +- .../mgmt/costmanagement/models/__init__.py | 135 ++--- .../models/common_export_properties.py | 44 ++ .../models/common_export_properties_py3.py | 44 ++ .../models/connector_collection_error_info.py | 51 -- .../connector_collection_error_info_py3.py | 51 -- .../models/connector_collection_info.py | 52 -- .../models/connector_collection_info_py3.py | 52 -- .../models/connector_definition.py | 112 ---- .../models/connector_definition_paged.py | 27 - .../models/connector_definition_py3.py | 112 ---- .../models/cost_management_client_enums.py | 52 +- .../mgmt/costmanagement/models/entity_info.py | 102 ---- .../models/entity_info_paged.py | 27 - .../costmanagement/models/entity_info_py3.py | 102 ---- .../models/entity_parent_group_info_py3.py | 30 -- .../mgmt/costmanagement/models/error_base.py | 46 -- .../costmanagement/models/error_details.py | 13 +- .../models/error_details_py3.py | 15 +- .../mgmt/costmanagement/models/export.py | 67 +++ .../models/export_delivery_destination.py | 46 ++ .../models/export_delivery_destination_py3.py | 46 ++ .../models/export_delivery_info.py | 36 ++ .../models/export_delivery_info_py3.py | 36 ++ .../costmanagement/models/export_execution.py | 86 ++++ .../models/export_execution_list_result.py | 35 ++ ...py => export_execution_list_result_py3.py} | 27 +- .../models/export_execution_py3.py | 86 ++++ ...nt_group_info.py => export_list_result.py} | 24 +- .../models/export_list_result_py3.py | 36 ++ .../mgmt/costmanagement/models/export_py3.py | 67 +++ .../models/export_recurrence_period.py | 38 ++ .../models/export_recurrence_period_py3.py | 38 ++ .../costmanagement/models/export_schedule.py | 48 ++ .../models/export_schedule_py3.py | 48 ++ .../external_billing_account_definition.py | 60 --- ...ternal_billing_account_definition_paged.py | 27 - ...external_billing_account_definition_py3.py | 60 --- .../external_subscription_definition.py | 65 --- .../external_subscription_definition_paged.py | 27 - .../external_subscription_definition_py3.py | 65 --- ...ig_aggregation.py => query_aggregation.py} | 6 +- ...gation_py3.py => query_aggregation_py3.py} | 6 +- ...sion.py => query_comparison_expression.py} | 20 +- ....py => query_comparison_expression_py3.py} | 22 +- ...ort_config_dataset.py => query_dataset.py} | 44 +- ...tion.py => query_dataset_configuration.py} | 10 +- ....py => query_dataset_configuration_py3.py} | 10 +- ...ig_dataset_py3.py => query_dataset_py3.py} | 44 +- ...nfig_definition.py => query_definition.py} | 31 +- ...inition_py3.py => query_definition_py3.py} | 31 +- ...eport_config_filter.py => query_filter.py} | 29 +- ...nfig_filter_py3.py => query_filter_py3.py} | 29 +- ...t_config_grouping.py => query_grouping.py} | 12 +- ..._grouping_py3.py => query_grouping_py3.py} | 12 +- ...ting.py => query_sorting_configuration.py} | 27 +- .../models/query_sorting_configuration_py3.py | 34 ++ ...ig_time_period.py => query_time_period.py} | 6 +- ...period_py3.py => query_time_period_py3.py} | 6 +- .../models/report_config_sorting_py3.py | 39 -- .../costmanagement/operations/__init__.py | 12 +- .../operations/cloud_connector_operations.py | 334 ------------ .../operations/dimensions_operations.py | 479 +---------------- .../operations/entities_operations.py | 111 ---- .../operations/exports_operations.py | 460 +++++++++++++++++ .../external_billing_account_operations.py | 156 ------ .../external_subscription_operations.py | 339 ------------- .../operations/forecast_operations.py | 480 ------------------ .../costmanagement/operations/operations.py | 6 +- .../operations/query_operations.py | 411 +-------------- 71 files changed, 1651 insertions(+), 3739 deletions(-) create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/common_export_properties.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/common_export_properties_py3.py delete mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_error_info.py delete mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_error_info_py3.py delete mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_info.py delete mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_info_py3.py delete mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_definition.py delete mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_definition_paged.py delete mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_definition_py3.py delete mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_info.py delete mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_info_paged.py delete mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_info_py3.py delete mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_parent_group_info_py3.py delete mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_base.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_destination.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_destination_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_info.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_info_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution_list_result.py rename azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/{error_base_py3.py => export_execution_list_result_py3.py} (50%) create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution_py3.py rename azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/{entity_parent_group_info.py => export_list_result.py} (52%) create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_list_result_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_recurrence_period.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_recurrence_period_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_schedule.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_schedule_py3.py delete mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_billing_account_definition.py delete mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_billing_account_definition_paged.py delete mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_billing_account_definition_py3.py delete mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_subscription_definition.py delete mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_subscription_definition_paged.py delete mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_subscription_definition_py3.py rename azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/{report_config_aggregation.py => query_aggregation.py} (88%) rename azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/{report_config_aggregation_py3.py => query_aggregation_py3.py} (88%) rename azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/{report_config_comparison_expression.py => query_comparison_expression.py} (72%) rename azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/{report_config_comparison_expression_py3.py => query_comparison_expression_py3.py} (68%) rename azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/{report_config_dataset.py => query_dataset.py} (51%) rename azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/{report_config_dataset_configuration.py => query_dataset_configuration.py} (75%) rename azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/{report_config_dataset_configuration_py3.py => query_dataset_configuration_py3.py} (75%) rename azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/{report_config_dataset_py3.py => query_dataset_py3.py} (51%) rename azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/{report_config_definition.py => query_definition.py} (58%) rename azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/{report_config_definition_py3.py => query_definition_py3.py} (58%) rename azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/{report_config_filter.py => query_filter.py} (59%) rename azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/{report_config_filter_py3.py => query_filter_py3.py} (58%) rename azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/{report_config_grouping.py => query_grouping.py} (74%) rename azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/{report_config_grouping_py3.py => query_grouping_py3.py} (74%) rename azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/{report_config_sorting.py => query_sorting_configuration.py} (52%) create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_sorting_configuration_py3.py rename azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/{report_config_time_period.py => query_time_period.py} (87%) rename azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/{report_config_time_period_py3.py => query_time_period_py3.py} (87%) delete mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_sorting_py3.py delete mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/cloud_connector_operations.py delete mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/entities_operations.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/exports_operations.py delete mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/external_billing_account_operations.py delete mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/external_subscription_operations.py delete mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/forecast_operations.py diff --git a/azure-mgmt-costmanagement/README.rst b/azure-mgmt-costmanagement/README.rst index 45de4e6b43dd..d0429ebc7565 100644 --- a/azure-mgmt-costmanagement/README.rst +++ b/azure-mgmt-costmanagement/README.rst @@ -14,25 +14,6 @@ For the older Azure Service Management (ASM) libraries, see For a more complete set of Azure libraries, see the `azure `__ bundle package. -Compatibility -============= - -**IMPORTANT**: If you have an earlier version of the azure package -(version < 1.0), you should uninstall it before installing this package. - -You can check the version using pip: - -.. code:: shell - - pip freeze - -If you see azure==0.11.0 (or any version below 1.0), uninstall it first: - -.. code:: shell - - pip uninstall azure - - Usage ===== 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 7c6ed75c6e33..cc8458f1727e 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/cost_management_client.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/cost_management_client.py @@ -15,11 +15,7 @@ from .version import VERSION from .operations.dimensions_operations import DimensionsOperations from .operations.query_operations import QueryOperations -from .operations.forecast_operations import ForecastOperations -from .operations.cloud_connector_operations import CloudConnectorOperations -from .operations.external_billing_account_operations import ExternalBillingAccountOperations -from .operations.external_subscription_operations import ExternalSubscriptionOperations -from .operations.entities_operations import EntitiesOperations +from .operations.exports_operations import ExportsOperations from .operations.operations import Operations from . import models @@ -66,16 +62,8 @@ class CostManagementClient(SDKClient): :vartype dimensions: azure.mgmt.costmanagement.operations.DimensionsOperations :ivar query: Query operations :vartype query: azure.mgmt.costmanagement.operations.QueryOperations - :ivar forecast: Forecast operations - :vartype forecast: azure.mgmt.costmanagement.operations.ForecastOperations - :ivar cloud_connector: CloudConnector operations - :vartype cloud_connector: azure.mgmt.costmanagement.operations.CloudConnectorOperations - :ivar external_billing_account: ExternalBillingAccount operations - :vartype external_billing_account: azure.mgmt.costmanagement.operations.ExternalBillingAccountOperations - :ivar external_subscription: ExternalSubscription operations - :vartype external_subscription: azure.mgmt.costmanagement.operations.ExternalSubscriptionOperations - :ivar entities: Entities operations - :vartype entities: azure.mgmt.costmanagement.operations.EntitiesOperations + :ivar exports: Exports operations + :vartype exports: azure.mgmt.costmanagement.operations.ExportsOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.costmanagement.operations.Operations @@ -94,7 +82,7 @@ def __init__( super(CostManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2019-03-01-preview' + self.api_version = '2019-01-01' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) @@ -102,15 +90,7 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.query = QueryOperations( self._client, self.config, self._serialize, self._deserialize) - self.forecast = ForecastOperations( - self._client, self.config, self._serialize, self._deserialize) - self.cloud_connector = CloudConnectorOperations( - self._client, self.config, self._serialize, self._deserialize) - self.external_billing_account = ExternalBillingAccountOperations( - self._client, self.config, self._serialize, self._deserialize) - self.external_subscription = ExternalSubscriptionOperations( - self._client, self.config, self._serialize, self._deserialize) - self.entities = EntitiesOperations( + self.exports = ExportsOperations( self._client, self.config, self._serialize, self._deserialize) self.operations = Operations( self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py index 7e3edca4af5e..1fc845d344b9 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py @@ -10,110 +10,111 @@ # -------------------------------------------------------------------------- try: - from .error_base_py3 import ErrorBase from .error_details_py3 import ErrorDetails from .error_response_py3 import ErrorResponse, ErrorResponseException from .resource_py3 import Resource - from .report_config_time_period_py3 import ReportConfigTimePeriod - from .report_config_dataset_configuration_py3 import ReportConfigDatasetConfiguration - from .report_config_aggregation_py3 import ReportConfigAggregation - from .report_config_grouping_py3 import ReportConfigGrouping - from .report_config_sorting_py3 import ReportConfigSorting - from .report_config_comparison_expression_py3 import ReportConfigComparisonExpression - from .report_config_filter_py3 import ReportConfigFilter - from .report_config_dataset_py3 import ReportConfigDataset - from .report_config_definition_py3 import ReportConfigDefinition from .dimension_py3 import Dimension from .query_column_py3 import QueryColumn from .query_py3 import Query - from .connector_collection_error_info_py3 import ConnectorCollectionErrorInfo - from .connector_collection_info_py3 import ConnectorCollectionInfo - from .connector_definition_py3 import ConnectorDefinition - from .external_billing_account_definition_py3 import ExternalBillingAccountDefinition - from .external_subscription_definition_py3 import ExternalSubscriptionDefinition - from .entity_parent_group_info_py3 import EntityParentGroupInfo - from .entity_info_py3 import EntityInfo from .operation_display_py3 import OperationDisplay from .operation_py3 import Operation + from .query_time_period_py3 import QueryTimePeriod + from .query_dataset_configuration_py3 import QueryDatasetConfiguration + from .query_aggregation_py3 import QueryAggregation + from .query_grouping_py3 import QueryGrouping + from .query_sorting_configuration_py3 import QuerySortingConfiguration + from .query_comparison_expression_py3 import QueryComparisonExpression + from .query_filter_py3 import QueryFilter + from .query_dataset_py3 import QueryDataset + from .query_definition_py3 import QueryDefinition + from .export_recurrence_period_py3 import ExportRecurrencePeriod + from .export_schedule_py3 import ExportSchedule + from .export_py3 import Export + from .export_list_result_py3 import ExportListResult + from .export_delivery_destination_py3 import ExportDeliveryDestination + from .export_delivery_info_py3 import ExportDeliveryInfo + from .common_export_properties_py3 import CommonExportProperties + from .export_execution_py3 import ExportExecution + from .export_execution_list_result_py3 import ExportExecutionListResult except (SyntaxError, ImportError): - from .error_base import ErrorBase from .error_details import ErrorDetails from .error_response import ErrorResponse, ErrorResponseException from .resource import Resource - from .report_config_time_period import ReportConfigTimePeriod - from .report_config_dataset_configuration import ReportConfigDatasetConfiguration - from .report_config_aggregation import ReportConfigAggregation - from .report_config_grouping import ReportConfigGrouping - from .report_config_sorting import ReportConfigSorting - from .report_config_comparison_expression import ReportConfigComparisonExpression - from .report_config_filter import ReportConfigFilter - from .report_config_dataset import ReportConfigDataset - from .report_config_definition import ReportConfigDefinition from .dimension import Dimension from .query_column import QueryColumn from .query import Query - from .connector_collection_error_info import ConnectorCollectionErrorInfo - from .connector_collection_info import ConnectorCollectionInfo - from .connector_definition import ConnectorDefinition - from .external_billing_account_definition import ExternalBillingAccountDefinition - from .external_subscription_definition import ExternalSubscriptionDefinition - from .entity_parent_group_info import EntityParentGroupInfo - from .entity_info import EntityInfo from .operation_display import OperationDisplay from .operation import Operation + from .query_time_period import QueryTimePeriod + from .query_dataset_configuration import QueryDatasetConfiguration + from .query_aggregation import QueryAggregation + from .query_grouping import QueryGrouping + from .query_sorting_configuration import QuerySortingConfiguration + from .query_comparison_expression import QueryComparisonExpression + from .query_filter import QueryFilter + from .query_dataset import QueryDataset + from .query_definition import QueryDefinition + from .export_recurrence_period import ExportRecurrencePeriod + from .export_schedule import ExportSchedule + from .export import Export + from .export_list_result import ExportListResult + from .export_delivery_destination import ExportDeliveryDestination + from .export_delivery_info import ExportDeliveryInfo + from .common_export_properties import CommonExportProperties + from .export_execution import ExportExecution + from .export_execution_list_result import ExportExecutionListResult from .dimension_paged import DimensionPaged from .query_paged import QueryPaged -from .connector_definition_paged import ConnectorDefinitionPaged -from .external_billing_account_definition_paged import ExternalBillingAccountDefinitionPaged -from .external_subscription_definition_paged import ExternalSubscriptionDefinitionPaged -from .entity_info_paged import EntityInfoPaged from .operation_paged import OperationPaged from .cost_management_client_enums import ( TimeframeType, GranularityType, - ReportConfigColumnType, - OperatorType, - ConnectorStatus, - ConnectorBillingModel, + QueryColumnType, + SortDirection, + StatusType, + RecurrenceType, + FormatType, + ExecutionType, + ExecutionStatus, ) __all__ = [ - 'ErrorBase', 'ErrorDetails', 'ErrorResponse', 'ErrorResponseException', 'Resource', - 'ReportConfigTimePeriod', - 'ReportConfigDatasetConfiguration', - 'ReportConfigAggregation', - 'ReportConfigGrouping', - 'ReportConfigSorting', - 'ReportConfigComparisonExpression', - 'ReportConfigFilter', - 'ReportConfigDataset', - 'ReportConfigDefinition', 'Dimension', 'QueryColumn', 'Query', - 'ConnectorCollectionErrorInfo', - 'ConnectorCollectionInfo', - 'ConnectorDefinition', - 'ExternalBillingAccountDefinition', - 'ExternalSubscriptionDefinition', - 'EntityParentGroupInfo', - 'EntityInfo', 'OperationDisplay', 'Operation', + 'QueryTimePeriod', + 'QueryDatasetConfiguration', + 'QueryAggregation', + 'QueryGrouping', + 'QuerySortingConfiguration', + 'QueryComparisonExpression', + 'QueryFilter', + 'QueryDataset', + 'QueryDefinition', + 'ExportRecurrencePeriod', + 'ExportSchedule', + 'Export', + 'ExportListResult', + 'ExportDeliveryDestination', + 'ExportDeliveryInfo', + 'CommonExportProperties', + 'ExportExecution', + 'ExportExecutionListResult', 'DimensionPaged', 'QueryPaged', - 'ConnectorDefinitionPaged', - 'ExternalBillingAccountDefinitionPaged', - 'ExternalSubscriptionDefinitionPaged', - 'EntityInfoPaged', 'OperationPaged', 'TimeframeType', 'GranularityType', - 'ReportConfigColumnType', - 'OperatorType', - 'ConnectorStatus', - 'ConnectorBillingModel', + 'QueryColumnType', + 'SortDirection', + 'StatusType', + 'RecurrenceType', + 'FormatType', + 'ExecutionType', + 'ExecutionStatus', ] diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/common_export_properties.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/common_export_properties.py new file mode 100644 index 000000000000..9024a61aeff2 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/common_export_properties.py @@ -0,0 +1,44 @@ +# 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 CommonExportProperties(Model): + """The common properties of the export. + + All required parameters must be populated in order to send to Azure. + + :param format: The format of the export being delivered. Possible values + include: 'Csv' + :type format: str or ~azure.mgmt.costmanagement.models.FormatType + :param delivery_info: Required. Has delivery information for the export. + :type delivery_info: ~azure.mgmt.costmanagement.models.ExportDeliveryInfo + :param definition: Required. Has definition for the export. + :type definition: ~azure.mgmt.costmanagement.models.QueryDefinition + """ + + _validation = { + 'delivery_info': {'required': True}, + 'definition': {'required': True}, + } + + _attribute_map = { + 'format': {'key': 'format', 'type': 'str'}, + 'delivery_info': {'key': 'deliveryInfo', 'type': 'ExportDeliveryInfo'}, + 'definition': {'key': 'definition', 'type': 'QueryDefinition'}, + } + + def __init__(self, **kwargs): + super(CommonExportProperties, self).__init__(**kwargs) + 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/common_export_properties_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/common_export_properties_py3.py new file mode 100644 index 000000000000..6841ba2a2dce --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/common_export_properties_py3.py @@ -0,0 +1,44 @@ +# 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 CommonExportProperties(Model): + """The common properties of the export. + + All required parameters must be populated in order to send to Azure. + + :param format: The format of the export being delivered. Possible values + include: 'Csv' + :type format: str or ~azure.mgmt.costmanagement.models.FormatType + :param delivery_info: Required. Has delivery information for the export. + :type delivery_info: ~azure.mgmt.costmanagement.models.ExportDeliveryInfo + :param definition: Required. Has definition for the export. + :type definition: ~azure.mgmt.costmanagement.models.QueryDefinition + """ + + _validation = { + 'delivery_info': {'required': True}, + 'definition': {'required': True}, + } + + _attribute_map = { + 'format': {'key': 'format', 'type': 'str'}, + 'delivery_info': {'key': 'deliveryInfo', 'type': 'ExportDeliveryInfo'}, + 'definition': {'key': 'definition', 'type': 'QueryDefinition'}, + } + + def __init__(self, *, delivery_info, definition, format=None, **kwargs) -> None: + super(CommonExportProperties, self).__init__(**kwargs) + self.format = format + self.delivery_info = delivery_info + self.definition = definition diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_error_info.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_error_info.py deleted file mode 100644 index 74d4eb5288f1..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_error_info.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ConnectorCollectionErrorInfo(Model): - """Details of any error encountered on last collection attempt. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar error_message: Detailed error message - :vartype error_message: str - :ivar error_inner_message: External Provider error message - :vartype error_inner_message: str - :ivar error_code: Short error code - :vartype error_code: str - :ivar error_start_time: Time the error started occurring (Last time error - occurred in lastChecked) - :vartype error_start_time: datetime - """ - - _validation = { - 'error_message': {'readonly': True}, - 'error_inner_message': {'readonly': True}, - 'error_code': {'readonly': True}, - 'error_start_time': {'readonly': True}, - } - - _attribute_map = { - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'error_inner_message': {'key': 'errorInnerMessage', 'type': 'str'}, - 'error_code': {'key': 'errorCode', 'type': 'str'}, - 'error_start_time': {'key': 'errorStartTime', 'type': 'iso-8601'}, - } - - def __init__(self, **kwargs): - super(ConnectorCollectionErrorInfo, self).__init__(**kwargs) - self.error_message = None - self.error_inner_message = None - self.error_code = None - self.error_start_time = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_error_info_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_error_info_py3.py deleted file mode 100644 index 8d26ae24a8ca..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_error_info_py3.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ConnectorCollectionErrorInfo(Model): - """Details of any error encountered on last collection attempt. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar error_message: Detailed error message - :vartype error_message: str - :ivar error_inner_message: External Provider error message - :vartype error_inner_message: str - :ivar error_code: Short error code - :vartype error_code: str - :ivar error_start_time: Time the error started occurring (Last time error - occurred in lastChecked) - :vartype error_start_time: datetime - """ - - _validation = { - 'error_message': {'readonly': True}, - 'error_inner_message': {'readonly': True}, - 'error_code': {'readonly': True}, - 'error_start_time': {'readonly': True}, - } - - _attribute_map = { - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'error_inner_message': {'key': 'errorInnerMessage', 'type': 'str'}, - 'error_code': {'key': 'errorCode', 'type': 'str'}, - 'error_start_time': {'key': 'errorStartTime', 'type': 'iso-8601'}, - } - - def __init__(self, **kwargs) -> None: - super(ConnectorCollectionErrorInfo, self).__init__(**kwargs) - self.error_message = None - self.error_inner_message = None - self.error_code = None - self.error_start_time = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_info.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_info.py deleted file mode 100644 index ad4397017060..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_info.py +++ /dev/null @@ -1,52 +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 ConnectorCollectionInfo(Model): - """Collection and ingestion information. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar last_checked: Last time the data acquisition process initiated - connecting to the external provider - :vartype last_checked: datetime - :ivar source_last_updated: Source timestamp of external data currently - available in Azure (eg AWS last processed CUR file timestamp) - :vartype source_last_updated: datetime - :ivar last_updated: Last time the external data was updated into Azure - :vartype last_updated: datetime - :param error: Error information of last collection - :type error: - ~azure.mgmt.costmanagement.models.ConnectorCollectionErrorInfo - """ - - _validation = { - 'last_checked': {'readonly': True}, - 'source_last_updated': {'readonly': True}, - 'last_updated': {'readonly': True}, - } - - _attribute_map = { - 'last_checked': {'key': 'lastChecked', 'type': 'iso-8601'}, - 'source_last_updated': {'key': 'sourceLastUpdated', 'type': 'iso-8601'}, - 'last_updated': {'key': 'lastUpdated', 'type': 'iso-8601'}, - 'error': {'key': 'error', 'type': 'ConnectorCollectionErrorInfo'}, - } - - def __init__(self, **kwargs): - super(ConnectorCollectionInfo, self).__init__(**kwargs) - self.last_checked = None - self.source_last_updated = None - self.last_updated = None - self.error = kwargs.get('error', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_info_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_info_py3.py deleted file mode 100644 index ce4cfe464f52..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_info_py3.py +++ /dev/null @@ -1,52 +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 ConnectorCollectionInfo(Model): - """Collection and ingestion information. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar last_checked: Last time the data acquisition process initiated - connecting to the external provider - :vartype last_checked: datetime - :ivar source_last_updated: Source timestamp of external data currently - available in Azure (eg AWS last processed CUR file timestamp) - :vartype source_last_updated: datetime - :ivar last_updated: Last time the external data was updated into Azure - :vartype last_updated: datetime - :param error: Error information of last collection - :type error: - ~azure.mgmt.costmanagement.models.ConnectorCollectionErrorInfo - """ - - _validation = { - 'last_checked': {'readonly': True}, - 'source_last_updated': {'readonly': True}, - 'last_updated': {'readonly': True}, - } - - _attribute_map = { - 'last_checked': {'key': 'lastChecked', 'type': 'iso-8601'}, - 'source_last_updated': {'key': 'sourceLastUpdated', 'type': 'iso-8601'}, - 'last_updated': {'key': 'lastUpdated', 'type': 'iso-8601'}, - 'error': {'key': 'error', 'type': 'ConnectorCollectionErrorInfo'}, - } - - def __init__(self, *, error=None, **kwargs) -> None: - super(ConnectorCollectionInfo, self).__init__(**kwargs) - self.last_checked = None - self.source_last_updated = None - self.last_updated = None - self.error = error diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_definition.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_definition.py deleted file mode 100644 index 1c52fbbed1a0..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_definition.py +++ /dev/null @@ -1,112 +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 ConnectorDefinition(Model): - """The Connector model definition. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param kind: Connector kind (eg aws) - :type kind: str - :ivar id: Connector id - :vartype id: str - :ivar name: Connector name - :vartype name: str - :ivar type: Connector type - :vartype type: str - :param display_name: Connector DisplayName - :type display_name: str - :ivar provider_account_id: Connector providerAccountId (determined from - credentials) - :vartype provider_account_id: str - :param credentials_key: Credentials authentication key (eg AWS ARN) - :type credentials_key: str - :param credentials_secret: Credentials secret (eg AWS ExternalId) - :type credentials_secret: str - :param report_id: Identifying source report. (For AWS this is a CUR report - name, defined with Daily and with Resources) - :type report_id: str - :ivar created_on: Connector definition creation datetime - :vartype created_on: datetime - :ivar modified_on: Connector last modified datetime - :vartype modified_on: datetime - :param status: Connector status. Possible values include: 'active', - 'error', 'suspended' - :type status: str or ~azure.mgmt.costmanagement.models.ConnectorStatus - :param default_management_group_id: Default ManagementGroupId - :type default_management_group_id: str - :param subscription_id: Billing SubscriptionId - :type subscription_id: str - :param billing_model: Connector billing model. Possible values include: - 'trial', 'autoUpgrade', 'premium', 'expired' - :type billing_model: str or - ~azure.mgmt.costmanagement.models.ConnectorBillingModel - :ivar days_trial_remaining: Number of days remaining of trial - :vartype days_trial_remaining: int - :ivar collection_info: Collection information - :vartype collection_info: - ~azure.mgmt.costmanagement.models.ConnectorCollectionInfo - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'provider_account_id': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'days_trial_remaining': {'readonly': True}, - 'collection_info': {'readonly': True}, - } - - _attribute_map = { - 'kind': {'key': 'kind', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'provider_account_id': {'key': 'properties.providerAccountId', 'type': 'str'}, - 'credentials_key': {'key': 'properties.credentialsKey', 'type': 'str'}, - 'credentials_secret': {'key': 'properties.credentialsSecret', 'type': 'str'}, - 'report_id': {'key': 'properties.reportId', 'type': 'str'}, - 'created_on': {'key': 'properties.createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'properties.modifiedOn', 'type': 'iso-8601'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'default_management_group_id': {'key': 'properties.defaultManagementGroupId', 'type': 'str'}, - 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, - 'billing_model': {'key': 'properties.billingModel', 'type': 'str'}, - 'days_trial_remaining': {'key': 'properties.daysTrialRemaining', 'type': 'int'}, - 'collection_info': {'key': 'properties.collectionInfo', 'type': 'ConnectorCollectionInfo'}, - } - - def __init__(self, **kwargs): - super(ConnectorDefinition, self).__init__(**kwargs) - self.kind = kwargs.get('kind', None) - self.id = None - self.name = None - self.type = None - self.display_name = kwargs.get('display_name', None) - self.provider_account_id = None - self.credentials_key = kwargs.get('credentials_key', None) - self.credentials_secret = kwargs.get('credentials_secret', None) - self.report_id = kwargs.get('report_id', None) - self.created_on = None - self.modified_on = None - self.status = kwargs.get('status', None) - self.default_management_group_id = kwargs.get('default_management_group_id', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.billing_model = kwargs.get('billing_model', None) - self.days_trial_remaining = None - self.collection_info = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_definition_paged.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_definition_paged.py deleted file mode 100644 index 23e223c92208..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_definition_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class ConnectorDefinitionPaged(Paged): - """ - A paging container for iterating over a list of :class:`ConnectorDefinition ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ConnectorDefinition]'} - } - - def __init__(self, *args, **kwargs): - - super(ConnectorDefinitionPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_definition_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_definition_py3.py deleted file mode 100644 index 39c96d302e55..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_definition_py3.py +++ /dev/null @@ -1,112 +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 ConnectorDefinition(Model): - """The Connector model definition. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param kind: Connector kind (eg aws) - :type kind: str - :ivar id: Connector id - :vartype id: str - :ivar name: Connector name - :vartype name: str - :ivar type: Connector type - :vartype type: str - :param display_name: Connector DisplayName - :type display_name: str - :ivar provider_account_id: Connector providerAccountId (determined from - credentials) - :vartype provider_account_id: str - :param credentials_key: Credentials authentication key (eg AWS ARN) - :type credentials_key: str - :param credentials_secret: Credentials secret (eg AWS ExternalId) - :type credentials_secret: str - :param report_id: Identifying source report. (For AWS this is a CUR report - name, defined with Daily and with Resources) - :type report_id: str - :ivar created_on: Connector definition creation datetime - :vartype created_on: datetime - :ivar modified_on: Connector last modified datetime - :vartype modified_on: datetime - :param status: Connector status. Possible values include: 'active', - 'error', 'suspended' - :type status: str or ~azure.mgmt.costmanagement.models.ConnectorStatus - :param default_management_group_id: Default ManagementGroupId - :type default_management_group_id: str - :param subscription_id: Billing SubscriptionId - :type subscription_id: str - :param billing_model: Connector billing model. Possible values include: - 'trial', 'autoUpgrade', 'premium', 'expired' - :type billing_model: str or - ~azure.mgmt.costmanagement.models.ConnectorBillingModel - :ivar days_trial_remaining: Number of days remaining of trial - :vartype days_trial_remaining: int - :ivar collection_info: Collection information - :vartype collection_info: - ~azure.mgmt.costmanagement.models.ConnectorCollectionInfo - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'provider_account_id': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'days_trial_remaining': {'readonly': True}, - 'collection_info': {'readonly': True}, - } - - _attribute_map = { - 'kind': {'key': 'kind', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'provider_account_id': {'key': 'properties.providerAccountId', 'type': 'str'}, - 'credentials_key': {'key': 'properties.credentialsKey', 'type': 'str'}, - 'credentials_secret': {'key': 'properties.credentialsSecret', 'type': 'str'}, - 'report_id': {'key': 'properties.reportId', 'type': 'str'}, - 'created_on': {'key': 'properties.createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'properties.modifiedOn', 'type': 'iso-8601'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'default_management_group_id': {'key': 'properties.defaultManagementGroupId', 'type': 'str'}, - 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, - 'billing_model': {'key': 'properties.billingModel', 'type': 'str'}, - 'days_trial_remaining': {'key': 'properties.daysTrialRemaining', 'type': 'int'}, - 'collection_info': {'key': 'properties.collectionInfo', 'type': 'ConnectorCollectionInfo'}, - } - - def __init__(self, *, kind: str=None, display_name: str=None, credentials_key: str=None, credentials_secret: str=None, report_id: str=None, status=None, default_management_group_id: str=None, subscription_id: str=None, billing_model=None, **kwargs) -> None: - super(ConnectorDefinition, self).__init__(**kwargs) - self.kind = kind - self.id = None - self.name = None - self.type = None - self.display_name = display_name - self.provider_account_id = None - self.credentials_key = credentials_key - self.credentials_secret = credentials_secret - self.report_id = report_id - self.created_on = None - self.modified_on = None - self.status = status - self.default_management_group_id = default_management_group_id - self.subscription_id = subscription_id - self.billing_model = billing_model - self.days_trial_remaining = None - self.collection_info = None 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 24088511f298..26507b572db1 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 @@ -17,37 +17,61 @@ class TimeframeType(str, Enum): week_to_date = "WeekToDate" month_to_date = "MonthToDate" year_to_date = "YearToDate" + the_last_week = "TheLastWeek" + the_last_month = "TheLastMonth" + the_last_year = "TheLastYear" custom = "Custom" class GranularityType(str, Enum): daily = "Daily" - monthly = "Monthly" + hourly = "Hourly" -class ReportConfigColumnType(str, Enum): +class QueryColumnType(str, Enum): tag = "Tag" dimension = "Dimension" -class OperatorType(str, Enum): +class SortDirection(str, Enum): + + ascending = "Ascending" + descending = "Descending" + + +class StatusType(str, Enum): + + active = "Active" + inactive = "Inactive" + + +class RecurrenceType(str, Enum): + + daily = "Daily" + weekly = "Weekly" + monthly = "Monthly" + annually = "Annually" + + +class FormatType(str, Enum): - in_enum = "In" - contains = "Contains" + csv = "Csv" -class ConnectorStatus(str, Enum): +class ExecutionType(str, Enum): - active = "active" - error = "error" - suspended = "suspended" + on_demand = "OnDemand" + scheduled = "Scheduled" -class ConnectorBillingModel(str, Enum): +class ExecutionStatus(str, Enum): - trial = "trial" - auto_upgrade = "autoUpgrade" - premium = "premium" - expired = "expired" + queued = "Queued" + in_progress = "InProgress" + completed = "Completed" + failed = "Failed" + timeout = "Timeout" + new_data_not_available = "NewDataNotAvailable" + data_not_available = "DataNotAvailable" diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_info.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_info.py deleted file mode 100644 index 996a86f4e81d..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_info.py +++ /dev/null @@ -1,102 +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 EntityInfo(Model): - """The entity. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: The fully qualified ID for the entity. For example, - /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 - :vartype id: str - :ivar type: The type of the resource. For example, - /providers/Microsoft.Management/managementGroups - :vartype type: str - :ivar name: The name of the entity. For example, - 00000000-0000-0000-0000-000000000000 - :vartype name: str - :ivar kind: The kind of the resource - :vartype kind: str - :param tenant_id: The AAD Tenant ID associated with the entity. For - example, 00000000-0000-0000-0000-000000000000 - :type tenant_id: str - :param display_name: The friendly name of the management group. - :type display_name: str - :param parent: Parent. - :type parent: ~azure.mgmt.costmanagement.models.EntityParentGroupInfo - :param permissions: Permissions. Possible values include: 'noaccess', - 'view', 'edit', 'delete' - :type permissions: str or ~azure.mgmt.costmanagement.models.enum - :param inherited_permissions: Inherited Permissions. Possible values - include: 'noaccess', 'view', 'edit', 'delete' - :type inherited_permissions: str or ~azure.mgmt.costmanagement.models.enum - :param number_of_descendants: Number of Descendants. - :type number_of_descendants: int - :param number_of_children: Number of Children. Number of children is the - number of Groups and Subscriptions that are exactly one level underneath - the current Group. - :type number_of_children: int - :param number_of_child_groups: Number of Child Groups. Number of child - groups is the number of Groups that are exactly one level underneath the - current Group. - :type number_of_child_groups: int - :param parent_display_name_chain: The parent display name chain from the - root group to the immediate parent - :type parent_display_name_chain: list[str] - :param parent_name_chain: The parent name chain from the root group to the - immediate parent - :type parent_name_chain: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'type': {'readonly': True}, - 'name': {'readonly': True}, - 'kind': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'parent': {'key': 'properties.parent', 'type': 'EntityParentGroupInfo'}, - 'permissions': {'key': 'properties.permissions', 'type': 'str'}, - 'inherited_permissions': {'key': 'properties.inheritedPermissions', 'type': 'str'}, - 'number_of_descendants': {'key': 'properties.numberOfDescendants', 'type': 'int'}, - 'number_of_children': {'key': 'properties.numberOfChildren', 'type': 'int'}, - 'number_of_child_groups': {'key': 'properties.numberOfChildGroups', 'type': 'int'}, - 'parent_display_name_chain': {'key': 'properties.parentDisplayNameChain', 'type': '[str]'}, - 'parent_name_chain': {'key': 'properties.parentNameChain', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(EntityInfo, self).__init__(**kwargs) - self.id = None - self.type = None - self.name = None - self.kind = None - self.tenant_id = kwargs.get('tenant_id', None) - self.display_name = kwargs.get('display_name', None) - self.parent = kwargs.get('parent', None) - self.permissions = kwargs.get('permissions', None) - self.inherited_permissions = kwargs.get('inherited_permissions', None) - self.number_of_descendants = kwargs.get('number_of_descendants', None) - self.number_of_children = kwargs.get('number_of_children', None) - self.number_of_child_groups = kwargs.get('number_of_child_groups', None) - self.parent_display_name_chain = kwargs.get('parent_display_name_chain', None) - self.parent_name_chain = kwargs.get('parent_name_chain', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_info_paged.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_info_paged.py deleted file mode 100644 index d7a741cef532..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_info_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class EntityInfoPaged(Paged): - """ - A paging container for iterating over a list of :class:`EntityInfo ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[EntityInfo]'} - } - - def __init__(self, *args, **kwargs): - - super(EntityInfoPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_info_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_info_py3.py deleted file mode 100644 index 7f44120d0fd9..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_info_py3.py +++ /dev/null @@ -1,102 +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 EntityInfo(Model): - """The entity. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: The fully qualified ID for the entity. For example, - /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 - :vartype id: str - :ivar type: The type of the resource. For example, - /providers/Microsoft.Management/managementGroups - :vartype type: str - :ivar name: The name of the entity. For example, - 00000000-0000-0000-0000-000000000000 - :vartype name: str - :ivar kind: The kind of the resource - :vartype kind: str - :param tenant_id: The AAD Tenant ID associated with the entity. For - example, 00000000-0000-0000-0000-000000000000 - :type tenant_id: str - :param display_name: The friendly name of the management group. - :type display_name: str - :param parent: Parent. - :type parent: ~azure.mgmt.costmanagement.models.EntityParentGroupInfo - :param permissions: Permissions. Possible values include: 'noaccess', - 'view', 'edit', 'delete' - :type permissions: str or ~azure.mgmt.costmanagement.models.enum - :param inherited_permissions: Inherited Permissions. Possible values - include: 'noaccess', 'view', 'edit', 'delete' - :type inherited_permissions: str or ~azure.mgmt.costmanagement.models.enum - :param number_of_descendants: Number of Descendants. - :type number_of_descendants: int - :param number_of_children: Number of Children. Number of children is the - number of Groups and Subscriptions that are exactly one level underneath - the current Group. - :type number_of_children: int - :param number_of_child_groups: Number of Child Groups. Number of child - groups is the number of Groups that are exactly one level underneath the - current Group. - :type number_of_child_groups: int - :param parent_display_name_chain: The parent display name chain from the - root group to the immediate parent - :type parent_display_name_chain: list[str] - :param parent_name_chain: The parent name chain from the root group to the - immediate parent - :type parent_name_chain: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'type': {'readonly': True}, - 'name': {'readonly': True}, - 'kind': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'parent': {'key': 'properties.parent', 'type': 'EntityParentGroupInfo'}, - 'permissions': {'key': 'properties.permissions', 'type': 'str'}, - 'inherited_permissions': {'key': 'properties.inheritedPermissions', 'type': 'str'}, - 'number_of_descendants': {'key': 'properties.numberOfDescendants', 'type': 'int'}, - 'number_of_children': {'key': 'properties.numberOfChildren', 'type': 'int'}, - 'number_of_child_groups': {'key': 'properties.numberOfChildGroups', 'type': 'int'}, - 'parent_display_name_chain': {'key': 'properties.parentDisplayNameChain', 'type': '[str]'}, - 'parent_name_chain': {'key': 'properties.parentNameChain', 'type': '[str]'}, - } - - def __init__(self, *, tenant_id: str=None, display_name: str=None, parent=None, permissions=None, inherited_permissions=None, number_of_descendants: int=None, number_of_children: int=None, number_of_child_groups: int=None, parent_display_name_chain=None, parent_name_chain=None, **kwargs) -> None: - super(EntityInfo, self).__init__(**kwargs) - self.id = None - self.type = None - self.name = None - self.kind = None - self.tenant_id = tenant_id - self.display_name = display_name - self.parent = parent - self.permissions = permissions - self.inherited_permissions = inherited_permissions - self.number_of_descendants = number_of_descendants - self.number_of_children = number_of_children - self.number_of_child_groups = number_of_child_groups - self.parent_display_name_chain = parent_display_name_chain - self.parent_name_chain = parent_name_chain diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_parent_group_info_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_parent_group_info_py3.py deleted file mode 100644 index b0275df6a41f..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_parent_group_info_py3.py +++ /dev/null @@ -1,30 +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 EntityParentGroupInfo(Model): - """(Optional) The ID of the parent management group. - - :param id: The fully qualified ID for the parent management group. For - example, - /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__(self, *, id: str=None, **kwargs) -> None: - super(EntityParentGroupInfo, self).__init__(**kwargs) - self.id = id diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_base.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_base.py deleted file mode 100644 index 06850f19f08c..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_base.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 ErrorBase(Model): - """The details of the error. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar code: A machine readable error code. - :vartype code: str - :ivar message: A human readable error message. - :vartype message: str - :ivar target: Indicates which property in the request is responsible for - the error. - :vartype target: str - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ErrorBase, self).__init__(**kwargs) - self.code = None - self.message = None - self.target = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details.py index 0c5831e7ee91..03f3e23d2153 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details.py @@ -18,15 +18,10 @@ class ErrorDetails(Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar code: A machine readable error code. + :ivar code: Error code. :vartype code: str - :ivar message: A human readable error message. + :ivar message: Error message indicating why the operation failed. :vartype message: str - :param target: Indicates which property in the request is responsible for - the error. - :type target: str - :param details: error details. - :type details: list[~azure.mgmt.costmanagement.models.ErrorBase] """ _validation = { @@ -37,13 +32,9 @@ class ErrorDetails(Model): _attribute_map = { 'code': {'key': 'code', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorBase]'}, } def __init__(self, **kwargs): super(ErrorDetails, self).__init__(**kwargs) self.code = None self.message = None - self.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details_py3.py index 3d4a63c6ab50..f9e1adeac9fe 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details_py3.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details_py3.py @@ -18,15 +18,10 @@ class ErrorDetails(Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar code: A machine readable error code. + :ivar code: Error code. :vartype code: str - :ivar message: A human readable error message. + :ivar message: Error message indicating why the operation failed. :vartype message: str - :param target: Indicates which property in the request is responsible for - the error. - :type target: str - :param details: error details. - :type details: list[~azure.mgmt.costmanagement.models.ErrorBase] """ _validation = { @@ -37,13 +32,9 @@ class ErrorDetails(Model): _attribute_map = { 'code': {'key': 'code', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorBase]'}, } - def __init__(self, *, target: str=None, details=None, **kwargs) -> None: + def __init__(self, **kwargs) -> None: super(ErrorDetails, self).__init__(**kwargs) self.code = None self.message = None - self.target = target - self.details = details diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export.py new file mode 100644 index 000000000000..9ec61149f406 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class Export(Resource): + """A export 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 format: The format of the export being delivered. Possible values + include: 'Csv' + :type format: str or ~azure.mgmt.costmanagement.models.FormatType + :param delivery_info: Required. Has delivery information for the export. + :type delivery_info: ~azure.mgmt.costmanagement.models.ExportDeliveryInfo + :param definition: Required. Has definition for the export. + :type definition: ~azure.mgmt.costmanagement.models.QueryDefinition + :param schedule: Has schedule information for the export. + :type schedule: ~azure.mgmt.costmanagement.models.ExportSchedule + """ + + _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}'}, + 'format': {'key': 'properties.format', 'type': 'str'}, + 'delivery_info': {'key': 'properties.deliveryInfo', 'type': 'ExportDeliveryInfo'}, + 'definition': {'key': 'properties.definition', 'type': 'QueryDefinition'}, + 'schedule': {'key': 'properties.schedule', 'type': 'ExportSchedule'}, + } + + def __init__(self, **kwargs): + super(Export, self).__init__(**kwargs) + self.format = kwargs.get('format', None) + self.delivery_info = kwargs.get('delivery_info', None) + self.definition = kwargs.get('definition', None) + self.schedule = kwargs.get('schedule', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_destination.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_destination.py new file mode 100644 index 000000000000..949d25357d8e --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_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 ExportDeliveryDestination(Model): + """The destination information for the delivery of the export. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. The resource id of the storage account where + exports will be delivered. + :type resource_id: str + :param container: Required. The name of the container where exports will + be uploaded. + :type container: str + :param root_folder_path: The name of the directory where exports 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(ExportDeliveryDestination, 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/export_delivery_destination_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_destination_py3.py new file mode 100644 index 000000000000..3f2f70bffd4a --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_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 ExportDeliveryDestination(Model): + """The destination information for the delivery of the export. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. The resource id of the storage account where + exports will be delivered. + :type resource_id: str + :param container: Required. The name of the container where exports will + be uploaded. + :type container: str + :param root_folder_path: The name of the directory where exports 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(ExportDeliveryDestination, 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/export_delivery_info.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_info.py new file mode 100644 index 000000000000..996aa73156d6 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_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 ExportDeliveryInfo(Model): + """The delivery information associated with a export. + + All required parameters must be populated in order to send to Azure. + + :param destination: Required. Has destination for the export being + delivered. + :type destination: + ~azure.mgmt.costmanagement.models.ExportDeliveryDestination + """ + + _validation = { + 'destination': {'required': True}, + } + + _attribute_map = { + 'destination': {'key': 'destination', 'type': 'ExportDeliveryDestination'}, + } + + def __init__(self, **kwargs): + super(ExportDeliveryInfo, self).__init__(**kwargs) + self.destination = kwargs.get('destination', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_info_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_info_py3.py new file mode 100644 index 000000000000..43fce117f331 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_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 ExportDeliveryInfo(Model): + """The delivery information associated with a export. + + All required parameters must be populated in order to send to Azure. + + :param destination: Required. Has destination for the export being + delivered. + :type destination: + ~azure.mgmt.costmanagement.models.ExportDeliveryDestination + """ + + _validation = { + 'destination': {'required': True}, + } + + _attribute_map = { + 'destination': {'key': 'destination', 'type': 'ExportDeliveryDestination'}, + } + + def __init__(self, *, destination, **kwargs) -> None: + super(ExportDeliveryInfo, self).__init__(**kwargs) + self.destination = destination diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution.py new file mode 100644 index 000000000000..7843f0594630 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution.py @@ -0,0 +1,86 @@ +# 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 ExportExecution(Resource): + """A export execution. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :param execution_type: The type of the export execution. Possible values + include: 'OnDemand', 'Scheduled' + :type execution_type: str or + ~azure.mgmt.costmanagement.models.ExecutionType + :param status: The status of the export execution. Possible values + include: 'Queued', 'InProgress', 'Completed', 'Failed', 'Timeout', + 'NewDataNotAvailable', 'DataNotAvailable' + :type status: str or ~azure.mgmt.costmanagement.models.ExecutionStatus + :param submitted_by: The identifier for the entity that executed the + export. For OnDemand executions, it is the email id. For Scheduled + executions, it is the constant value - System. + :type submitted_by: str + :param submitted_time: The time when export was queued to be executed. + :type submitted_time: datetime + :param processing_start_time: The time when export was picked up to be + executed. + :type processing_start_time: datetime + :param processing_end_time: The time when export execution finished. + :type processing_end_time: datetime + :param file_name: The name of the file export got written to. + :type file_name: str + :param run_settings: + :type run_settings: + ~azure.mgmt.costmanagement.models.CommonExportProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'execution_type': {'key': 'properties.executionType', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'submitted_by': {'key': 'properties.submittedBy', 'type': 'str'}, + 'submitted_time': {'key': 'properties.submittedTime', 'type': 'iso-8601'}, + 'processing_start_time': {'key': 'properties.processingStartTime', 'type': 'iso-8601'}, + 'processing_end_time': {'key': 'properties.processingEndTime', 'type': 'iso-8601'}, + 'file_name': {'key': 'properties.fileName', 'type': 'str'}, + 'run_settings': {'key': 'properties.runSettings', 'type': 'CommonExportProperties'}, + } + + def __init__(self, **kwargs): + super(ExportExecution, self).__init__(**kwargs) + self.execution_type = kwargs.get('execution_type', None) + self.status = kwargs.get('status', None) + self.submitted_by = kwargs.get('submitted_by', None) + self.submitted_time = kwargs.get('submitted_time', None) + self.processing_start_time = kwargs.get('processing_start_time', None) + self.processing_end_time = kwargs.get('processing_end_time', None) + self.file_name = kwargs.get('file_name', None) + self.run_settings = kwargs.get('run_settings', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution_list_result.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution_list_result.py new file mode 100644 index 000000000000..d3a017601d17 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution_list_result.py @@ -0,0 +1,35 @@ +# 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 ExportExecutionListResult(Model): + """Result of listing exports execution history of a export by name. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of export executions. + :vartype value: list[~azure.mgmt.costmanagement.models.ExportExecution] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExportExecution]'}, + } + + def __init__(self, **kwargs): + super(ExportExecutionListResult, self).__init__(**kwargs) + self.value = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_base_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution_list_result_py3.py similarity index 50% rename from azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_base_py3.py rename to azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution_list_result_py3.py index ce93c67b953b..ae37c54c2e60 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_base_py3.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution_list_result_py3.py @@ -12,35 +12,24 @@ from msrest.serialization import Model -class ErrorBase(Model): - """The details of the error. +class ExportExecutionListResult(Model): + """Result of listing exports execution history of a export by name. Variables are only populated by the server, and will be ignored when sending a request. - :ivar code: A machine readable error code. - :vartype code: str - :ivar message: A human readable error message. - :vartype message: str - :ivar target: Indicates which property in the request is responsible for - the error. - :vartype target: str + :ivar value: The list of export executions. + :vartype value: list[~azure.mgmt.costmanagement.models.ExportExecution] """ _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, + 'value': {'readonly': True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[ExportExecution]'}, } def __init__(self, **kwargs) -> None: - super(ErrorBase, self).__init__(**kwargs) - self.code = None - self.message = None - self.target = None + super(ExportExecutionListResult, self).__init__(**kwargs) + self.value = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution_py3.py new file mode 100644 index 000000000000..00d8281329cc --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution_py3.py @@ -0,0 +1,86 @@ +# 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 ExportExecution(Resource): + """A export execution. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :param execution_type: The type of the export execution. Possible values + include: 'OnDemand', 'Scheduled' + :type execution_type: str or + ~azure.mgmt.costmanagement.models.ExecutionType + :param status: The status of the export execution. Possible values + include: 'Queued', 'InProgress', 'Completed', 'Failed', 'Timeout', + 'NewDataNotAvailable', 'DataNotAvailable' + :type status: str or ~azure.mgmt.costmanagement.models.ExecutionStatus + :param submitted_by: The identifier for the entity that executed the + export. For OnDemand executions, it is the email id. For Scheduled + executions, it is the constant value - System. + :type submitted_by: str + :param submitted_time: The time when export was queued to be executed. + :type submitted_time: datetime + :param processing_start_time: The time when export was picked up to be + executed. + :type processing_start_time: datetime + :param processing_end_time: The time when export execution finished. + :type processing_end_time: datetime + :param file_name: The name of the file export got written to. + :type file_name: str + :param run_settings: + :type run_settings: + ~azure.mgmt.costmanagement.models.CommonExportProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'execution_type': {'key': 'properties.executionType', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'submitted_by': {'key': 'properties.submittedBy', 'type': 'str'}, + 'submitted_time': {'key': 'properties.submittedTime', 'type': 'iso-8601'}, + 'processing_start_time': {'key': 'properties.processingStartTime', 'type': 'iso-8601'}, + 'processing_end_time': {'key': 'properties.processingEndTime', 'type': 'iso-8601'}, + 'file_name': {'key': 'properties.fileName', 'type': 'str'}, + 'run_settings': {'key': 'properties.runSettings', 'type': 'CommonExportProperties'}, + } + + def __init__(self, *, execution_type=None, status=None, submitted_by: str=None, submitted_time=None, processing_start_time=None, processing_end_time=None, file_name: str=None, run_settings=None, **kwargs) -> None: + super(ExportExecution, self).__init__(**kwargs) + self.execution_type = execution_type + self.status = status + self.submitted_by = submitted_by + self.submitted_time = submitted_time + self.processing_start_time = processing_start_time + self.processing_end_time = processing_end_time + self.file_name = file_name + self.run_settings = run_settings diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_parent_group_info.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_list_result.py similarity index 52% rename from azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_parent_group_info.py rename to azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_list_result.py index 7e26dca6f12c..0a894f869f41 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_parent_group_info.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_list_result.py @@ -12,19 +12,25 @@ from msrest.serialization import Model -class EntityParentGroupInfo(Model): - """(Optional) The ID of the parent management group. +class ExportListResult(Model): + """Result of listing exports. It contains a list of available exports in the + scope provided. - :param id: The fully qualified ID for the parent management group. For - example, - /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 - :type id: str + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of exports. + :vartype value: list[~azure.mgmt.costmanagement.models.Export] """ + _validation = { + 'value': {'readonly': True}, + } + _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[Export]'}, } def __init__(self, **kwargs): - super(EntityParentGroupInfo, self).__init__(**kwargs) - self.id = kwargs.get('id', None) + super(ExportListResult, self).__init__(**kwargs) + self.value = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_list_result_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_list_result_py3.py new file mode 100644 index 000000000000..562f78ca565e --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_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 ExportListResult(Model): + """Result of listing exports. It contains a list of available exports in the + scope provided. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of exports. + :vartype value: list[~azure.mgmt.costmanagement.models.Export] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Export]'}, + } + + def __init__(self, **kwargs) -> None: + super(ExportListResult, self).__init__(**kwargs) + self.value = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_py3.py new file mode 100644 index 000000000000..bf8cbd862cb0 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_py3.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class Export(Resource): + """A export 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 format: The format of the export being delivered. Possible values + include: 'Csv' + :type format: str or ~azure.mgmt.costmanagement.models.FormatType + :param delivery_info: Required. Has delivery information for the export. + :type delivery_info: ~azure.mgmt.costmanagement.models.ExportDeliveryInfo + :param definition: Required. Has definition for the export. + :type definition: ~azure.mgmt.costmanagement.models.QueryDefinition + :param schedule: Has schedule information for the export. + :type schedule: ~azure.mgmt.costmanagement.models.ExportSchedule + """ + + _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}'}, + 'format': {'key': 'properties.format', 'type': 'str'}, + 'delivery_info': {'key': 'properties.deliveryInfo', 'type': 'ExportDeliveryInfo'}, + 'definition': {'key': 'properties.definition', 'type': 'QueryDefinition'}, + 'schedule': {'key': 'properties.schedule', 'type': 'ExportSchedule'}, + } + + def __init__(self, *, delivery_info, definition, format=None, schedule=None, **kwargs) -> None: + super(Export, self).__init__(**kwargs) + self.format = format + self.delivery_info = delivery_info + self.definition = definition + self.schedule = schedule diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_recurrence_period.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_recurrence_period.py new file mode 100644 index 000000000000..928221e85bfa --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_recurrence_period.py @@ -0,0 +1,38 @@ +# 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 ExportRecurrencePeriod(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. + :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(ExportRecurrencePeriod, 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/export_recurrence_period_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_recurrence_period_py3.py new file mode 100644 index 000000000000..98cc8316fb69 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_recurrence_period_py3.py @@ -0,0 +1,38 @@ +# 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 ExportRecurrencePeriod(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. + :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(ExportRecurrencePeriod, self).__init__(**kwargs) + self.from_property = from_property + self.to = to diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_schedule.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_schedule.py new file mode 100644 index 000000000000..29ed33f58aa3 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_schedule.py @@ -0,0 +1,48 @@ +# 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 ExportSchedule(Model): + """The schedule associated with a export. + + 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 export'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: 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.ExportRecurrencePeriod + """ + + _validation = { + 'recurrence': {'required': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'recurrence': {'key': 'recurrence', 'type': 'str'}, + 'recurrence_period': {'key': 'recurrencePeriod', 'type': 'ExportRecurrencePeriod'}, + } + + def __init__(self, **kwargs): + super(ExportSchedule, 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/export_schedule_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_schedule_py3.py new file mode 100644 index 000000000000..76235e40c282 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_schedule_py3.py @@ -0,0 +1,48 @@ +# 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 ExportSchedule(Model): + """The schedule associated with a export. + + 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 export'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: 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.ExportRecurrencePeriod + """ + + _validation = { + 'recurrence': {'required': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'recurrence': {'key': 'recurrence', 'type': 'str'}, + 'recurrence_period': {'key': 'recurrencePeriod', 'type': 'ExportRecurrencePeriod'}, + } + + def __init__(self, *, recurrence, status=None, recurrence_period=None, **kwargs) -> None: + super(ExportSchedule, self).__init__(**kwargs) + self.status = status + self.recurrence = recurrence + self.recurrence_period = recurrence_period diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_billing_account_definition.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_billing_account_definition.py deleted file mode 100644 index 5d18ffc55489..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_billing_account_definition.py +++ /dev/null @@ -1,60 +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 ExternalBillingAccountDefinition(Model): - """The ExternalBillingAccount model definition. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: ExternalBillingAccount id - :vartype id: str - :ivar name: ExternalBillingAccount name - :vartype name: str - :ivar type: ExternalBillingAccount type - :vartype type: str - :ivar kind: ExternalBillingAccount kind (eg aws) - :vartype kind: str - :ivar display_name: ExternalBillingAccount DisplayName - :vartype display_name: str - :ivar connector_id: Underlying ConnectorId - :vartype connector_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kind': {'readonly': True}, - 'display_name': {'readonly': True}, - 'connector_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'connector_id': {'key': 'properties.connectorId', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ExternalBillingAccountDefinition, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.kind = None - self.display_name = None - self.connector_id = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_billing_account_definition_paged.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_billing_account_definition_paged.py deleted file mode 100644 index ecb1d48256b3..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_billing_account_definition_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class ExternalBillingAccountDefinitionPaged(Paged): - """ - A paging container for iterating over a list of :class:`ExternalBillingAccountDefinition ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ExternalBillingAccountDefinition]'} - } - - def __init__(self, *args, **kwargs): - - super(ExternalBillingAccountDefinitionPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_billing_account_definition_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_billing_account_definition_py3.py deleted file mode 100644 index 7d1a93a5b22b..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_billing_account_definition_py3.py +++ /dev/null @@ -1,60 +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 ExternalBillingAccountDefinition(Model): - """The ExternalBillingAccount model definition. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: ExternalBillingAccount id - :vartype id: str - :ivar name: ExternalBillingAccount name - :vartype name: str - :ivar type: ExternalBillingAccount type - :vartype type: str - :ivar kind: ExternalBillingAccount kind (eg aws) - :vartype kind: str - :ivar display_name: ExternalBillingAccount DisplayName - :vartype display_name: str - :ivar connector_id: Underlying ConnectorId - :vartype connector_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kind': {'readonly': True}, - 'display_name': {'readonly': True}, - 'connector_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'connector_id': {'key': 'properties.connectorId', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(ExternalBillingAccountDefinition, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.kind = None - self.display_name = None - self.connector_id = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_subscription_definition.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_subscription_definition.py deleted file mode 100644 index b76ef94e4e4c..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_subscription_definition.py +++ /dev/null @@ -1,65 +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 ExternalSubscriptionDefinition(Model): - """The ExternalSubscription model definition. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: ExternalSubscription id - :vartype id: str - :ivar name: ExternalSubscription name - :vartype name: str - :ivar type: ExternalSubscription type - :vartype type: str - :ivar kind: ExternalSubscription kind (eg aws) - :vartype kind: str - :ivar display_name: ExternalSubscription DisplayName - :vartype display_name: str - :ivar management_group_id: Assigned ManagementGroupId - :vartype management_group_id: str - :ivar external_billing_account_id: Parent ExternalBillingAccountId - :vartype external_billing_account_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kind': {'readonly': True}, - 'display_name': {'readonly': True}, - 'management_group_id': {'readonly': True}, - 'external_billing_account_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'management_group_id': {'key': 'properties.managementGroupId', 'type': 'str'}, - 'external_billing_account_id': {'key': 'properties.externalBillingAccountId', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ExternalSubscriptionDefinition, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.kind = None - self.display_name = None - self.management_group_id = None - self.external_billing_account_id = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_subscription_definition_paged.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_subscription_definition_paged.py deleted file mode 100644 index f137ed1927ec..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_subscription_definition_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class ExternalSubscriptionDefinitionPaged(Paged): - """ - A paging container for iterating over a list of :class:`ExternalSubscriptionDefinition ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ExternalSubscriptionDefinition]'} - } - - def __init__(self, *args, **kwargs): - - super(ExternalSubscriptionDefinitionPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_subscription_definition_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_subscription_definition_py3.py deleted file mode 100644 index 5fa8fc479604..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_subscription_definition_py3.py +++ /dev/null @@ -1,65 +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 ExternalSubscriptionDefinition(Model): - """The ExternalSubscription model definition. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: ExternalSubscription id - :vartype id: str - :ivar name: ExternalSubscription name - :vartype name: str - :ivar type: ExternalSubscription type - :vartype type: str - :ivar kind: ExternalSubscription kind (eg aws) - :vartype kind: str - :ivar display_name: ExternalSubscription DisplayName - :vartype display_name: str - :ivar management_group_id: Assigned ManagementGroupId - :vartype management_group_id: str - :ivar external_billing_account_id: Parent ExternalBillingAccountId - :vartype external_billing_account_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kind': {'readonly': True}, - 'display_name': {'readonly': True}, - 'management_group_id': {'readonly': True}, - 'external_billing_account_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'management_group_id': {'key': 'properties.managementGroupId', 'type': 'str'}, - 'external_billing_account_id': {'key': 'properties.externalBillingAccountId', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(ExternalSubscriptionDefinition, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.kind = None - self.display_name = None - self.management_group_id = None - self.external_billing_account_id = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_aggregation.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_aggregation.py similarity index 88% rename from azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_aggregation.py rename to azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_aggregation.py index 0f148c5e80c6..d6b23a1e6980 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_aggregation.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_aggregation.py @@ -12,8 +12,8 @@ from msrest.serialization import Model -class ReportConfigAggregation(Model): - """The aggregation expression to be used in the report. +class QueryAggregation(Model): + """The aggregation expression to be used in the query. Variables are only populated by the server, and will be ignored when sending a request. @@ -40,5 +40,5 @@ class ReportConfigAggregation(Model): function = "Sum" def __init__(self, **kwargs): - super(ReportConfigAggregation, self).__init__(**kwargs) + super(QueryAggregation, self).__init__(**kwargs) self.name = kwargs.get('name', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_aggregation_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_aggregation_py3.py similarity index 88% rename from azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_aggregation_py3.py rename to azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_aggregation_py3.py index 61cf2de5e8ed..653dd6683433 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_aggregation_py3.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_aggregation_py3.py @@ -12,8 +12,8 @@ from msrest.serialization import Model -class ReportConfigAggregation(Model): - """The aggregation expression to be used in the report. +class QueryAggregation(Model): + """The aggregation expression to be used in the query. Variables are only populated by the server, and will be ignored when sending a request. @@ -40,5 +40,5 @@ class ReportConfigAggregation(Model): function = "Sum" def __init__(self, *, name: str, **kwargs) -> None: - super(ReportConfigAggregation, self).__init__(**kwargs) + super(QueryAggregation, self).__init__(**kwargs) self.name = name diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_comparison_expression.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_comparison_expression.py similarity index 72% rename from azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_comparison_expression.py rename to azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_comparison_expression.py index 1969db241c17..c932b1a9a232 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_comparison_expression.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_comparison_expression.py @@ -12,23 +12,26 @@ from msrest.serialization import Model -class ReportConfigComparisonExpression(Model): - """The comparison expression to be used in the report. +class QueryComparisonExpression(Model): + """The comparison expression to be used in the query. + + 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. :param name: Required. The name of the column to use in comparison. :type name: str - :param operator: Required. The operator to use for comparison. Possible - values include: 'In', 'Contains' - :type operator: str or ~azure.mgmt.costmanagement.models.OperatorType + :ivar operator: Required. The operator to use for comparison. Default + value: "In" . + :vartype operator: str :param values: Required. Array of values to use for comparison :type values: list[str] """ _validation = { 'name': {'required': True}, - 'operator': {'required': True}, + 'operator': {'required': True, 'constant': True}, 'values': {'required': True, 'min_items': 1}, } @@ -38,8 +41,9 @@ class ReportConfigComparisonExpression(Model): 'values': {'key': 'values', 'type': '[str]'}, } + operator = "In" + def __init__(self, **kwargs): - super(ReportConfigComparisonExpression, self).__init__(**kwargs) + super(QueryComparisonExpression, self).__init__(**kwargs) self.name = kwargs.get('name', None) - self.operator = kwargs.get('operator', None) self.values = kwargs.get('values', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_comparison_expression_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_comparison_expression_py3.py similarity index 68% rename from azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_comparison_expression_py3.py rename to azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_comparison_expression_py3.py index 27dc0cdc1ea7..d7f1f445571a 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_comparison_expression_py3.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_comparison_expression_py3.py @@ -12,23 +12,26 @@ from msrest.serialization import Model -class ReportConfigComparisonExpression(Model): - """The comparison expression to be used in the report. +class QueryComparisonExpression(Model): + """The comparison expression to be used in the query. + + 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. :param name: Required. The name of the column to use in comparison. :type name: str - :param operator: Required. The operator to use for comparison. Possible - values include: 'In', 'Contains' - :type operator: str or ~azure.mgmt.costmanagement.models.OperatorType + :ivar operator: Required. The operator to use for comparison. Default + value: "In" . + :vartype operator: str :param values: Required. Array of values to use for comparison :type values: list[str] """ _validation = { 'name': {'required': True}, - 'operator': {'required': True}, + 'operator': {'required': True, 'constant': True}, 'values': {'required': True, 'min_items': 1}, } @@ -38,8 +41,9 @@ class ReportConfigComparisonExpression(Model): 'values': {'key': 'values', 'type': '[str]'}, } - def __init__(self, *, name: str, operator, values, **kwargs) -> None: - super(ReportConfigComparisonExpression, self).__init__(**kwargs) + operator = "In" + + def __init__(self, *, name: str, values, **kwargs) -> None: + super(QueryComparisonExpression, self).__init__(**kwargs) self.name = name - self.operator = operator self.values = values diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset.py similarity index 51% rename from azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset.py rename to azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset.py index c65641a3008c..f34f504aa888 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset.py @@ -12,31 +12,31 @@ from msrest.serialization import Model -class ReportConfigDataset(Model): - """The definition of data present in the report. +class QueryDataset(Model): + """The definition of data present in the query. - :param granularity: The granularity of rows in the report. Possible values - include: 'Daily', 'Monthly' + :param granularity: The granularity of rows in the query. Possible values + include: 'Daily', 'Hourly' :type granularity: str or ~azure.mgmt.costmanagement.models.GranularityType :param configuration: Has configuration information for the data in the - report. The configuration will be ignored if aggregation and grouping are + export. The configuration will be ignored if aggregation and grouping are provided. :type configuration: - ~azure.mgmt.costmanagement.models.ReportConfigDatasetConfiguration + ~azure.mgmt.costmanagement.models.QueryDatasetConfiguration :param aggregation: Dictionary of aggregation expression to use in the - report. The key of each item in the dictionary is the alias for the - aggregated column. Report can have up to 2 aggregation clauses. + query. The key of each item in the dictionary is the alias for the + aggregated column. Query can have up to 2 aggregation clauses. :type aggregation: dict[str, - ~azure.mgmt.costmanagement.models.ReportConfigAggregation] - :param grouping: Array of group by expression to use in the report. Report + ~azure.mgmt.costmanagement.models.QueryAggregation] + :param grouping: Array of group by expression to use in the query. Query can have up to 2 group by clauses. - :type grouping: - list[~azure.mgmt.costmanagement.models.ReportConfigGrouping] - :param sorting: Array of order by expression to use in the report. - :type sorting: list[~azure.mgmt.costmanagement.models.ReportConfigSorting] - :param filter: Has filter expression to use in the report. - :type filter: ~azure.mgmt.costmanagement.models.ReportConfigFilter + :type grouping: list[~azure.mgmt.costmanagement.models.QueryGrouping] + :param sorting: Array of sorting by columns in query. + :type sorting: + list[~azure.mgmt.costmanagement.models.QuerySortingConfiguration] + :param filter: Has filter expression to use in the query. + :type filter: ~azure.mgmt.costmanagement.models.QueryFilter """ _validation = { @@ -45,15 +45,15 @@ class ReportConfigDataset(Model): _attribute_map = { 'granularity': {'key': 'granularity', 'type': 'str'}, - 'configuration': {'key': 'configuration', 'type': 'ReportConfigDatasetConfiguration'}, - 'aggregation': {'key': 'aggregation', 'type': '{ReportConfigAggregation}'}, - 'grouping': {'key': 'grouping', 'type': '[ReportConfigGrouping]'}, - 'sorting': {'key': 'sorting', 'type': '[ReportConfigSorting]'}, - 'filter': {'key': 'filter', 'type': 'ReportConfigFilter'}, + 'configuration': {'key': 'configuration', 'type': 'QueryDatasetConfiguration'}, + 'aggregation': {'key': 'aggregation', 'type': '{QueryAggregation}'}, + 'grouping': {'key': 'grouping', 'type': '[QueryGrouping]'}, + 'sorting': {'key': 'sorting', 'type': '[QuerySortingConfiguration]'}, + 'filter': {'key': 'filter', 'type': 'QueryFilter'}, } def __init__(self, **kwargs): - super(ReportConfigDataset, self).__init__(**kwargs) + super(QueryDataset, self).__init__(**kwargs) self.granularity = kwargs.get('granularity', None) self.configuration = kwargs.get('configuration', None) self.aggregation = kwargs.get('aggregation', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset_configuration.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset_configuration.py similarity index 75% rename from azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset_configuration.py rename to azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset_configuration.py index d22317c6e54c..2b77baab82cc 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset_configuration.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset_configuration.py @@ -12,11 +12,11 @@ from msrest.serialization import Model -class ReportConfigDatasetConfiguration(Model): - """The configuration of dataset in the report. +class QueryDatasetConfiguration(Model): + """The configuration of dataset in the query. - :param columns: Array of column names to be included in the report. Any - valid report column name is allowed. If not provided, then report includes + :param columns: Array of column names to be included in the query. Any + valid query column name is allowed. If not provided, then query includes all columns. :type columns: list[str] """ @@ -26,5 +26,5 @@ class ReportConfigDatasetConfiguration(Model): } def __init__(self, **kwargs): - super(ReportConfigDatasetConfiguration, self).__init__(**kwargs) + super(QueryDatasetConfiguration, self).__init__(**kwargs) self.columns = kwargs.get('columns', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset_configuration_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset_configuration_py3.py similarity index 75% rename from azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset_configuration_py3.py rename to azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset_configuration_py3.py index f0e9bc25d10e..4a660322a527 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset_configuration_py3.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset_configuration_py3.py @@ -12,11 +12,11 @@ from msrest.serialization import Model -class ReportConfigDatasetConfiguration(Model): - """The configuration of dataset in the report. +class QueryDatasetConfiguration(Model): + """The configuration of dataset in the query. - :param columns: Array of column names to be included in the report. Any - valid report column name is allowed. If not provided, then report includes + :param columns: Array of column names to be included in the query. Any + valid query column name is allowed. If not provided, then query includes all columns. :type columns: list[str] """ @@ -26,5 +26,5 @@ class ReportConfigDatasetConfiguration(Model): } def __init__(self, *, columns=None, **kwargs) -> None: - super(ReportConfigDatasetConfiguration, self).__init__(**kwargs) + super(QueryDatasetConfiguration, self).__init__(**kwargs) self.columns = columns diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset_py3.py similarity index 51% rename from azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset_py3.py rename to azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset_py3.py index 1f263ac3f3b4..016173c300c5 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset_py3.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset_py3.py @@ -12,31 +12,31 @@ from msrest.serialization import Model -class ReportConfigDataset(Model): - """The definition of data present in the report. +class QueryDataset(Model): + """The definition of data present in the query. - :param granularity: The granularity of rows in the report. Possible values - include: 'Daily', 'Monthly' + :param granularity: The granularity of rows in the query. Possible values + include: 'Daily', 'Hourly' :type granularity: str or ~azure.mgmt.costmanagement.models.GranularityType :param configuration: Has configuration information for the data in the - report. The configuration will be ignored if aggregation and grouping are + export. The configuration will be ignored if aggregation and grouping are provided. :type configuration: - ~azure.mgmt.costmanagement.models.ReportConfigDatasetConfiguration + ~azure.mgmt.costmanagement.models.QueryDatasetConfiguration :param aggregation: Dictionary of aggregation expression to use in the - report. The key of each item in the dictionary is the alias for the - aggregated column. Report can have up to 2 aggregation clauses. + query. The key of each item in the dictionary is the alias for the + aggregated column. Query can have up to 2 aggregation clauses. :type aggregation: dict[str, - ~azure.mgmt.costmanagement.models.ReportConfigAggregation] - :param grouping: Array of group by expression to use in the report. Report + ~azure.mgmt.costmanagement.models.QueryAggregation] + :param grouping: Array of group by expression to use in the query. Query can have up to 2 group by clauses. - :type grouping: - list[~azure.mgmt.costmanagement.models.ReportConfigGrouping] - :param sorting: Array of order by expression to use in the report. - :type sorting: list[~azure.mgmt.costmanagement.models.ReportConfigSorting] - :param filter: Has filter expression to use in the report. - :type filter: ~azure.mgmt.costmanagement.models.ReportConfigFilter + :type grouping: list[~azure.mgmt.costmanagement.models.QueryGrouping] + :param sorting: Array of sorting by columns in query. + :type sorting: + list[~azure.mgmt.costmanagement.models.QuerySortingConfiguration] + :param filter: Has filter expression to use in the query. + :type filter: ~azure.mgmt.costmanagement.models.QueryFilter """ _validation = { @@ -45,15 +45,15 @@ class ReportConfigDataset(Model): _attribute_map = { 'granularity': {'key': 'granularity', 'type': 'str'}, - 'configuration': {'key': 'configuration', 'type': 'ReportConfigDatasetConfiguration'}, - 'aggregation': {'key': 'aggregation', 'type': '{ReportConfigAggregation}'}, - 'grouping': {'key': 'grouping', 'type': '[ReportConfigGrouping]'}, - 'sorting': {'key': 'sorting', 'type': '[ReportConfigSorting]'}, - 'filter': {'key': 'filter', 'type': 'ReportConfigFilter'}, + 'configuration': {'key': 'configuration', 'type': 'QueryDatasetConfiguration'}, + 'aggregation': {'key': 'aggregation', 'type': '{QueryAggregation}'}, + 'grouping': {'key': 'grouping', 'type': '[QueryGrouping]'}, + 'sorting': {'key': 'sorting', 'type': '[QuerySortingConfiguration]'}, + 'filter': {'key': 'filter', 'type': 'QueryFilter'}, } def __init__(self, *, granularity=None, configuration=None, aggregation=None, grouping=None, sorting=None, filter=None, **kwargs) -> None: - super(ReportConfigDataset, self).__init__(**kwargs) + super(QueryDataset, self).__init__(**kwargs) self.granularity = granularity self.configuration = configuration self.aggregation = aggregation diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_definition.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_definition.py similarity index 58% rename from azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_definition.py rename to azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_definition.py index ab46d7172b0d..2893fb7ba3fc 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_definition.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_definition.py @@ -12,28 +12,25 @@ from msrest.serialization import Model -class ReportConfigDefinition(Model): - """The definition of a report config. +class QueryDefinition(Model): + """The definition of a query. 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 type: Required. The type of the report. Usage represents actual - usage, forecast represents forecasted data and UsageAndForecast represents - both usage and forecasted data. Actual usage and forecasted data can be - differentiated based on dates. Default value: "Usage" . + :ivar type: Required. The type of the query. Default value: "Usage" . :vartype type: str - :param timeframe: Required. The time frame for pulling data for the - report. If custom, then a specific time period must be provided. Possible - values include: 'WeekToDate', 'MonthToDate', 'YearToDate', 'Custom' + :param timeframe: Required. The time frame for pulling data for the query. + If custom, then a specific time period must be provided. Possible values + include: 'WeekToDate', 'MonthToDate', 'YearToDate', 'TheLastWeek', + 'TheLastMonth', 'TheLastYear', 'Custom' :type timeframe: str or ~azure.mgmt.costmanagement.models.TimeframeType - :param time_period: Has time period for pulling data for the report. - :type time_period: - ~azure.mgmt.costmanagement.models.ReportConfigTimePeriod - :param dataset: Has definition for data in this report config. - :type dataset: ~azure.mgmt.costmanagement.models.ReportConfigDataset + :param time_period: Has time period for pulling data for the query. + :type time_period: ~azure.mgmt.costmanagement.models.QueryTimePeriod + :param dataset: Has definition for data in this query. + :type dataset: ~azure.mgmt.costmanagement.models.QueryDataset """ _validation = { @@ -44,14 +41,14 @@ class ReportConfigDefinition(Model): _attribute_map = { 'type': {'key': 'type', 'type': 'str'}, 'timeframe': {'key': 'timeframe', 'type': 'str'}, - 'time_period': {'key': 'timePeriod', 'type': 'ReportConfigTimePeriod'}, - 'dataset': {'key': 'dataset', 'type': 'ReportConfigDataset'}, + 'time_period': {'key': 'timePeriod', 'type': 'QueryTimePeriod'}, + 'dataset': {'key': 'dataset', 'type': 'QueryDataset'}, } type = "Usage" def __init__(self, **kwargs): - super(ReportConfigDefinition, self).__init__(**kwargs) + super(QueryDefinition, self).__init__(**kwargs) self.timeframe = kwargs.get('timeframe', None) self.time_period = kwargs.get('time_period', None) self.dataset = kwargs.get('dataset', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_definition_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_definition_py3.py similarity index 58% rename from azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_definition_py3.py rename to azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_definition_py3.py index 4a03fa138934..bf088e52b50a 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_definition_py3.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_definition_py3.py @@ -12,28 +12,25 @@ from msrest.serialization import Model -class ReportConfigDefinition(Model): - """The definition of a report config. +class QueryDefinition(Model): + """The definition of a query. 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 type: Required. The type of the report. Usage represents actual - usage, forecast represents forecasted data and UsageAndForecast represents - both usage and forecasted data. Actual usage and forecasted data can be - differentiated based on dates. Default value: "Usage" . + :ivar type: Required. The type of the query. Default value: "Usage" . :vartype type: str - :param timeframe: Required. The time frame for pulling data for the - report. If custom, then a specific time period must be provided. Possible - values include: 'WeekToDate', 'MonthToDate', 'YearToDate', 'Custom' + :param timeframe: Required. The time frame for pulling data for the query. + If custom, then a specific time period must be provided. Possible values + include: 'WeekToDate', 'MonthToDate', 'YearToDate', 'TheLastWeek', + 'TheLastMonth', 'TheLastYear', 'Custom' :type timeframe: str or ~azure.mgmt.costmanagement.models.TimeframeType - :param time_period: Has time period for pulling data for the report. - :type time_period: - ~azure.mgmt.costmanagement.models.ReportConfigTimePeriod - :param dataset: Has definition for data in this report config. - :type dataset: ~azure.mgmt.costmanagement.models.ReportConfigDataset + :param time_period: Has time period for pulling data for the query. + :type time_period: ~azure.mgmt.costmanagement.models.QueryTimePeriod + :param dataset: Has definition for data in this query. + :type dataset: ~azure.mgmt.costmanagement.models.QueryDataset """ _validation = { @@ -44,14 +41,14 @@ class ReportConfigDefinition(Model): _attribute_map = { 'type': {'key': 'type', 'type': 'str'}, 'timeframe': {'key': 'timeframe', 'type': 'str'}, - 'time_period': {'key': 'timePeriod', 'type': 'ReportConfigTimePeriod'}, - 'dataset': {'key': 'dataset', 'type': 'ReportConfigDataset'}, + 'time_period': {'key': 'timePeriod', 'type': 'QueryTimePeriod'}, + 'dataset': {'key': 'dataset', 'type': 'QueryDataset'}, } type = "Usage" def __init__(self, *, timeframe, time_period=None, dataset=None, **kwargs) -> None: - super(ReportConfigDefinition, self).__init__(**kwargs) + super(QueryDefinition, self).__init__(**kwargs) self.timeframe = timeframe self.time_period = time_period self.dataset = dataset diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_filter.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_filter.py similarity index 59% rename from azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_filter.py rename to azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_filter.py index 9802f5634ccc..0242d37de76d 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_filter.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_filter.py @@ -12,25 +12,22 @@ from msrest.serialization import Model -class ReportConfigFilter(Model): - """The filter expression to be used in the report. +class QueryFilter(Model): + """The filter expression to be used in the export. :param and_property: The logical "AND" expression. Must have at least 2 items. - :type and_property: - list[~azure.mgmt.costmanagement.models.ReportConfigFilter] + :type and_property: list[~azure.mgmt.costmanagement.models.QueryFilter] :param or_property: The logical "OR" expression. Must have at least 2 items. - :type or_property: - list[~azure.mgmt.costmanagement.models.ReportConfigFilter] + :type or_property: list[~azure.mgmt.costmanagement.models.QueryFilter] :param not_property: The logical "NOT" expression. - :type not_property: ~azure.mgmt.costmanagement.models.ReportConfigFilter + :type not_property: ~azure.mgmt.costmanagement.models.QueryFilter :param dimension: Has comparison expression for a dimension :type dimension: - ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression + ~azure.mgmt.costmanagement.models.QueryComparisonExpression :param tag: Has comparison expression for a tag - :type tag: - ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression + :type tag: ~azure.mgmt.costmanagement.models.QueryComparisonExpression """ _validation = { @@ -39,15 +36,15 @@ class ReportConfigFilter(Model): } _attribute_map = { - 'and_property': {'key': 'and', 'type': '[ReportConfigFilter]'}, - 'or_property': {'key': 'or', 'type': '[ReportConfigFilter]'}, - 'not_property': {'key': 'not', 'type': 'ReportConfigFilter'}, - 'dimension': {'key': 'dimension', 'type': 'ReportConfigComparisonExpression'}, - 'tag': {'key': 'tag', 'type': 'ReportConfigComparisonExpression'}, + 'and_property': {'key': 'and', 'type': '[QueryFilter]'}, + 'or_property': {'key': 'or', 'type': '[QueryFilter]'}, + 'not_property': {'key': 'not', 'type': 'QueryFilter'}, + 'dimension': {'key': 'dimension', 'type': 'QueryComparisonExpression'}, + 'tag': {'key': 'tag', 'type': 'QueryComparisonExpression'}, } def __init__(self, **kwargs): - super(ReportConfigFilter, self).__init__(**kwargs) + super(QueryFilter, self).__init__(**kwargs) self.and_property = kwargs.get('and_property', None) self.or_property = kwargs.get('or_property', None) self.not_property = kwargs.get('not_property', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_filter_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_filter_py3.py similarity index 58% rename from azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_filter_py3.py rename to azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_filter_py3.py index 43521afa34eb..f6e4f0ee5976 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_filter_py3.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_filter_py3.py @@ -12,25 +12,22 @@ from msrest.serialization import Model -class ReportConfigFilter(Model): - """The filter expression to be used in the report. +class QueryFilter(Model): + """The filter expression to be used in the export. :param and_property: The logical "AND" expression. Must have at least 2 items. - :type and_property: - list[~azure.mgmt.costmanagement.models.ReportConfigFilter] + :type and_property: list[~azure.mgmt.costmanagement.models.QueryFilter] :param or_property: The logical "OR" expression. Must have at least 2 items. - :type or_property: - list[~azure.mgmt.costmanagement.models.ReportConfigFilter] + :type or_property: list[~azure.mgmt.costmanagement.models.QueryFilter] :param not_property: The logical "NOT" expression. - :type not_property: ~azure.mgmt.costmanagement.models.ReportConfigFilter + :type not_property: ~azure.mgmt.costmanagement.models.QueryFilter :param dimension: Has comparison expression for a dimension :type dimension: - ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression + ~azure.mgmt.costmanagement.models.QueryComparisonExpression :param tag: Has comparison expression for a tag - :type tag: - ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression + :type tag: ~azure.mgmt.costmanagement.models.QueryComparisonExpression """ _validation = { @@ -39,15 +36,15 @@ class ReportConfigFilter(Model): } _attribute_map = { - 'and_property': {'key': 'and', 'type': '[ReportConfigFilter]'}, - 'or_property': {'key': 'or', 'type': '[ReportConfigFilter]'}, - 'not_property': {'key': 'not', 'type': 'ReportConfigFilter'}, - 'dimension': {'key': 'dimension', 'type': 'ReportConfigComparisonExpression'}, - 'tag': {'key': 'tag', 'type': 'ReportConfigComparisonExpression'}, + 'and_property': {'key': 'and', 'type': '[QueryFilter]'}, + 'or_property': {'key': 'or', 'type': '[QueryFilter]'}, + 'not_property': {'key': 'not', 'type': 'QueryFilter'}, + 'dimension': {'key': 'dimension', 'type': 'QueryComparisonExpression'}, + 'tag': {'key': 'tag', 'type': 'QueryComparisonExpression'}, } def __init__(self, *, and_property=None, or_property=None, not_property=None, dimension=None, tag=None, **kwargs) -> None: - super(ReportConfigFilter, self).__init__(**kwargs) + super(QueryFilter, self).__init__(**kwargs) self.and_property = and_property self.or_property = or_property self.not_property = not_property diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_grouping.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_grouping.py similarity index 74% rename from azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_grouping.py rename to azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_grouping.py index 09ca40f3cda5..ee61a9990685 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_grouping.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_grouping.py @@ -12,17 +12,15 @@ from msrest.serialization import Model -class ReportConfigGrouping(Model): - """The group by expression to be used in the report. +class QueryGrouping(Model): + """The group by expression to be used in the query. All required parameters must be populated in order to send to Azure. :param type: Required. Has type of the column to group. Possible values include: 'Tag', 'Dimension' - :type type: str or - ~azure.mgmt.costmanagement.models.ReportConfigColumnType - :param name: Required. The name of the column to group. This version - supports subscription lowest possible grain. + :type type: str or ~azure.mgmt.costmanagement.models.QueryColumnType + :param name: Required. The name of the column to group. :type name: str """ @@ -37,6 +35,6 @@ class ReportConfigGrouping(Model): } def __init__(self, **kwargs): - super(ReportConfigGrouping, self).__init__(**kwargs) + super(QueryGrouping, self).__init__(**kwargs) self.type = kwargs.get('type', None) self.name = kwargs.get('name', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_grouping_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_grouping_py3.py similarity index 74% rename from azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_grouping_py3.py rename to azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_grouping_py3.py index 317bcf8f3d24..65f4b79f255f 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_grouping_py3.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_grouping_py3.py @@ -12,17 +12,15 @@ from msrest.serialization import Model -class ReportConfigGrouping(Model): - """The group by expression to be used in the report. +class QueryGrouping(Model): + """The group by expression to be used in the query. All required parameters must be populated in order to send to Azure. :param type: Required. Has type of the column to group. Possible values include: 'Tag', 'Dimension' - :type type: str or - ~azure.mgmt.costmanagement.models.ReportConfigColumnType - :param name: Required. The name of the column to group. This version - supports subscription lowest possible grain. + :type type: str or ~azure.mgmt.costmanagement.models.QueryColumnType + :param name: Required. The name of the column to group. :type name: str """ @@ -37,6 +35,6 @@ class ReportConfigGrouping(Model): } def __init__(self, *, type, name: str, **kwargs) -> None: - super(ReportConfigGrouping, self).__init__(**kwargs) + super(QueryGrouping, self).__init__(**kwargs) self.type = type self.name = name diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_sorting.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_sorting_configuration.py similarity index 52% rename from azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_sorting.py rename to azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_sorting_configuration.py index 897bdde4cee5..ea1704928e03 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_sorting.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_sorting_configuration.py @@ -12,28 +12,23 @@ from msrest.serialization import Model -class ReportConfigSorting(Model): - """The order by expression to be used in the report. - - All required parameters must be populated in order to send to Azure. - - :param direction: Direction of sort. Possible values include: 'Ascending', - 'Descending' - :type direction: str or ~azure.mgmt.costmanagement.models.enum - :param name: Required. The name of the column to sort. +class QuerySortingConfiguration(Model): + """The configuration for sorting in the query. + + :param query_sorting_direction: The sorting direction. Possible values + include: 'Ascending', 'Descending' + :type query_sorting_direction: str or + ~azure.mgmt.costmanagement.models.SortDirection + :param name: The name of the column to use in sorting. :type name: str """ - _validation = { - 'name': {'required': True}, - } - _attribute_map = { - 'direction': {'key': 'direction', 'type': 'str'}, + 'query_sorting_direction': {'key': 'querySortingDirection', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, } def __init__(self, **kwargs): - super(ReportConfigSorting, self).__init__(**kwargs) - self.direction = kwargs.get('direction', None) + super(QuerySortingConfiguration, self).__init__(**kwargs) + self.query_sorting_direction = kwargs.get('query_sorting_direction', None) self.name = kwargs.get('name', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_sorting_configuration_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_sorting_configuration_py3.py new file mode 100644 index 000000000000..fc7524c322d3 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_sorting_configuration_py3.py @@ -0,0 +1,34 @@ +# 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 QuerySortingConfiguration(Model): + """The configuration for sorting in the query. + + :param query_sorting_direction: The sorting direction. Possible values + include: 'Ascending', 'Descending' + :type query_sorting_direction: str or + ~azure.mgmt.costmanagement.models.SortDirection + :param name: The name of the column to use in sorting. + :type name: str + """ + + _attribute_map = { + 'query_sorting_direction': {'key': 'querySortingDirection', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, query_sorting_direction=None, name: str=None, **kwargs) -> None: + super(QuerySortingConfiguration, self).__init__(**kwargs) + self.query_sorting_direction = query_sorting_direction + self.name = name diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_time_period.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_time_period.py similarity index 87% rename from azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_time_period.py rename to azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_time_period.py index bc09d4547bb3..3c0dc37b8619 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_time_period.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_time_period.py @@ -12,8 +12,8 @@ from msrest.serialization import Model -class ReportConfigTimePeriod(Model): - """The start and end date for pulling data for the report. +class QueryTimePeriod(Model): + """The start and end date for pulling data for the query. All required parameters must be populated in order to send to Azure. @@ -34,6 +34,6 @@ class ReportConfigTimePeriod(Model): } def __init__(self, **kwargs): - super(ReportConfigTimePeriod, self).__init__(**kwargs) + super(QueryTimePeriod, 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_time_period_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_time_period_py3.py similarity index 87% rename from azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_time_period_py3.py rename to azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_time_period_py3.py index c98826663a11..63a1d7d6e08c 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_time_period_py3.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_time_period_py3.py @@ -12,8 +12,8 @@ from msrest.serialization import Model -class ReportConfigTimePeriod(Model): - """The start and end date for pulling data for the report. +class QueryTimePeriod(Model): + """The start and end date for pulling data for the query. All required parameters must be populated in order to send to Azure. @@ -34,6 +34,6 @@ class ReportConfigTimePeriod(Model): } def __init__(self, *, from_property, to, **kwargs) -> None: - super(ReportConfigTimePeriod, self).__init__(**kwargs) + super(QueryTimePeriod, self).__init__(**kwargs) self.from_property = from_property self.to = to diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_sorting_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_sorting_py3.py deleted file mode 100644 index 910397d8d51b..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_sorting_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 ReportConfigSorting(Model): - """The order by expression to be used in the report. - - All required parameters must be populated in order to send to Azure. - - :param direction: Direction of sort. Possible values include: 'Ascending', - 'Descending' - :type direction: str or ~azure.mgmt.costmanagement.models.enum - :param name: Required. The name of the column to sort. - :type name: str - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'direction': {'key': 'direction', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, name: str, direction=None, **kwargs) -> None: - super(ReportConfigSorting, self).__init__(**kwargs) - self.direction = direction - self.name = name diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py index a255b445f443..fbf3fa761115 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py @@ -11,20 +11,12 @@ from .dimensions_operations import DimensionsOperations from .query_operations import QueryOperations -from .forecast_operations import ForecastOperations -from .cloud_connector_operations import CloudConnectorOperations -from .external_billing_account_operations import ExternalBillingAccountOperations -from .external_subscription_operations import ExternalSubscriptionOperations -from .entities_operations import EntitiesOperations +from .exports_operations import ExportsOperations from .operations import Operations __all__ = [ 'DimensionsOperations', 'QueryOperations', - 'ForecastOperations', - 'CloudConnectorOperations', - 'ExternalBillingAccountOperations', - 'ExternalSubscriptionOperations', - 'EntitiesOperations', + 'ExportsOperations', 'Operations', ] diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/cloud_connector_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/cloud_connector_operations.py deleted file mode 100644 index 1359df81699f..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/cloud_connector_operations.py +++ /dev/null @@ -1,334 +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 CloudConnectorOperations(object): - """CloudConnectorOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2019-03-01-preview. Constant value: "2019-03-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-03-01-preview" - - self.config = config - - def list( - self, custom_headers=None, raw=False, **operation_config): - """List all cloud connector definitions. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ConnectorDefinition - :rtype: - ~azure.mgmt.costmanagement.models.ConnectorDefinitionPaged[~azure.mgmt.costmanagement.models.ConnectorDefinition] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list.metadata['url'] - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.ConnectorDefinitionPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.ConnectorDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/providers/Microsoft.CostManagement/cloudConnectors'} - - def get( - self, connector_name, expand=None, custom_headers=None, raw=False, **operation_config): - """Get a cloud connector definition. - - :param connector_name: Connector Name. - :type connector_name: str - :param expand: May be used to expand the collectionInfo property. By - default, collectionInfo is not included. - :type expand: 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: ConnectorDefinition or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.costmanagement.models.ConnectorDefinition or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'connectorName': self._serialize.url("connector_name", connector_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') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, '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('ConnectorDefinition', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/providers/Microsoft.CostManagement/cloudConnectors/{connectorName}'} - - def create_or_update( - self, connector_name, connector, custom_headers=None, raw=False, **operation_config): - """Create or update a cloud connector definition. - - :param connector_name: Connector Name. - :type connector_name: str - :param connector: Connector details - :type connector: ~azure.mgmt.costmanagement.models.ConnectorDefinition - :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: ConnectorDefinition or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.costmanagement.models.ConnectorDefinition or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.create_or_update.metadata['url'] - path_format_arguments = { - 'connectorName': self._serialize.url("connector_name", connector_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(connector, 'ConnectorDefinition') - - # 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('ConnectorDefinition', response) - if response.status_code == 201: - deserialized = self._deserialize('ConnectorDefinition', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create_or_update.metadata = {'url': '/providers/Microsoft.CostManagement/cloudConnectors/{connectorName}'} - - def delete( - self, connector_name, custom_headers=None, raw=False, **operation_config): - """Delete a cloud connector definition. - - :param connector_name: Connector Name. - :type connector_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 = { - 'connectorName': self._serialize.url("connector_name", connector_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': '/providers/Microsoft.CostManagement/cloudConnectors/{connectorName}'} - - def update( - self, connector_name, connector, custom_headers=None, raw=False, **operation_config): - """Update a cloud connector definition. - - :param connector_name: Connector Name. - :type connector_name: str - :param connector: Connector details - :type connector: ~azure.mgmt.costmanagement.models.ConnectorDefinition - :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: ConnectorDefinition or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.costmanagement.models.ConnectorDefinition or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'connectorName': self._serialize.url("connector_name", connector_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(connector, 'ConnectorDefinition') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - 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('ConnectorDefinition', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update.metadata = {'url': '/providers/Microsoft.CostManagement/cloudConnectors/{connectorName}'} diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/dimensions_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/dimensions_operations.py index 7c79563f7ab1..5bdad8c6f173 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/dimensions_operations.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/dimensions_operations.py @@ -22,7 +22,7 @@ class DimensionsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2019-03-01-preview. Constant value: "2019-03-01-preview". + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-05-31. Constant value: "2019-01-01". """ models = models @@ -32,376 +32,27 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-03-01-preview" + self.api_version = "2019-01-01" self.config = config - def list_by_billing_account( - self, billing_account_id, filter=None, expand=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config): - """Lists the dimensions by billingAccount Id. - - :param billing_account_id: BillingAccount ID - :type billing_account_id: str - :param filter: May be used to filter dimensions by - properties/category, properties/usageStart, properties/usageEnd. - Supported operators are 'eq','lt', 'gt', 'le', 'ge'. - :type filter: str - :param expand: May be used to expand the properties/data within a - dimension category. By default, data is not included when listing - dimensions. - :type expand: str - :param skiptoken: Skiptoken is only used if a previous operation - returned a partial result. If a previous response contains a nextLink - element, the value of the nextLink element will include a skiptoken - parameter that specifies a starting point to use for subsequent calls. - :type skiptoken: str - :param top: May be used to limit the number of results to the most - recent N dimension data. - :type top: int - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Dimension - :rtype: - ~azure.mgmt.costmanagement.models.DimensionPaged[~azure.mgmt.costmanagement.models.Dimension] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_billing_account.metadata['url'] - path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - if skiptoken is not None: - query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.DimensionPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.DimensionPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/dimensions'} - - def list_by_enrollment_account( - self, billing_account_id, enrollment_account_id, filter=None, expand=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config): - """Lists the dimensions by Enrollment Account Id. - - :param billing_account_id: BillingAccount ID - :type billing_account_id: str - :param enrollment_account_id: Enrollment Account ID - :type enrollment_account_id: str - :param filter: May be used to filter dimensions by - properties/category, properties/usageStart, properties/usageEnd. - Supported operators are 'eq','lt', 'gt', 'le', 'ge'. - :type filter: str - :param expand: May be used to expand the properties/data within a - dimension category. By default, data is not included when listing - dimensions. - :type expand: str - :param skiptoken: Skiptoken is only used if a previous operation - returned a partial result. If a previous response contains a nextLink - element, the value of the nextLink element will include a skiptoken - parameter that specifies a starting point to use for subsequent calls. - :type skiptoken: str - :param top: May be used to limit the number of results to the most - recent N dimension data. - :type top: int - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Dimension - :rtype: - ~azure.mgmt.costmanagement.models.DimensionPaged[~azure.mgmt.costmanagement.models.Dimension] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_enrollment_account.metadata['url'] - path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), - 'enrollmentAccountId': self._serialize.url("enrollment_account_id", enrollment_account_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - if skiptoken is not None: - query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.DimensionPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.DimensionPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_enrollment_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}/providers/Microsoft.CostManagement/dimensions'} - - def list_by_department( - self, billing_account_id, department_id, filter=None, expand=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config): - """Lists the dimensions by Department Id. - - :param billing_account_id: BillingAccount ID - :type billing_account_id: str - :param department_id: Department ID - :type department_id: str - :param filter: May be used to filter dimensions by - properties/category, properties/usageStart, properties/usageEnd. - Supported operators are 'eq','lt', 'gt', 'le', 'ge'. - :type filter: str - :param expand: May be used to expand the properties/data within a - dimension category. By default, data is not included when listing - dimensions. - :type expand: str - :param skiptoken: Skiptoken is only used if a previous operation - returned a partial result. If a previous response contains a nextLink - element, the value of the nextLink element will include a skiptoken - parameter that specifies a starting point to use for subsequent calls. - :type skiptoken: str - :param top: May be used to limit the number of results to the most - recent N dimension data. - :type top: int - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Dimension - :rtype: - ~azure.mgmt.costmanagement.models.DimensionPaged[~azure.mgmt.costmanagement.models.Dimension] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_department.metadata['url'] - path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), - 'departmentId': self._serialize.url("department_id", department_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - if skiptoken is not None: - query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.DimensionPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.DimensionPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_department.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}/providers/Microsoft.CostManagement/dimensions'} - - def list_by_management_group( - self, management_group_id, filter=None, expand=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config): - """Lists the dimensions by managementGroup Id. - - :param management_group_id: ManagementGroup ID - :type management_group_id: str - :param filter: May be used to filter dimensions by - properties/category, properties/usageStart, properties/usageEnd. - Supported operators are 'eq','lt', 'gt', 'le', 'ge'. - :type filter: str - :param expand: May be used to expand the properties/data within a - dimension category. By default, data is not included when listing - dimensions. - :type expand: str - :param skiptoken: Skiptoken is only used if a previous operation - returned a partial result. If a previous response contains a nextLink - element, the value of the nextLink element will include a skiptoken - parameter that specifies a starting point to use for subsequent calls. - :type skiptoken: str - :param top: May be used to limit the number of results to the most - recent N dimension data. - :type top: int - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Dimension - :rtype: - ~azure.mgmt.costmanagement.models.DimensionPaged[~azure.mgmt.costmanagement.models.Dimension] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_management_group.metadata['url'] - path_format_arguments = { - 'managementGroupId': self._serialize.url("management_group_id", management_group_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - if skiptoken is not None: - query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.DimensionPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.DimensionPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_management_group.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.CostManagement/dimensions'} - def list_by_subscription( - self, filter=None, expand=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config): - """Lists the dimensions by subscription Id. - + self, scope, filter=None, expand=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config): + """Lists the dimensions by the defined scope. + + :param scope: The scope associated with dimension operations. This + includes '/subscriptions/{subscriptionId}/' for subscription scope, + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' + for resourceGroup scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for + Billing Account scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' + for Department scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + for EnrollmentAccount scope and + '/providers/Microsoft.Management/managementGroups/{managementGroupId}' + for Management Group scope.. + :type scope: str :param filter: May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'. @@ -435,97 +86,7 @@ def internal_paging(next_link=None, raw=False): # Construct URL url = self.list_by_subscription.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') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - if skiptoken is not None: - query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.DimensionPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.DimensionPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CostManagement/dimensions'} - - def list_by_resource_group( - self, resource_group_name, filter=None, expand=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config): - """Lists the dimensions by resource group Id. - - :param resource_group_name: Azure Resource Group Name. - :type resource_group_name: str - :param filter: May be used to filter dimensions by - properties/category, properties/usageStart, properties/usageEnd. - Supported operators are 'eq','lt', 'gt', 'le', 'ge'. - :type filter: str - :param expand: May be used to expand the properties/data within a - dimension category. By default, data is not included when listing - dimensions. - :type expand: str - :param skiptoken: Skiptoken is only used if a previous operation - returned a partial result. If a previous response contains a nextLink - element, the value of the nextLink element will include a skiptoken - parameter that specifies a starting point to use for subsequent calls. - :type skiptoken: str - :param top: May be used to limit the number of results to the most - recent N dimension data. - :type top: int - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Dimension - :rtype: - ~azure.mgmt.costmanagement.models.DimensionPaged[~azure.mgmt.costmanagement.models.Dimension] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_resource_group.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') + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) } url = self._client.format_url(url, **path_format_arguments) @@ -573,4 +134,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CostManagement/dimensions'} + list_by_subscription.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/dimensions'} diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/entities_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/entities_operations.py deleted file mode 100644 index 59721f2014ac..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/entities_operations.py +++ /dev/null @@ -1,111 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse - -from .. import models - - -class EntitiesOperations(object): - """EntitiesOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2019-03-01-preview. Constant value: "2019-03-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-03-01-preview" - - self.config = config - - def list_by_management_group( - self, management_group_id, view=None, custom_headers=None, raw=False, **operation_config): - """List all entities (Management Groups, Subscriptions, - ExternalSubscriptions, etc.) focusing on a particular group for the - authenticated user. - - :param management_group_id: ManagementGroup ID - :type management_group_id: str - :param view: The view parameter allows clients to filter the type of - data that is returned by the getEntities call. Possible values - include: 'FullHierarchy', 'GroupsOnly', 'SubscriptionsOnly', - 'ExternalSubscriptionsOnly', 'Audit' - :type view: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of EntityInfo - :rtype: - ~azure.mgmt.costmanagement.models.EntityInfoPaged[~azure.mgmt.costmanagement.models.EntityInfo] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_management_group.metadata['url'] - path_format_arguments = { - 'managementGroupId': self._serialize.url("management_group_id", management_group_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if view is not None: - query_parameters['$view'] = self._serialize.query("view", view, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.EntityInfoPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.EntityInfoPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_management_group.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.CostManagement/getEntities'} diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/exports_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/exports_operations.py new file mode 100644 index 000000000000..28c016399294 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/exports_operations.py @@ -0,0 +1,460 @@ +# 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 ExportsOperations(object): + """ExportsOperations 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: "2019-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-01-01" + + self.config = config + + def list( + self, scope, custom_headers=None, raw=False, **operation_config): + """Lists all exports at the given scope. + + :param scope: The scope associated with query and export operations. + This includes '/subscriptions/{subscriptionId}/' for subscription + scope, + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' + for resourceGroup scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for + Billing Account scope and + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' + for Department scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + for EnrollmentAccount scope and + '/providers/Microsoft.Management/managementGroups/{managementGroupId} + for Management Group scope.. + :type scope: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ExportListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.costmanagement.models.ExportListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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('ExportListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports'} + + def get( + self, scope, export_name, custom_headers=None, raw=False, **operation_config): + """Gets the export for the defined scope by export name. + + :param scope: The scope associated with query and export operations. + This includes '/subscriptions/{subscriptionId}/' for subscription + scope, + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' + for resourceGroup scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for + Billing Account scope and + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' + for Department scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + for EnrollmentAccount scope and + '/providers/Microsoft.Management/managementGroups/{managementGroupId} + for Management Group scope.. + :type scope: str + :param export_name: Export Name. + :type export_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: Export or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.costmanagement.models.Export or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'exportName': self._serialize.url("export_name", export_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('Export', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}'} + + def create_or_update( + self, scope, export_name, parameters, custom_headers=None, raw=False, **operation_config): + """The operation to create or update a export. Update operation requires + latest eTag to be set in the request. You may obtain the latest eTag by + performing a get operation. Create operation does not require eTag. + + :param scope: The scope associated with query and export operations. + This includes '/subscriptions/{subscriptionId}/' for subscription + scope, + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' + for resourceGroup scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for + Billing Account scope and + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' + for Department scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + for EnrollmentAccount scope and + '/providers/Microsoft.Management/managementGroups/{managementGroupId} + for Management Group scope.. + :type scope: str + :param export_name: Export Name. + :type export_name: str + :param parameters: Parameters supplied to the CreateOrUpdate Export + operation. + :type parameters: ~azure.mgmt.costmanagement.models.Export + :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: Export or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.costmanagement.models.Export or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'exportName': self._serialize.url("export_name", export_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, 'Export') + + # 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('Export', response) + if response.status_code == 201: + deserialized = self._deserialize('Export', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}'} + + def delete( + self, scope, export_name, custom_headers=None, raw=False, **operation_config): + """The operation to delete a export. + + :param scope: The scope associated with query and export operations. + This includes '/subscriptions/{subscriptionId}/' for subscription + scope, + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' + for resourceGroup scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for + Billing Account scope and + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' + for Department scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + for EnrollmentAccount scope and + '/providers/Microsoft.Management/managementGroups/{managementGroupId} + for Management Group scope.. + :type scope: str + :param export_name: Export Name. + :type export_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'exportName': self._serialize.url("export_name", export_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}'} + + def execute( + self, scope, export_name, custom_headers=None, raw=False, **operation_config): + """The operation to execute a export. + + :param scope: The scope associated with query and export operations. + This includes '/subscriptions/{subscriptionId}/' for subscription + scope, + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' + for resourceGroup scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for + Billing Account scope and + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' + for Department scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + for EnrollmentAccount scope and + '/providers/Microsoft.Management/managementGroups/{managementGroupId} + for Management Group scope.. + :type scope: str + :param export_name: Export Name. + :type export_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.execute.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'exportName': self._serialize.url("export_name", export_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.post(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 + execute.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/run'} + + def get_execution_history( + self, scope, export_name, custom_headers=None, raw=False, **operation_config): + """Gets the execution history of a export for the defined scope by export + name. + + :param scope: The scope associated with query and export operations. + This includes '/subscriptions/{subscriptionId}/' for subscription + scope, + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' + for resourceGroup scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for + Billing Account scope and + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' + for Department scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + for EnrollmentAccount scope and + '/providers/Microsoft.Management/managementGroups/{managementGroupId} + for Management Group scope.. + :type scope: str + :param export_name: Export Name. + :type export_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: ExportExecutionListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.costmanagement.models.ExportExecutionListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_execution_history.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'exportName': self._serialize.url("export_name", export_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('ExportExecutionListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_execution_history.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/runHistory'} diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/external_billing_account_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/external_billing_account_operations.py deleted file mode 100644 index da2049233695..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/external_billing_account_operations.py +++ /dev/null @@ -1,156 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse - -from .. import models - - -class ExternalBillingAccountOperations(object): - """ExternalBillingAccountOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2019-03-01-preview. Constant value: "2019-03-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-03-01-preview" - - self.config = config - - def list( - self, custom_headers=None, raw=False, **operation_config): - """List all ExternalBillingAccount definitions. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ExternalBillingAccountDefinition - :rtype: - ~azure.mgmt.costmanagement.models.ExternalBillingAccountDefinitionPaged[~azure.mgmt.costmanagement.models.ExternalBillingAccountDefinition] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list.metadata['url'] - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.ExternalBillingAccountDefinitionPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.ExternalBillingAccountDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/providers/Microsoft.CostManagement/externalBillingAccounts'} - - def get( - self, external_billing_account_name, custom_headers=None, raw=False, **operation_config): - """Get a ExternalBillingAccount definition. - - :param external_billing_account_name: External Billing Account Name. - (eg 'aws-{PayerAccountId}') - :type external_billing_account_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: ExternalBillingAccountDefinition or ClientRawResponse if - raw=true - :rtype: - ~azure.mgmt.costmanagement.models.ExternalBillingAccountDefinition or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'externalBillingAccountName': self._serialize.url("external_billing_account_name", external_billing_account_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('ExternalBillingAccountDefinition', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}'} diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/external_subscription_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/external_subscription_operations.py deleted file mode 100644 index 6059b0c05e1d..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/external_subscription_operations.py +++ /dev/null @@ -1,339 +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 ExternalSubscriptionOperations(object): - """ExternalSubscriptionOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2019-03-01-preview. Constant value: "2019-03-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-03-01-preview" - - self.config = config - - def list_by_external_billing_account( - self, external_billing_account_name, custom_headers=None, raw=False, **operation_config): - """List all ExternalSubscriptions by ExternalBillingAccount definitions. - - :param external_billing_account_name: External Billing Account Name. - (eg 'aws-{PayerAccountId}') - :type external_billing_account_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: An iterator like instance of ExternalSubscriptionDefinition - :rtype: - ~azure.mgmt.costmanagement.models.ExternalSubscriptionDefinitionPaged[~azure.mgmt.costmanagement.models.ExternalSubscriptionDefinition] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_external_billing_account.metadata['url'] - path_format_arguments = { - 'externalBillingAccountName': self._serialize.url("external_billing_account_name", external_billing_account_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') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.ExternalSubscriptionDefinitionPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.ExternalSubscriptionDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_external_billing_account.metadata = {'url': '/providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}/externalSubscriptions'} - - def list( - self, custom_headers=None, raw=False, **operation_config): - """List all ExternalSubscription definitions. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ExternalSubscriptionDefinition - :rtype: - ~azure.mgmt.costmanagement.models.ExternalSubscriptionDefinitionPaged[~azure.mgmt.costmanagement.models.ExternalSubscriptionDefinition] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list.metadata['url'] - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.ExternalSubscriptionDefinitionPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.ExternalSubscriptionDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/providers/Microsoft.CostManagement/externalSubscriptions'} - - def get( - self, external_subscription_name, custom_headers=None, raw=False, **operation_config): - """Get an ExternalSubscription definition. - - :param external_subscription_name: External Subscription Name. (eg - 'aws-{UsageAccountId}') - :type external_subscription_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: ExternalSubscriptionDefinition or ClientRawResponse if - raw=true - :rtype: - ~azure.mgmt.costmanagement.models.ExternalSubscriptionDefinition or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'externalSubscriptionName': self._serialize.url("external_subscription_name", external_subscription_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('ExternalSubscriptionDefinition', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}'} - - def list_by_management_group( - self, management_group_id, custom_headers=None, raw=False, **operation_config): - """List all ExternalSubscription definitions for Management Group. - - :param management_group_id: ManagementGroup ID - :type management_group_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ExternalSubscriptionDefinition - :rtype: - ~azure.mgmt.costmanagement.models.ExternalSubscriptionDefinitionPaged[~azure.mgmt.costmanagement.models.ExternalSubscriptionDefinition] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_management_group.metadata['url'] - path_format_arguments = { - 'managementGroupId': self._serialize.url("management_group_id", management_group_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.ExternalSubscriptionDefinitionPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.ExternalSubscriptionDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_management_group.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.CostManagement/externalSubscriptions'} - - def update_by_management_group( - self, management_group_id, external_subscription_name, custom_headers=None, raw=False, **operation_config): - """Associates ExternalSubscription with the management group. - - :param management_group_id: ManagementGroup ID - :type management_group_id: str - :param external_subscription_name: External Subscription Name. (eg - 'aws-{UsageAccountId}') - :type external_subscription_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.update_by_management_group.metadata['url'] - path_format_arguments = { - 'managementGroupId': self._serialize.url("management_group_id", management_group_id, 'str'), - 'externalSubscriptionName': self._serialize.url("external_subscription_name", external_subscription_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.put(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [204]: - raise models.ErrorResponseException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - update_by_management_group.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}'} diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/forecast_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/forecast_operations.py deleted file mode 100644 index 1020f3179d4d..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/forecast_operations.py +++ /dev/null @@ -1,480 +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 ForecastOperations(object): - """ForecastOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2019-03-01-preview. Constant value: "2019-03-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-03-01-preview" - - self.config = config - - def usage_by_subscription( - self, parameters, custom_headers=None, raw=False, **operation_config): - """Forecast the usage data for subscriptionId. - - :param parameters: Parameters supplied to the CreateOrUpdate Report - Config operation. - :type parameters: - ~azure.mgmt.costmanagement.models.ReportConfigDefinition - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Query - :rtype: - ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.usage_by_subscription.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') - - else: - url = next_link - query_parameters = {} - - # 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, 'ReportConfigDefinition') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - usage_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CostManagement/Forecast'} - - def usage_by_resource_group( - self, resource_group_name, parameters, custom_headers=None, raw=False, **operation_config): - """Forecast the usage data for subscriptionId and resource group. - - :param resource_group_name: Azure Resource Group Name. - :type resource_group_name: str - :param parameters: Parameters supplied to the CreateOrUpdate Report - Config operation. - :type parameters: - ~azure.mgmt.costmanagement.models.ReportConfigDefinition - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Query - :rtype: - ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.usage_by_resource_group.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') - - else: - url = next_link - query_parameters = {} - - # 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, 'ReportConfigDefinition') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - usage_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.CostManagement/Forecast'} - - def usage_by_billing_account( - self, billing_account_id, parameters, custom_headers=None, raw=False, **operation_config): - """Forecast the usage data for billing account. - - :param billing_account_id: BillingAccount ID - :type billing_account_id: str - :param parameters: Parameters supplied to the CreateOrUpdate Report - Config operation. - :type parameters: - ~azure.mgmt.costmanagement.models.ReportConfigDefinition - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Query - :rtype: - ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.usage_by_billing_account.metadata['url'] - path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # 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, 'ReportConfigDefinition') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - usage_by_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/Forecast'} - - def usage_by_enrollment_account( - self, billing_account_id, enrollment_account_id, parameters, custom_headers=None, raw=False, **operation_config): - """Forecast the usage data for an enrollment account. - - :param billing_account_id: BillingAccount ID - :type billing_account_id: str - :param enrollment_account_id: Enrollment Account ID - :type enrollment_account_id: str - :param parameters: Parameters supplied to the CreateOrUpdate Report - Config operation. - :type parameters: - ~azure.mgmt.costmanagement.models.ReportConfigDefinition - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Query - :rtype: - ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.usage_by_enrollment_account.metadata['url'] - path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), - 'enrollmentAccountId': self._serialize.url("enrollment_account_id", enrollment_account_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # 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, 'ReportConfigDefinition') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - usage_by_enrollment_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}/providers/Microsoft.CostManagement/Forecast'} - - def usage_by_department( - self, billing_account_id, department_id, parameters, custom_headers=None, raw=False, **operation_config): - """Forecast the usage data for department. - - :param billing_account_id: BillingAccount ID - :type billing_account_id: str - :param department_id: Department ID - :type department_id: str - :param parameters: Parameters supplied to the CreateOrUpdate Report - Config operation. - :type parameters: - ~azure.mgmt.costmanagement.models.ReportConfigDefinition - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Query - :rtype: - ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.usage_by_department.metadata['url'] - path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), - 'departmentId': self._serialize.url("department_id", department_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') - - else: - url = next_link - query_parameters = {} - - # 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, 'ReportConfigDefinition') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - usage_by_department.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}/providers/Microsoft.CostManagement/Forecast'} - - def usage_by_managment_group( - self, management_group_id, parameters, custom_headers=None, raw=False, **operation_config): - """Lists the usage data for management group. - - :param management_group_id: ManagementGroup ID - :type management_group_id: str - :param parameters: Parameters supplied to the CreateOrUpdate Report - Config operation. - :type parameters: - ~azure.mgmt.costmanagement.models.ReportConfigDefinition - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Query - :rtype: - ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.usage_by_managment_group.metadata['url'] - path_format_arguments = { - 'managementGroupId': self._serialize.url("management_group_id", management_group_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # 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, 'ReportConfigDefinition') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - usage_by_managment_group.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.CostManagement/Forecast'} diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/operations.py index 13ec9cafe5f1..ab1bdbe26fc0 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/operations.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/operations.py @@ -22,7 +22,7 @@ class Operations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2019-03-01-preview. Constant value: "2019-03-01-preview". + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-05-31. Constant value: "2019-01-01". """ models = models @@ -32,13 +32,13 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-03-01-preview" + self.api_version = "2019-01-01" self.config = config def list( self, custom_headers=None, raw=False, **operation_config): - """Lists all of the available consumption REST API operations. + """Lists all of the available cost management REST API operations. :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/query_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/query_operations.py index 1591a2381db5..e08c773557ab 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/query_operations.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/query_operations.py @@ -22,7 +22,7 @@ class QueryOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2019-03-01-preview. Constant value: "2019-03-01-preview". + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-05-31. Constant value: "2019-01-01". """ models = models @@ -32,390 +32,31 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-03-01-preview" + self.api_version = "2019-01-01" self.config = config - def usage_by_subscription( - self, parameters, custom_headers=None, raw=False, **operation_config): - """Query the usage data for subscriptionId. - - :param parameters: Parameters supplied to the CreateOrUpdate Report - Config operation. - :type parameters: - ~azure.mgmt.costmanagement.models.ReportConfigDefinition - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Query - :rtype: - ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.usage_by_subscription.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') - - else: - url = next_link - query_parameters = {} - - # 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, 'ReportConfigDefinition') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - usage_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CostManagement/Query'} - - def usage_by_resource_group( - self, resource_group_name, parameters, custom_headers=None, raw=False, **operation_config): - """Query the usage data for subscriptionId and resource group. - - :param resource_group_name: Azure Resource Group Name. - :type resource_group_name: str - :param parameters: Parameters supplied to the CreateOrUpdate Report - Config operation. - :type parameters: - ~azure.mgmt.costmanagement.models.ReportConfigDefinition - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Query - :rtype: - ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.usage_by_resource_group.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') - - else: - url = next_link - query_parameters = {} - - # 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, 'ReportConfigDefinition') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - usage_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.CostManagement/Query'} - - def usage_by_billing_account( - self, billing_account_id, parameters, custom_headers=None, raw=False, **operation_config): - """Query the usage data for billing account. - - :param billing_account_id: BillingAccount ID - :type billing_account_id: str - :param parameters: Parameters supplied to the CreateOrUpdate Report - Config operation. - :type parameters: - ~azure.mgmt.costmanagement.models.ReportConfigDefinition - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Query - :rtype: - ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.usage_by_billing_account.metadata['url'] - path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # 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, 'ReportConfigDefinition') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - usage_by_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/Query'} - - def usage_by_enrollment_account( - self, billing_account_id, enrollment_account_id, parameters, custom_headers=None, raw=False, **operation_config): - """Query the usage data for an enrollment account. - - :param billing_account_id: BillingAccount ID - :type billing_account_id: str - :param enrollment_account_id: Enrollment Account ID - :type enrollment_account_id: str - :param parameters: Parameters supplied to the CreateOrUpdate Report - Config operation. - :type parameters: - ~azure.mgmt.costmanagement.models.ReportConfigDefinition - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Query - :rtype: - ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.usage_by_enrollment_account.metadata['url'] - path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), - 'enrollmentAccountId': self._serialize.url("enrollment_account_id", enrollment_account_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # 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, 'ReportConfigDefinition') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - usage_by_enrollment_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}/providers/Microsoft.CostManagement/Query'} - - def usage_by_department( - self, billing_account_id, department_id, parameters, custom_headers=None, raw=False, **operation_config): - """Query the usage data for department. - - :param billing_account_id: BillingAccount ID - :type billing_account_id: str - :param department_id: Department ID - :type department_id: str - :param parameters: Parameters supplied to the CreateOrUpdate Report - Config operation. - :type parameters: - ~azure.mgmt.costmanagement.models.ReportConfigDefinition - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Query - :rtype: - ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.usage_by_department.metadata['url'] - path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), - 'departmentId': self._serialize.url("department_id", department_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') - - else: - url = next_link - query_parameters = {} - - # 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, 'ReportConfigDefinition') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - usage_by_department.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}/providers/Microsoft.CostManagement/Query'} - - def usage_by_managment_group( - self, management_group_id, parameters, custom_headers=None, raw=False, **operation_config): - """Lists the usage data for management group. - - :param management_group_id: ManagementGroup ID - :type management_group_id: str - :param parameters: Parameters supplied to the CreateOrUpdate Report + def usage_by_scope( + self, scope, parameters, custom_headers=None, raw=False, **operation_config): + """Query the usage data for scope defined. + + :param scope: The scope associated with query and export operations. + This includes '/subscriptions/{subscriptionId}/' for subscription + scope, + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' + for resourceGroup scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for + Billing Account scope and + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' + for Department scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + for EnrollmentAccount scope and + '/providers/Microsoft.Management/managementGroups/{managementGroupId} + for Management Group scope.. + :type scope: str + :param parameters: Parameters supplied to the CreateOrUpdate Query Config operation. - :type parameters: - ~azure.mgmt.costmanagement.models.ReportConfigDefinition + :type parameters: ~azure.mgmt.costmanagement.models.QueryDefinition :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -431,9 +72,9 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = self.usage_by_managment_group.metadata['url'] + url = self.usage_by_scope.metadata['url'] path_format_arguments = { - 'managementGroupId': self._serialize.url("management_group_id", management_group_id, 'str') + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) } url = self._client.format_url(url, **path_format_arguments) @@ -457,7 +98,7 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(parameters, 'ReportConfigDefinition') + body_content = self._serialize.body(parameters, 'QueryDefinition') # Construct and send request request = self._client.post(url, query_parameters, header_parameters, body_content) @@ -477,4 +118,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized - usage_by_managment_group.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.CostManagement/Query'} + usage_by_scope.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/query'} From c598119ec7fefaf85a37738a57d8edb8ce6b553d Mon Sep 17 00:00:00 2001 From: iscai-msft <43154838+iscai-msft@users.noreply.github.com> Date: Tue, 19 Feb 2019 11:31:39 -0800 Subject: [PATCH 08/14] Update HISTORY.rst --- azure-mgmt-costmanagement/HISTORY.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-mgmt-costmanagement/HISTORY.rst b/azure-mgmt-costmanagement/HISTORY.rst index 8924d5d6c445..63b208efd0dd 100644 --- a/azure-mgmt-costmanagement/HISTORY.rst +++ b/azure-mgmt-costmanagement/HISTORY.rst @@ -3,7 +3,7 @@ Release History =============== -0.1.0 (1970-01-01) +0.1.0 (2019-02-19) ++++++++++++++++++ * Initial Release From 43035bde6956ed741a4ef261a32b1f0ba73a03ea Mon Sep 17 00:00:00 2001 From: iscai-msft <43154838+iscai-msft@users.noreply.github.com> Date: Tue, 19 Feb 2019 11:34:29 -0800 Subject: [PATCH 09/14] Update sdk_packaging.toml --- azure-mgmt-costmanagement/sdk_packaging.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-mgmt-costmanagement/sdk_packaging.toml b/azure-mgmt-costmanagement/sdk_packaging.toml index bd14e24054ab..52e7c62ecb14 100644 --- a/azure-mgmt-costmanagement/sdk_packaging.toml +++ b/azure-mgmt-costmanagement/sdk_packaging.toml @@ -1,7 +1,7 @@ [packaging] package_name = "azure-mgmt-costmanagement" package_nspkg = "azure-mgmt-nspkg" -package_pprint_name = "MyService Management" +package_pprint_name = "Cost Management" package_doc_id = "" is_stable = false is_arm = true From 78cad1bd78fc7897e59c31dcbe057cb5e4d3002c Mon Sep 17 00:00:00 2001 From: iscai-msft <43154838+iscai-msft@users.noreply.github.com> Date: Tue, 19 Feb 2019 11:35:00 -0800 Subject: [PATCH 10/14] Update version.py --- azure-mgmt-costmanagement/azure/mgmt/costmanagement/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/version.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/version.py index 9c644827672b..e0ec669828cb 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/version.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "1.2.0" +VERSION = "0.1.0" From 9240d1c23be63982b6b01e0c0fa4e6c7be8252d7 Mon Sep 17 00:00:00 2001 From: azuresdkci Date: Tue, 19 Feb 2019 19:38:51 +0000 Subject: [PATCH 11/14] Packaging update of azure-mgmt-costmanagement --- azure-mgmt-costmanagement/README.rst | 4 ++-- azure-mgmt-costmanagement/setup.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/azure-mgmt-costmanagement/README.rst b/azure-mgmt-costmanagement/README.rst index d0429ebc7565..8e4d96c1db4a 100644 --- a/azure-mgmt-costmanagement/README.rst +++ b/azure-mgmt-costmanagement/README.rst @@ -1,7 +1,7 @@ Microsoft Azure SDK for Python ============================== -This is the Microsoft Azure MyService Management Client Library. +This is the Microsoft Azure Cost Management Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). @@ -17,7 +17,7 @@ For a more complete set of Azure libraries, see the `azure `__ on docs.microsoft.com. diff --git a/azure-mgmt-costmanagement/setup.py b/azure-mgmt-costmanagement/setup.py index 4161d00c6322..a442f3e973bf 100644 --- a/azure-mgmt-costmanagement/setup.py +++ b/azure-mgmt-costmanagement/setup.py @@ -13,7 +13,7 @@ # Change the PACKAGE_NAME only to change folder and different name PACKAGE_NAME = "azure-mgmt-costmanagement" -PACKAGE_PPRINT_NAME = "MyService Management" +PACKAGE_PPRINT_NAME = "Cost Management" # a-b-c => a/b/c package_folder_path = PACKAGE_NAME.replace('-', '/') From 8cb1468fadd0034fe6f0a95380dd81e6558450cd Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 27 Feb 2019 15:33:51 -0800 Subject: [PATCH 12/14] Generated from a2af3bff7af39874c0611ca27d8b00c33e79be3b (#4413) Add Put Rule --- azure-mgmt-costmanagement/azure/mgmt/costmanagement/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/version.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/version.py index e0ec669828cb..9c644827672b 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/version.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.1.0" +VERSION = "1.2.0" From 558510afd34902aacd44ada1e36f7c538fe65948 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 12 Apr 2019 13:19:49 -0700 Subject: [PATCH 13/14] [AutoPR cost-management/resource-manager] [Hub Generated] Review request for Microsoft.CostManagement to add version stable/2019-01-01 (#4825) * Generated from b8c32f37aa9e744d36530fcbd4caac35a37828f2 Adds suppression to readme * Packaging update of azure-mgmt-costmanagement * Generated from dda9bf78560444698902a49dadcbf2a5598dd1e9 updated examples with scope param and fixed syntax error --- azure-mgmt-costmanagement/MANIFEST.in | 1 + azure-mgmt-costmanagement/README.rst | 3 ++ .../operations/exports_operations.py | 54 +++++++------------ .../operations/query_operations.py | 5 +- azure-mgmt-costmanagement/setup.py | 1 + 5 files changed, 25 insertions(+), 39 deletions(-) diff --git a/azure-mgmt-costmanagement/MANIFEST.in b/azure-mgmt-costmanagement/MANIFEST.in index 6ceb27f7a96e..e4884efef41b 100644 --- a/azure-mgmt-costmanagement/MANIFEST.in +++ b/azure-mgmt-costmanagement/MANIFEST.in @@ -1,3 +1,4 @@ +recursive-include tests *.py *.yaml include *.rst include azure/__init__.py include azure/mgmt/__init__.py diff --git a/azure-mgmt-costmanagement/README.rst b/azure-mgmt-costmanagement/README.rst index 8e4d96c1db4a..57a3d5212207 100644 --- a/azure-mgmt-costmanagement/README.rst +++ b/azure-mgmt-costmanagement/README.rst @@ -28,3 +28,6 @@ Provide Feedback If you encounter any bugs or have suggestions, please file an issue in the `Issues `__ section of the project. + + +.. image:: https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-costmanagement%2FREADME.png diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/exports_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/exports_operations.py index 28c016399294..f08534765780 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/exports_operations.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/exports_operations.py @@ -40,9 +40,8 @@ def list( self, scope, custom_headers=None, raw=False, **operation_config): """Lists all exports at the given scope. - :param scope: The scope associated with query and export operations. - This includes '/subscriptions/{subscriptionId}/' for subscription - scope, + :param scope: The scope associated with export operations. This + includes '/subscriptions/{subscriptionId}' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for @@ -50,9 +49,7 @@ def list( '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - for EnrollmentAccount scope and - '/providers/Microsoft.Management/managementGroups/{managementGroupId} - for Management Group scope.. + for EnrollmentAccount scope. :type scope: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -109,9 +106,8 @@ def get( self, scope, export_name, custom_headers=None, raw=False, **operation_config): """Gets the export for the defined scope by export name. - :param scope: The scope associated with query and export operations. - This includes '/subscriptions/{subscriptionId}/' for subscription - scope, + :param scope: The scope associated with export operations. This + includes '/subscriptions/{subscriptionId}' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for @@ -119,9 +115,7 @@ def get( '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - for EnrollmentAccount scope and - '/providers/Microsoft.Management/managementGroups/{managementGroupId} - for Management Group scope.. + for EnrollmentAccount scope. :type scope: str :param export_name: Export Name. :type export_name: str @@ -183,9 +177,8 @@ def create_or_update( latest eTag to be set in the request. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag. - :param scope: The scope associated with query and export operations. - This includes '/subscriptions/{subscriptionId}/' for subscription - scope, + :param scope: The scope associated with export operations. This + includes '/subscriptions/{subscriptionId}' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for @@ -193,9 +186,7 @@ def create_or_update( '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - for EnrollmentAccount scope and - '/providers/Microsoft.Management/managementGroups/{managementGroupId} - for Management Group scope.. + for EnrollmentAccount scope. :type scope: str :param export_name: Export Name. :type export_name: str @@ -264,9 +255,8 @@ def delete( self, scope, export_name, custom_headers=None, raw=False, **operation_config): """The operation to delete a export. - :param scope: The scope associated with query and export operations. - This includes '/subscriptions/{subscriptionId}/' for subscription - scope, + :param scope: The scope associated with export operations. This + includes '/subscriptions/{subscriptionId}' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for @@ -274,9 +264,7 @@ def delete( '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - for EnrollmentAccount scope and - '/providers/Microsoft.Management/managementGroups/{managementGroupId} - for Management Group scope.. + for EnrollmentAccount scope. :type scope: str :param export_name: Export Name. :type export_name: str @@ -327,9 +315,8 @@ def execute( self, scope, export_name, custom_headers=None, raw=False, **operation_config): """The operation to execute a export. - :param scope: The scope associated with query and export operations. - This includes '/subscriptions/{subscriptionId}/' for subscription - scope, + :param scope: The scope associated with export operations. This + includes '/subscriptions/{subscriptionId}' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for @@ -337,9 +324,7 @@ def execute( '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - for EnrollmentAccount scope and - '/providers/Microsoft.Management/managementGroups/{managementGroupId} - for Management Group scope.. + for EnrollmentAccount scope. :type scope: str :param export_name: Export Name. :type export_name: str @@ -391,9 +376,8 @@ def get_execution_history( """Gets the execution history of a export for the defined scope by export name. - :param scope: The scope associated with query and export operations. - This includes '/subscriptions/{subscriptionId}/' for subscription - scope, + :param scope: The scope associated with export operations. This + includes '/subscriptions/{subscriptionId}' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for @@ -401,9 +385,7 @@ def get_execution_history( '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - for EnrollmentAccount scope and - '/providers/Microsoft.Management/managementGroups/{managementGroupId} - for Management Group scope.. + for EnrollmentAccount scope. :type scope: str :param export_name: Export Name. :type export_name: str diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/query_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/query_operations.py index e08c773557ab..c855c0cdd6f4 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/query_operations.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/query_operations.py @@ -40,9 +40,8 @@ def usage_by_scope( self, scope, parameters, custom_headers=None, raw=False, **operation_config): """Query the usage data for scope defined. - :param scope: The scope associated with query and export operations. - This includes '/subscriptions/{subscriptionId}/' for subscription - scope, + :param scope: The scope associated with query operations. This + includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for diff --git a/azure-mgmt-costmanagement/setup.py b/azure-mgmt-costmanagement/setup.py index a442f3e973bf..acc358f95393 100644 --- a/azure-mgmt-costmanagement/setup.py +++ b/azure-mgmt-costmanagement/setup.py @@ -53,6 +53,7 @@ version=version, description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), long_description=readme + '\n\n' + history, + long_description_content_type='text/x-rst', license='MIT License', author='Microsoft Corporation', author_email='azpysdkhelp@microsoft.com', From fd984bb224d33a507800f10f1ed2fdcbe7bbf2d1 Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Sat, 4 May 2019 07:48:26 -0700 Subject: [PATCH 14/14] 0.1.0 --- azure-mgmt-costmanagement/HISTORY.rst | 2 +- azure-mgmt-costmanagement/azure/mgmt/costmanagement/version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-mgmt-costmanagement/HISTORY.rst b/azure-mgmt-costmanagement/HISTORY.rst index 63b208efd0dd..3d8ece1c7a41 100644 --- a/azure-mgmt-costmanagement/HISTORY.rst +++ b/azure-mgmt-costmanagement/HISTORY.rst @@ -3,7 +3,7 @@ Release History =============== -0.1.0 (2019-02-19) +0.1.0 (2019-05-04) ++++++++++++++++++ * Initial Release diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/version.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/version.py index 9c644827672b..e0ec669828cb 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/version.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "1.2.0" +VERSION = "0.1.0"