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" +