diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/__init__.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/__init__.py index b6ddbca6316a..2e18492dc2e3 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/__init__.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/__init__.py @@ -9,10 +9,11 @@ # regenerated. # -------------------------------------------------------------------------- -from .cost_management_client import CostManagementClient -from .version import VERSION +from ._configuration import CostManagementClientConfiguration +from ._cost_management_client import CostManagementClient +__all__ = ['CostManagementClient', 'CostManagementClientConfiguration'] -__all__ = ['CostManagementClient'] +from .version import VERSION __version__ = VERSION diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_configuration.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_configuration.py new file mode 100644 index 000000000000..56c2e5359a01 --- /dev/null +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_configuration.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +from msrestazure import AzureConfiguration + +from .version import VERSION + + +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) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + 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 diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/cost_management_client.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_cost_management_client.py similarity index 61% rename from sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/cost_management_client.py rename to sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_cost_management_client.py index cc8458f1727e..526f8dda9266 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/cost_management_client.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_cost_management_client.py @@ -11,45 +11,13 @@ from msrest.service_client import SDKClient from msrest import Serializer, Deserializer -from msrestazure import AzureConfiguration -from .version import VERSION -from .operations.dimensions_operations import DimensionsOperations -from .operations.query_operations import QueryOperations -from .operations.exports_operations import ExportsOperations -from .operations.operations import Operations -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 +from ._configuration import CostManagementClientConfiguration +from .operations import DimensionsOperations +from .operations import QueryOperations +from .operations import ExportsOperations +from .operations import Operations +from . import models class CostManagementClient(SDKClient): @@ -82,7 +50,7 @@ def __init__( super(CostManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2019-01-01' + self.api_version = '2019-11-01' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py index 1fc845d344b9..f9cce82b9bb8 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py @@ -10,67 +10,64 @@ # -------------------------------------------------------------------------- try: - from .error_details_py3 import ErrorDetails - from .error_response_py3 import ErrorResponse, ErrorResponseException - from .resource_py3 import Resource - from .dimension_py3 import Dimension - from .query_column_py3 import QueryColumn - from .query_py3 import Query - from .operation_display_py3 import OperationDisplay - from .operation_py3 import Operation - from .query_time_period_py3 import QueryTimePeriod - from .query_dataset_configuration_py3 import QueryDatasetConfiguration - from .query_aggregation_py3 import QueryAggregation - from .query_grouping_py3 import QueryGrouping - from .query_sorting_configuration_py3 import QuerySortingConfiguration - from .query_comparison_expression_py3 import QueryComparisonExpression - from .query_filter_py3 import QueryFilter - from .query_dataset_py3 import QueryDataset - from .query_definition_py3 import QueryDefinition - from .export_recurrence_period_py3 import ExportRecurrencePeriod - from .export_schedule_py3 import ExportSchedule - from .export_py3 import Export - from .export_list_result_py3 import ExportListResult - from .export_delivery_destination_py3 import ExportDeliveryDestination - from .export_delivery_info_py3 import ExportDeliveryInfo - from .common_export_properties_py3 import CommonExportProperties - from .export_execution_py3 import ExportExecution - from .export_execution_list_result_py3 import ExportExecutionListResult + from ._models_py3 import CommonExportProperties + from ._models_py3 import Dimension + from ._models_py3 import ErrorDetails + from ._models_py3 import ErrorResponse, ErrorResponseException + from ._models_py3 import Export + from ._models_py3 import ExportDeliveryDestination + from ._models_py3 import ExportDeliveryInfo + from ._models_py3 import ExportExecution + from ._models_py3 import ExportExecutionListResult + from ._models_py3 import ExportListResult + from ._models_py3 import ExportRecurrencePeriod + from ._models_py3 import ExportSchedule + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import QueryAggregation + from ._models_py3 import QueryColumn + from ._models_py3 import QueryComparisonExpression + from ._models_py3 import QueryDataset + from ._models_py3 import QueryDatasetConfiguration + from ._models_py3 import QueryDefinition + from ._models_py3 import QueryFilter + from ._models_py3 import QueryGrouping + from ._models_py3 import QueryResult + from ._models_py3 import QueryTimePeriod + from ._models_py3 import Resource except (SyntaxError, ImportError): - from .error_details import ErrorDetails - from .error_response import ErrorResponse, ErrorResponseException - from .resource import Resource - from .dimension import Dimension - from .query_column import QueryColumn - from .query import Query - from .operation_display import OperationDisplay - from .operation import Operation - from .query_time_period import QueryTimePeriod - from .query_dataset_configuration import QueryDatasetConfiguration - from .query_aggregation import QueryAggregation - from .query_grouping import QueryGrouping - from .query_sorting_configuration import QuerySortingConfiguration - from .query_comparison_expression import QueryComparisonExpression - from .query_filter import QueryFilter - from .query_dataset import QueryDataset - from .query_definition import QueryDefinition - from .export_recurrence_period import ExportRecurrencePeriod - from .export_schedule import ExportSchedule - from .export import Export - from .export_list_result import ExportListResult - from .export_delivery_destination import ExportDeliveryDestination - from .export_delivery_info import ExportDeliveryInfo - from .common_export_properties import CommonExportProperties - from .export_execution import ExportExecution - from .export_execution_list_result import ExportExecutionListResult -from .dimension_paged import DimensionPaged -from .query_paged import QueryPaged -from .operation_paged import OperationPaged -from .cost_management_client_enums import ( + from ._models import CommonExportProperties + from ._models import Dimension + from ._models import ErrorDetails + from ._models import ErrorResponse, ErrorResponseException + from ._models import Export + from ._models import ExportDeliveryDestination + from ._models import ExportDeliveryInfo + from ._models import ExportExecution + from ._models import ExportExecutionListResult + from ._models import ExportListResult + from ._models import ExportRecurrencePeriod + from ._models import ExportSchedule + from ._models import Operation + from ._models import OperationDisplay + from ._models import QueryAggregation + from ._models import QueryColumn + from ._models import QueryComparisonExpression + from ._models import QueryDataset + from ._models import QueryDatasetConfiguration + from ._models import QueryDefinition + from ._models import QueryFilter + from ._models import QueryGrouping + from ._models import QueryResult + from ._models import QueryTimePeriod + from ._models import Resource +from ._paged_models import DimensionPaged +from ._paged_models import OperationPaged +from ._cost_management_client_enums import ( + ExportType, TimeframeType, GranularityType, QueryColumnType, - SortDirection, StatusType, RecurrenceType, FormatType, @@ -79,39 +76,37 @@ ) __all__ = [ + 'CommonExportProperties', + 'Dimension', 'ErrorDetails', 'ErrorResponse', 'ErrorResponseException', - 'Resource', - 'Dimension', - 'QueryColumn', - 'Query', - 'OperationDisplay', - 'Operation', - 'QueryTimePeriod', - 'QueryDatasetConfiguration', - 'QueryAggregation', - 'QueryGrouping', - 'QuerySortingConfiguration', - 'QueryComparisonExpression', - 'QueryFilter', - 'QueryDataset', - 'QueryDefinition', - 'ExportRecurrencePeriod', - 'ExportSchedule', 'Export', - 'ExportListResult', 'ExportDeliveryDestination', 'ExportDeliveryInfo', - 'CommonExportProperties', 'ExportExecution', 'ExportExecutionListResult', + 'ExportListResult', + 'ExportRecurrencePeriod', + 'ExportSchedule', + 'Operation', + 'OperationDisplay', + 'QueryAggregation', + 'QueryColumn', + 'QueryComparisonExpression', + 'QueryDataset', + 'QueryDatasetConfiguration', + 'QueryDefinition', + 'QueryFilter', + 'QueryGrouping', + 'QueryResult', + 'QueryTimePeriod', + 'Resource', 'DimensionPaged', - 'QueryPaged', 'OperationPaged', + 'ExportType', 'TimeframeType', 'GranularityType', 'QueryColumnType', - 'SortDirection', 'StatusType', 'RecurrenceType', 'FormatType', diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/cost_management_client_enums.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/_cost_management_client_enums.py similarity index 86% rename from sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/cost_management_client_enums.py rename to sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/_cost_management_client_enums.py index 26507b572db1..d447d8444908 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/cost_management_client_enums.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/_cost_management_client_enums.py @@ -12,21 +12,26 @@ from enum import Enum +class ExportType(str, Enum): + + usage = "Usage" + actual_cost = "ActualCost" + amortized_cost = "AmortizedCost" + + class TimeframeType(str, Enum): - week_to_date = "WeekToDate" month_to_date = "MonthToDate" - year_to_date = "YearToDate" - the_last_week = "TheLastWeek" + billing_month_to_date = "BillingMonthToDate" the_last_month = "TheLastMonth" - the_last_year = "TheLastYear" + the_last_billing_month = "TheLastBillingMonth" + week_to_date = "WeekToDate" custom = "Custom" class GranularityType(str, Enum): daily = "Daily" - hourly = "Hourly" class QueryColumnType(str, Enum): @@ -35,12 +40,6 @@ class QueryColumnType(str, Enum): dimension = "Dimension" -class SortDirection(str, Enum): - - ascending = "Ascending" - descending = "Descending" - - class StatusType(str, Enum): active = "Active" diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/_models.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/_models.py new file mode 100644 index 000000000000..b06344b3295c --- /dev/null +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/_models.py @@ -0,0 +1,923 @@ +# 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 CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class CommonExportProperties(Model): + """The common properties of the export. + + All required parameters must be populated in order to send to Azure. + + :param format: The format of the export being delivered. Possible values + include: 'Csv' + :type format: str or ~azure.mgmt.costmanagement.models.FormatType + :param delivery_info: Required. Has delivery information for the export. + :type delivery_info: ~azure.mgmt.costmanagement.models.ExportDeliveryInfo + :param definition: Required. Has definition for the export. + :type definition: ~azure.mgmt.costmanagement.models.QueryDefinition + """ + + _validation = { + 'delivery_info': {'required': True}, + 'definition': {'required': True}, + } + + _attribute_map = { + 'format': {'key': 'format', 'type': 'str'}, + 'delivery_info': {'key': 'deliveryInfo', 'type': 'ExportDeliveryInfo'}, + 'definition': {'key': 'definition', 'type': 'QueryDefinition'}, + } + + def __init__(self, **kwargs): + super(CommonExportProperties, self).__init__(**kwargs) + self.format = kwargs.get('format', None) + self.delivery_info = kwargs.get('delivery_info', None) + self.definition = kwargs.get('definition', None) + + +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 + + +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] + :ivar description: Dimension description. + :vartype description: str + :ivar filter_enabled: Filter enabled. + :vartype filter_enabled: bool + :ivar grouping_enabled: Grouping enabled. + :vartype grouping_enabled: bool + :param data: + :type data: list[str] + :ivar total: Total number of data for the dimension. + :vartype total: int + :ivar category: Dimension category. + :vartype category: str + :ivar usage_start: Usage start. + :vartype usage_start: datetime + :ivar usage_end: Usage end. + :vartype usage_end: datetime + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'description': {'readonly': True}, + 'filter_enabled': {'readonly': True}, + 'grouping_enabled': {'readonly': True}, + 'total': {'readonly': True}, + 'category': {'readonly': True}, + 'usage_start': {'readonly': True}, + 'usage_end': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'filter_enabled': {'key': 'properties.filterEnabled', 'type': 'bool'}, + 'grouping_enabled': {'key': 'properties.groupingEnabled', 'type': 'bool'}, + 'data': {'key': 'properties.data', 'type': '[str]'}, + 'total': {'key': 'properties.total', 'type': 'int'}, + 'category': {'key': 'properties.category', 'type': 'str'}, + '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.description = None + self.filter_enabled = None + self.grouping_enabled = None + self.data = kwargs.get('data', None) + self.total = None + self.category = None + self.usage_start = None + self.usage_end = None + self.next_link = None + + +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 + + +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) + + +class Export(Resource): + """A export resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :param format: The format of the export being delivered. Possible values + include: 'Csv' + :type format: str or ~azure.mgmt.costmanagement.models.FormatType + :param delivery_info: Required. Has delivery information for the export. + :type delivery_info: ~azure.mgmt.costmanagement.models.ExportDeliveryInfo + :param definition: Required. Has definition for the export. + :type definition: ~azure.mgmt.costmanagement.models.QueryDefinition + :param schedule: Has schedule information for the export. + :type schedule: ~azure.mgmt.costmanagement.models.ExportSchedule + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'delivery_info': {'required': True}, + 'definition': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'format': {'key': 'properties.format', 'type': 'str'}, + 'delivery_info': {'key': 'properties.deliveryInfo', 'type': 'ExportDeliveryInfo'}, + 'definition': {'key': 'properties.definition', 'type': 'QueryDefinition'}, + 'schedule': {'key': 'properties.schedule', 'type': 'ExportSchedule'}, + } + + def __init__(self, **kwargs): + super(Export, self).__init__(**kwargs) + self.format = kwargs.get('format', None) + self.delivery_info = kwargs.get('delivery_info', None) + self.definition = kwargs.get('definition', None) + self.schedule = kwargs.get('schedule', None) + + +class ExportDeliveryDestination(Model): + """The destination information for the delivery of the export. To allow access + to a storage account, you must register the account's subscription with the + Microsoft.CostManagementExports resource provider. This is required once + per subscription. When creating an export in the Azure portal, it is done + automatically, however API users need to register the subscription. For + more information see + https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-supported-services + . + + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. The resource id of the storage account where + exports will be delivered. + :type resource_id: str + :param container: Required. The name of the container where exports will + be uploaded. + :type container: str + :param root_folder_path: The name of the directory where exports will be + uploaded. + :type root_folder_path: str + """ + + _validation = { + 'resource_id': {'required': True}, + 'container': {'required': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'container': {'key': 'container', 'type': 'str'}, + 'root_folder_path': {'key': 'rootFolderPath', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ExportDeliveryDestination, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.container = kwargs.get('container', None) + self.root_folder_path = kwargs.get('root_folder_path', None) + + +class ExportDeliveryInfo(Model): + """The delivery information associated with a export. + + All required parameters must be populated in order to send to Azure. + + :param destination: Required. Has destination for the export being + delivered. + :type destination: + ~azure.mgmt.costmanagement.models.ExportDeliveryDestination + """ + + _validation = { + 'destination': {'required': True}, + } + + _attribute_map = { + 'destination': {'key': 'destination', 'type': 'ExportDeliveryDestination'}, + } + + def __init__(self, **kwargs): + super(ExportDeliveryInfo, self).__init__(**kwargs) + self.destination = kwargs.get('destination', None) + + +class ExportExecution(Resource): + """A export execution. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :param execution_type: The type of the export execution. Possible values + include: 'OnDemand', 'Scheduled' + :type execution_type: str or + ~azure.mgmt.costmanagement.models.ExecutionType + :param status: The status of the export execution. Possible values + include: 'Queued', 'InProgress', 'Completed', 'Failed', 'Timeout', + 'NewDataNotAvailable', 'DataNotAvailable' + :type status: str or ~azure.mgmt.costmanagement.models.ExecutionStatus + :param submitted_by: The identifier for the entity that executed the + export. For OnDemand executions, it is the email id. For Scheduled + executions, it is the constant value - System. + :type submitted_by: str + :param submitted_time: The time when export was queued to be executed. + :type submitted_time: datetime + :param processing_start_time: The time when export was picked up to be + executed. + :type processing_start_time: datetime + :param processing_end_time: The time when export execution finished. + :type processing_end_time: datetime + :param file_name: The name of the file export got written to. + :type file_name: str + :param run_settings: + :type run_settings: + ~azure.mgmt.costmanagement.models.CommonExportProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'execution_type': {'key': 'properties.executionType', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'submitted_by': {'key': 'properties.submittedBy', 'type': 'str'}, + 'submitted_time': {'key': 'properties.submittedTime', 'type': 'iso-8601'}, + 'processing_start_time': {'key': 'properties.processingStartTime', 'type': 'iso-8601'}, + 'processing_end_time': {'key': 'properties.processingEndTime', 'type': 'iso-8601'}, + 'file_name': {'key': 'properties.fileName', 'type': 'str'}, + 'run_settings': {'key': 'properties.runSettings', 'type': 'CommonExportProperties'}, + } + + def __init__(self, **kwargs): + super(ExportExecution, self).__init__(**kwargs) + self.execution_type = kwargs.get('execution_type', None) + self.status = kwargs.get('status', None) + self.submitted_by = kwargs.get('submitted_by', None) + self.submitted_time = kwargs.get('submitted_time', None) + self.processing_start_time = kwargs.get('processing_start_time', None) + self.processing_end_time = kwargs.get('processing_end_time', None) + self.file_name = kwargs.get('file_name', None) + self.run_settings = kwargs.get('run_settings', None) + + +class ExportExecutionListResult(Model): + """Result of listing exports execution history of a export by name. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of export executions. + :vartype value: list[~azure.mgmt.costmanagement.models.ExportExecution] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExportExecution]'}, + } + + def __init__(self, **kwargs): + super(ExportExecutionListResult, self).__init__(**kwargs) + self.value = None + + +class ExportListResult(Model): + """Result of listing exports. It contains a list of available exports in the + scope provided. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of exports. + :vartype value: list[~azure.mgmt.costmanagement.models.Export] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Export]'}, + } + + def __init__(self, **kwargs): + super(ExportListResult, self).__init__(**kwargs) + self.value = None + + +class ExportRecurrencePeriod(Model): + """The start and end date for recurrence schedule. + + All required parameters must be populated in order to send to Azure. + + :param from_property: Required. The start date of recurrence. + :type from_property: datetime + :param to: The end date of recurrence. + :type to: datetime + """ + + _validation = { + 'from_property': {'required': True}, + } + + _attribute_map = { + 'from_property': {'key': 'from', 'type': 'iso-8601'}, + 'to': {'key': 'to', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(ExportRecurrencePeriod, self).__init__(**kwargs) + self.from_property = kwargs.get('from_property', None) + self.to = kwargs.get('to', None) + + +class ExportSchedule(Model): + """The schedule associated with a export. + + All required parameters must be populated in order to send to Azure. + + :param status: The status of the schedule. Whether active or not. If + inactive, the export's scheduled execution is paused. Possible values + include: 'Active', 'Inactive' + :type status: str or ~azure.mgmt.costmanagement.models.StatusType + :param recurrence: Required. The schedule recurrence. Possible values + include: 'Daily', 'Weekly', 'Monthly', 'Annually' + :type recurrence: str or ~azure.mgmt.costmanagement.models.RecurrenceType + :param recurrence_period: Has start and end date of the recurrence. The + start date must be in future. If present, the end date must be greater + than start date. + :type recurrence_period: + ~azure.mgmt.costmanagement.models.ExportRecurrencePeriod + """ + + _validation = { + 'recurrence': {'required': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'recurrence': {'key': 'recurrence', 'type': 'str'}, + 'recurrence_period': {'key': 'recurrencePeriod', 'type': 'ExportRecurrencePeriod'}, + } + + def __init__(self, **kwargs): + super(ExportSchedule, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.recurrence = kwargs.get('recurrence', None) + self.recurrence_period = kwargs.get('recurrence_period', None) + + +class Operation(Model): + """A Cost management REST API operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Operation name: {provider}/{resource}/{operation}. + :vartype name: str + :param display: The object that represents the operation. + :type display: ~azure.mgmt.costmanagement.models.OperationDisplay + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = kwargs.get('display', None) + + +class OperationDisplay(Model): + """The object that represents the operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: Service provider: Microsoft.CostManagement. + :vartype provider: str + :ivar resource: Resource on which the operation is performed: Dimensions, + Query. + :vartype resource: str + :ivar operation: Operation type: Read, write, delete, etc. + :vartype operation: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + + +class QueryAggregation(Model): + """The aggregation expression to be used in the query. + + Variables are only populated by the server, and will be ignored when + sending a request. + + 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(QueryAggregation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +class QueryColumn(Model): + """QueryColumn. + + :param name: The name of column. + :type name: str + :param type: The type of column. + :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) + + +class QueryComparisonExpression(Model): + """The comparison expression to be used in the query. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the column to use in comparison. + :type name: str + :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(QueryComparisonExpression, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.values = kwargs.get('values', None) + + +class QueryDataset(Model): + """The definition of data present in the query. + + :param granularity: The granularity of rows in the query. Possible values + include: 'Daily' + :type granularity: str or + ~azure.mgmt.costmanagement.models.GranularityType + :param configuration: Has configuration information for the data in the + export. The configuration will be ignored if aggregation and grouping are + provided. + :type configuration: + ~azure.mgmt.costmanagement.models.QueryDatasetConfiguration + :param aggregation: Dictionary of aggregation expression to use in the + query. The key of each item in the dictionary is the alias for the + aggregated column. Query can have up to 2 aggregation clauses. + :type aggregation: dict[str, + ~azure.mgmt.costmanagement.models.QueryAggregation] + :param grouping: Array of group by expression to use in the query. Query + can have up to 2 group by clauses. + :type grouping: list[~azure.mgmt.costmanagement.models.QueryGrouping] + :param filter: Has filter expression to use in the query. + :type filter: ~azure.mgmt.costmanagement.models.QueryFilter + """ + + _validation = { + 'grouping': {'max_items': 2}, + } + + _attribute_map = { + 'granularity': {'key': 'granularity', 'type': 'str'}, + 'configuration': {'key': 'configuration', 'type': 'QueryDatasetConfiguration'}, + 'aggregation': {'key': 'aggregation', 'type': '{QueryAggregation}'}, + 'grouping': {'key': 'grouping', 'type': '[QueryGrouping]'}, + 'filter': {'key': 'filter', 'type': 'QueryFilter'}, + } + + def __init__(self, **kwargs): + super(QueryDataset, 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) + + +class QueryDatasetConfiguration(Model): + """The configuration of dataset in the query. + + :param columns: Array of column names to be included in the query. Any + valid query column name is allowed. If not provided, then query includes + all columns. + :type columns: list[str] + """ + + _attribute_map = { + 'columns': {'key': 'columns', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(QueryDatasetConfiguration, self).__init__(**kwargs) + self.columns = kwargs.get('columns', None) + + +class QueryDefinition(Model): + """The definition of a query. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The type of the query. Possible values include: + 'Usage', 'ActualCost', 'AmortizedCost' + :type type: str or ~azure.mgmt.costmanagement.models.ExportType + :param timeframe: Required. The time frame for pulling data for the query. + If custom, then a specific time period must be provided. Possible values + include: 'MonthToDate', 'BillingMonthToDate', 'TheLastMonth', + 'TheLastBillingMonth', 'WeekToDate', 'Custom' + :type timeframe: str or ~azure.mgmt.costmanagement.models.TimeframeType + :param time_period: Has time period for pulling data for the query. + :type time_period: ~azure.mgmt.costmanagement.models.QueryTimePeriod + :param dataset: Has definition for data in this query. + :type dataset: ~azure.mgmt.costmanagement.models.QueryDataset + """ + + _validation = { + 'type': {'required': True}, + 'timeframe': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'timeframe': {'key': 'timeframe', 'type': 'str'}, + 'time_period': {'key': 'timePeriod', 'type': 'QueryTimePeriod'}, + 'dataset': {'key': 'dataset', 'type': 'QueryDataset'}, + } + + def __init__(self, **kwargs): + super(QueryDefinition, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.timeframe = kwargs.get('timeframe', None) + self.time_period = kwargs.get('time_period', None) + self.dataset = kwargs.get('dataset', None) + + +class QueryFilter(Model): + """The filter expression to be used in the export. + + :param and_property: The logical "AND" expression. Must have at least 2 + items. + :type and_property: list[~azure.mgmt.costmanagement.models.QueryFilter] + :param or_property: The logical "OR" expression. Must have at least 2 + items. + :type or_property: list[~azure.mgmt.costmanagement.models.QueryFilter] + :param not_property: The logical "NOT" expression. + :type not_property: ~azure.mgmt.costmanagement.models.QueryFilter + :param dimension: Has comparison expression for a dimension + :type dimension: + ~azure.mgmt.costmanagement.models.QueryComparisonExpression + :param tag: Has comparison expression for a tag + :type tag: ~azure.mgmt.costmanagement.models.QueryComparisonExpression + """ + + _validation = { + 'and_property': {'min_items': 2}, + 'or_property': {'min_items': 2}, + } + + _attribute_map = { + 'and_property': {'key': 'and', 'type': '[QueryFilter]'}, + 'or_property': {'key': 'or', 'type': '[QueryFilter]'}, + 'not_property': {'key': 'not', 'type': 'QueryFilter'}, + 'dimension': {'key': 'dimension', 'type': 'QueryComparisonExpression'}, + 'tag': {'key': 'tag', 'type': 'QueryComparisonExpression'}, + } + + def __init__(self, **kwargs): + super(QueryFilter, self).__init__(**kwargs) + self.and_property = kwargs.get('and_property', None) + self.or_property = kwargs.get('or_property', None) + self.not_property = kwargs.get('not_property', None) + self.dimension = kwargs.get('dimension', None) + self.tag = kwargs.get('tag', None) + + +class QueryGrouping(Model): + """The group by expression to be used in the query. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. Has type of the column to group. Possible values + include: 'Tag', 'Dimension' + :type type: str or ~azure.mgmt.costmanagement.models.QueryColumnType + :param name: Required. The name of the column to group. + :type name: str + """ + + _validation = { + 'type': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(QueryGrouping, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.name = kwargs.get('name', None) + + +class QueryResult(Resource): + """Result of query. It contains all columns listed under groupings and + aggregation. + + 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: The link (url) to the next page of results. + :type next_link: str + :param columns: Array of columns + :type columns: list[~azure.mgmt.costmanagement.models.QueryColumn] + :param rows: Array of 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(QueryResult, self).__init__(**kwargs) + self.next_link = kwargs.get('next_link', None) + self.columns = kwargs.get('columns', None) + self.rows = kwargs.get('rows', None) + + +class QueryTimePeriod(Model): + """The start and end date for pulling data for the query. + + All required parameters must be populated in order to send to Azure. + + :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(QueryTimePeriod, self).__init__(**kwargs) + self.from_property = kwargs.get('from_property', None) + self.to = kwargs.get('to', None) diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/_models_py3.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/_models_py3.py new file mode 100644 index 000000000000..01cef7145aec --- /dev/null +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/_models_py3.py @@ -0,0 +1,923 @@ +# 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 CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class CommonExportProperties(Model): + """The common properties of the export. + + All required parameters must be populated in order to send to Azure. + + :param format: The format of the export being delivered. Possible values + include: 'Csv' + :type format: str or ~azure.mgmt.costmanagement.models.FormatType + :param delivery_info: Required. Has delivery information for the export. + :type delivery_info: ~azure.mgmt.costmanagement.models.ExportDeliveryInfo + :param definition: Required. Has definition for the export. + :type definition: ~azure.mgmt.costmanagement.models.QueryDefinition + """ + + _validation = { + 'delivery_info': {'required': True}, + 'definition': {'required': True}, + } + + _attribute_map = { + 'format': {'key': 'format', 'type': 'str'}, + 'delivery_info': {'key': 'deliveryInfo', 'type': 'ExportDeliveryInfo'}, + 'definition': {'key': 'definition', 'type': 'QueryDefinition'}, + } + + def __init__(self, *, delivery_info, definition, format=None, **kwargs) -> None: + super(CommonExportProperties, self).__init__(**kwargs) + self.format = format + self.delivery_info = delivery_info + self.definition = definition + + +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 + + +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] + :ivar description: Dimension description. + :vartype description: str + :ivar filter_enabled: Filter enabled. + :vartype filter_enabled: bool + :ivar grouping_enabled: Grouping enabled. + :vartype grouping_enabled: bool + :param data: + :type data: list[str] + :ivar total: Total number of data for the dimension. + :vartype total: int + :ivar category: Dimension category. + :vartype category: str + :ivar usage_start: Usage start. + :vartype usage_start: datetime + :ivar usage_end: Usage end. + :vartype usage_end: datetime + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'description': {'readonly': True}, + 'filter_enabled': {'readonly': True}, + 'grouping_enabled': {'readonly': True}, + 'total': {'readonly': True}, + 'category': {'readonly': True}, + 'usage_start': {'readonly': True}, + 'usage_end': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'filter_enabled': {'key': 'properties.filterEnabled', 'type': 'bool'}, + 'grouping_enabled': {'key': 'properties.groupingEnabled', 'type': 'bool'}, + 'data': {'key': 'properties.data', 'type': '[str]'}, + 'total': {'key': 'properties.total', 'type': 'int'}, + 'category': {'key': 'properties.category', 'type': 'str'}, + '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, **kwargs) -> None: + super(Dimension, self).__init__(**kwargs) + self.description = None + self.filter_enabled = None + self.grouping_enabled = None + self.data = data + self.total = None + self.category = None + self.usage_start = None + self.usage_end = None + self.next_link = None + + +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 + + +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) + + +class Export(Resource): + """A export resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :param format: The format of the export being delivered. Possible values + include: 'Csv' + :type format: str or ~azure.mgmt.costmanagement.models.FormatType + :param delivery_info: Required. Has delivery information for the export. + :type delivery_info: ~azure.mgmt.costmanagement.models.ExportDeliveryInfo + :param definition: Required. Has definition for the export. + :type definition: ~azure.mgmt.costmanagement.models.QueryDefinition + :param schedule: Has schedule information for the export. + :type schedule: ~azure.mgmt.costmanagement.models.ExportSchedule + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'delivery_info': {'required': True}, + 'definition': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'format': {'key': 'properties.format', 'type': 'str'}, + 'delivery_info': {'key': 'properties.deliveryInfo', 'type': 'ExportDeliveryInfo'}, + 'definition': {'key': 'properties.definition', 'type': 'QueryDefinition'}, + 'schedule': {'key': 'properties.schedule', 'type': 'ExportSchedule'}, + } + + def __init__(self, *, delivery_info, definition, format=None, schedule=None, **kwargs) -> None: + super(Export, self).__init__(**kwargs) + self.format = format + self.delivery_info = delivery_info + self.definition = definition + self.schedule = schedule + + +class ExportDeliveryDestination(Model): + """The destination information for the delivery of the export. To allow access + to a storage account, you must register the account's subscription with the + Microsoft.CostManagementExports resource provider. This is required once + per subscription. When creating an export in the Azure portal, it is done + automatically, however API users need to register the subscription. For + more information see + https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-supported-services + . + + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. The resource id of the storage account where + exports will be delivered. + :type resource_id: str + :param container: Required. The name of the container where exports will + be uploaded. + :type container: str + :param root_folder_path: The name of the directory where exports will be + uploaded. + :type root_folder_path: str + """ + + _validation = { + 'resource_id': {'required': True}, + 'container': {'required': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'container': {'key': 'container', 'type': 'str'}, + 'root_folder_path': {'key': 'rootFolderPath', 'type': 'str'}, + } + + def __init__(self, *, resource_id: str, container: str, root_folder_path: str=None, **kwargs) -> None: + super(ExportDeliveryDestination, self).__init__(**kwargs) + self.resource_id = resource_id + self.container = container + self.root_folder_path = root_folder_path + + +class ExportDeliveryInfo(Model): + """The delivery information associated with a export. + + All required parameters must be populated in order to send to Azure. + + :param destination: Required. Has destination for the export being + delivered. + :type destination: + ~azure.mgmt.costmanagement.models.ExportDeliveryDestination + """ + + _validation = { + 'destination': {'required': True}, + } + + _attribute_map = { + 'destination': {'key': 'destination', 'type': 'ExportDeliveryDestination'}, + } + + def __init__(self, *, destination, **kwargs) -> None: + super(ExportDeliveryInfo, self).__init__(**kwargs) + self.destination = destination + + +class ExportExecution(Resource): + """A export execution. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :param execution_type: The type of the export execution. Possible values + include: 'OnDemand', 'Scheduled' + :type execution_type: str or + ~azure.mgmt.costmanagement.models.ExecutionType + :param status: The status of the export execution. Possible values + include: 'Queued', 'InProgress', 'Completed', 'Failed', 'Timeout', + 'NewDataNotAvailable', 'DataNotAvailable' + :type status: str or ~azure.mgmt.costmanagement.models.ExecutionStatus + :param submitted_by: The identifier for the entity that executed the + export. For OnDemand executions, it is the email id. For Scheduled + executions, it is the constant value - System. + :type submitted_by: str + :param submitted_time: The time when export was queued to be executed. + :type submitted_time: datetime + :param processing_start_time: The time when export was picked up to be + executed. + :type processing_start_time: datetime + :param processing_end_time: The time when export execution finished. + :type processing_end_time: datetime + :param file_name: The name of the file export got written to. + :type file_name: str + :param run_settings: + :type run_settings: + ~azure.mgmt.costmanagement.models.CommonExportProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'execution_type': {'key': 'properties.executionType', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'submitted_by': {'key': 'properties.submittedBy', 'type': 'str'}, + 'submitted_time': {'key': 'properties.submittedTime', 'type': 'iso-8601'}, + 'processing_start_time': {'key': 'properties.processingStartTime', 'type': 'iso-8601'}, + 'processing_end_time': {'key': 'properties.processingEndTime', 'type': 'iso-8601'}, + 'file_name': {'key': 'properties.fileName', 'type': 'str'}, + 'run_settings': {'key': 'properties.runSettings', 'type': 'CommonExportProperties'}, + } + + def __init__(self, *, execution_type=None, status=None, submitted_by: str=None, submitted_time=None, processing_start_time=None, processing_end_time=None, file_name: str=None, run_settings=None, **kwargs) -> None: + super(ExportExecution, self).__init__(**kwargs) + self.execution_type = execution_type + self.status = status + self.submitted_by = submitted_by + self.submitted_time = submitted_time + self.processing_start_time = processing_start_time + self.processing_end_time = processing_end_time + self.file_name = file_name + self.run_settings = run_settings + + +class ExportExecutionListResult(Model): + """Result of listing exports execution history of a export by name. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of export executions. + :vartype value: list[~azure.mgmt.costmanagement.models.ExportExecution] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExportExecution]'}, + } + + def __init__(self, **kwargs) -> None: + super(ExportExecutionListResult, self).__init__(**kwargs) + self.value = None + + +class ExportListResult(Model): + """Result of listing exports. It contains a list of available exports in the + scope provided. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of exports. + :vartype value: list[~azure.mgmt.costmanagement.models.Export] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Export]'}, + } + + def __init__(self, **kwargs) -> None: + super(ExportListResult, self).__init__(**kwargs) + self.value = None + + +class ExportRecurrencePeriod(Model): + """The start and end date for recurrence schedule. + + All required parameters must be populated in order to send to Azure. + + :param from_property: Required. The start date of recurrence. + :type from_property: datetime + :param to: The end date of recurrence. + :type to: datetime + """ + + _validation = { + 'from_property': {'required': True}, + } + + _attribute_map = { + 'from_property': {'key': 'from', 'type': 'iso-8601'}, + 'to': {'key': 'to', 'type': 'iso-8601'}, + } + + def __init__(self, *, from_property, to=None, **kwargs) -> None: + super(ExportRecurrencePeriod, self).__init__(**kwargs) + self.from_property = from_property + self.to = to + + +class ExportSchedule(Model): + """The schedule associated with a export. + + All required parameters must be populated in order to send to Azure. + + :param status: The status of the schedule. Whether active or not. If + inactive, the export's scheduled execution is paused. Possible values + include: 'Active', 'Inactive' + :type status: str or ~azure.mgmt.costmanagement.models.StatusType + :param recurrence: Required. The schedule recurrence. Possible values + include: 'Daily', 'Weekly', 'Monthly', 'Annually' + :type recurrence: str or ~azure.mgmt.costmanagement.models.RecurrenceType + :param recurrence_period: Has start and end date of the recurrence. The + start date must be in future. If present, the end date must be greater + than start date. + :type recurrence_period: + ~azure.mgmt.costmanagement.models.ExportRecurrencePeriod + """ + + _validation = { + 'recurrence': {'required': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'recurrence': {'key': 'recurrence', 'type': 'str'}, + 'recurrence_period': {'key': 'recurrencePeriod', 'type': 'ExportRecurrencePeriod'}, + } + + def __init__(self, *, recurrence, status=None, recurrence_period=None, **kwargs) -> None: + super(ExportSchedule, self).__init__(**kwargs) + self.status = status + self.recurrence = recurrence + self.recurrence_period = recurrence_period + + +class Operation(Model): + """A Cost management REST API operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Operation name: {provider}/{resource}/{operation}. + :vartype name: str + :param display: The object that represents the operation. + :type display: ~azure.mgmt.costmanagement.models.OperationDisplay + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, *, display=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = display + + +class OperationDisplay(Model): + """The object that represents the operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: Service provider: Microsoft.CostManagement. + :vartype provider: str + :ivar resource: Resource on which the operation is performed: Dimensions, + Query. + :vartype resource: str + :ivar operation: Operation type: Read, write, delete, etc. + :vartype operation: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + + +class QueryAggregation(Model): + """The aggregation expression to be used in the query. + + Variables are only populated by the server, and will be ignored when + sending a request. + + 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(QueryAggregation, self).__init__(**kwargs) + self.name = name + + +class QueryColumn(Model): + """QueryColumn. + + :param name: The name of column. + :type name: str + :param type: The type of column. + :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 + + +class QueryComparisonExpression(Model): + """The comparison expression to be used in the query. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the column to use in comparison. + :type name: str + :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(QueryComparisonExpression, self).__init__(**kwargs) + self.name = name + self.values = values + + +class QueryDataset(Model): + """The definition of data present in the query. + + :param granularity: The granularity of rows in the query. Possible values + include: 'Daily' + :type granularity: str or + ~azure.mgmt.costmanagement.models.GranularityType + :param configuration: Has configuration information for the data in the + export. The configuration will be ignored if aggregation and grouping are + provided. + :type configuration: + ~azure.mgmt.costmanagement.models.QueryDatasetConfiguration + :param aggregation: Dictionary of aggregation expression to use in the + query. The key of each item in the dictionary is the alias for the + aggregated column. Query can have up to 2 aggregation clauses. + :type aggregation: dict[str, + ~azure.mgmt.costmanagement.models.QueryAggregation] + :param grouping: Array of group by expression to use in the query. Query + can have up to 2 group by clauses. + :type grouping: list[~azure.mgmt.costmanagement.models.QueryGrouping] + :param filter: Has filter expression to use in the query. + :type filter: ~azure.mgmt.costmanagement.models.QueryFilter + """ + + _validation = { + 'grouping': {'max_items': 2}, + } + + _attribute_map = { + 'granularity': {'key': 'granularity', 'type': 'str'}, + 'configuration': {'key': 'configuration', 'type': 'QueryDatasetConfiguration'}, + 'aggregation': {'key': 'aggregation', 'type': '{QueryAggregation}'}, + 'grouping': {'key': 'grouping', 'type': '[QueryGrouping]'}, + 'filter': {'key': 'filter', 'type': 'QueryFilter'}, + } + + def __init__(self, *, granularity=None, configuration=None, aggregation=None, grouping=None, filter=None, **kwargs) -> None: + super(QueryDataset, self).__init__(**kwargs) + self.granularity = granularity + self.configuration = configuration + self.aggregation = aggregation + self.grouping = grouping + self.filter = filter + + +class QueryDatasetConfiguration(Model): + """The configuration of dataset in the query. + + :param columns: Array of column names to be included in the query. Any + valid query column name is allowed. If not provided, then query includes + all columns. + :type columns: list[str] + """ + + _attribute_map = { + 'columns': {'key': 'columns', 'type': '[str]'}, + } + + def __init__(self, *, columns=None, **kwargs) -> None: + super(QueryDatasetConfiguration, self).__init__(**kwargs) + self.columns = columns + + +class QueryDefinition(Model): + """The definition of a query. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The type of the query. Possible values include: + 'Usage', 'ActualCost', 'AmortizedCost' + :type type: str or ~azure.mgmt.costmanagement.models.ExportType + :param timeframe: Required. The time frame for pulling data for the query. + If custom, then a specific time period must be provided. Possible values + include: 'MonthToDate', 'BillingMonthToDate', 'TheLastMonth', + 'TheLastBillingMonth', 'WeekToDate', 'Custom' + :type timeframe: str or ~azure.mgmt.costmanagement.models.TimeframeType + :param time_period: Has time period for pulling data for the query. + :type time_period: ~azure.mgmt.costmanagement.models.QueryTimePeriod + :param dataset: Has definition for data in this query. + :type dataset: ~azure.mgmt.costmanagement.models.QueryDataset + """ + + _validation = { + 'type': {'required': True}, + 'timeframe': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'timeframe': {'key': 'timeframe', 'type': 'str'}, + 'time_period': {'key': 'timePeriod', 'type': 'QueryTimePeriod'}, + 'dataset': {'key': 'dataset', 'type': 'QueryDataset'}, + } + + def __init__(self, *, type, timeframe, time_period=None, dataset=None, **kwargs) -> None: + super(QueryDefinition, self).__init__(**kwargs) + self.type = type + self.timeframe = timeframe + self.time_period = time_period + self.dataset = dataset + + +class QueryFilter(Model): + """The filter expression to be used in the export. + + :param and_property: The logical "AND" expression. Must have at least 2 + items. + :type and_property: list[~azure.mgmt.costmanagement.models.QueryFilter] + :param or_property: The logical "OR" expression. Must have at least 2 + items. + :type or_property: list[~azure.mgmt.costmanagement.models.QueryFilter] + :param not_property: The logical "NOT" expression. + :type not_property: ~azure.mgmt.costmanagement.models.QueryFilter + :param dimension: Has comparison expression for a dimension + :type dimension: + ~azure.mgmt.costmanagement.models.QueryComparisonExpression + :param tag: Has comparison expression for a tag + :type tag: ~azure.mgmt.costmanagement.models.QueryComparisonExpression + """ + + _validation = { + 'and_property': {'min_items': 2}, + 'or_property': {'min_items': 2}, + } + + _attribute_map = { + 'and_property': {'key': 'and', 'type': '[QueryFilter]'}, + 'or_property': {'key': 'or', 'type': '[QueryFilter]'}, + 'not_property': {'key': 'not', 'type': 'QueryFilter'}, + 'dimension': {'key': 'dimension', 'type': 'QueryComparisonExpression'}, + 'tag': {'key': 'tag', 'type': 'QueryComparisonExpression'}, + } + + def __init__(self, *, and_property=None, or_property=None, not_property=None, dimension=None, tag=None, **kwargs) -> None: + super(QueryFilter, self).__init__(**kwargs) + self.and_property = and_property + self.or_property = or_property + self.not_property = not_property + self.dimension = dimension + self.tag = tag + + +class QueryGrouping(Model): + """The group by expression to be used in the query. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. Has type of the column to group. Possible values + include: 'Tag', 'Dimension' + :type type: str or ~azure.mgmt.costmanagement.models.QueryColumnType + :param name: Required. The name of the column to group. + :type name: str + """ + + _validation = { + 'type': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, type, name: str, **kwargs) -> None: + super(QueryGrouping, self).__init__(**kwargs) + self.type = type + self.name = name + + +class QueryResult(Resource): + """Result of query. It contains all columns listed under groupings and + aggregation. + + 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: The link (url) to the next page of results. + :type next_link: str + :param columns: Array of columns + :type columns: list[~azure.mgmt.costmanagement.models.QueryColumn] + :param rows: Array of 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(QueryResult, self).__init__(**kwargs) + self.next_link = next_link + self.columns = columns + self.rows = rows + + +class QueryTimePeriod(Model): + """The start and end date for pulling data for the query. + + All required parameters must be populated in order to send to Azure. + + :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(QueryTimePeriod, self).__init__(**kwargs) + self.from_property = from_property + self.to = to diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/dimension_paged.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/_paged_models.py similarity index 68% rename from sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/dimension_paged.py rename to sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/_paged_models.py index ef41cfaa70f2..7f38fa645767 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/dimension_paged.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/_paged_models.py @@ -25,3 +25,16 @@ class DimensionPaged(Paged): def __init__(self, *args, **kwargs): super(DimensionPaged, self).__init__(*args, **kwargs) +class OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/common_export_properties.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/common_export_properties.py deleted file mode 100644 index 9024a61aeff2..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/common_export_properties.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class CommonExportProperties(Model): - """The common properties of the export. - - All required parameters must be populated in order to send to Azure. - - :param format: The format of the export being delivered. Possible values - include: 'Csv' - :type format: str or ~azure.mgmt.costmanagement.models.FormatType - :param delivery_info: Required. Has delivery information for the export. - :type delivery_info: ~azure.mgmt.costmanagement.models.ExportDeliveryInfo - :param definition: Required. Has definition for the export. - :type definition: ~azure.mgmt.costmanagement.models.QueryDefinition - """ - - _validation = { - 'delivery_info': {'required': True}, - 'definition': {'required': True}, - } - - _attribute_map = { - 'format': {'key': 'format', 'type': 'str'}, - 'delivery_info': {'key': 'deliveryInfo', 'type': 'ExportDeliveryInfo'}, - 'definition': {'key': 'definition', 'type': 'QueryDefinition'}, - } - - def __init__(self, **kwargs): - super(CommonExportProperties, self).__init__(**kwargs) - self.format = kwargs.get('format', None) - self.delivery_info = kwargs.get('delivery_info', None) - self.definition = kwargs.get('definition', None) diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/common_export_properties_py3.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/common_export_properties_py3.py deleted file mode 100644 index 6841ba2a2dce..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/common_export_properties_py3.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class CommonExportProperties(Model): - """The common properties of the export. - - All required parameters must be populated in order to send to Azure. - - :param format: The format of the export being delivered. Possible values - include: 'Csv' - :type format: str or ~azure.mgmt.costmanagement.models.FormatType - :param delivery_info: Required. Has delivery information for the export. - :type delivery_info: ~azure.mgmt.costmanagement.models.ExportDeliveryInfo - :param definition: Required. Has definition for the export. - :type definition: ~azure.mgmt.costmanagement.models.QueryDefinition - """ - - _validation = { - 'delivery_info': {'required': True}, - 'definition': {'required': True}, - } - - _attribute_map = { - 'format': {'key': 'format', 'type': 'str'}, - 'delivery_info': {'key': 'deliveryInfo', 'type': 'ExportDeliveryInfo'}, - 'definition': {'key': 'definition', 'type': 'QueryDefinition'}, - } - - def __init__(self, *, delivery_info, definition, format=None, **kwargs) -> None: - super(CommonExportProperties, self).__init__(**kwargs) - self.format = format - self.delivery_info = delivery_info - self.definition = definition diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/dimension.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/dimension.py deleted file mode 100644 index 8a54c783616d..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/dimension.py +++ /dev/null @@ -1,82 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource import Resource - - -class 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 description: - :type description: str - :param filter_enabled: - :type filter_enabled: bool - :param grouping_enabled: - :type grouping_enabled: bool - :param data: - :type data: list[str] - :param total: - :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}'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'filter_enabled': {'key': 'properties.filterEnabled', 'type': 'bool'}, - 'grouping_enabled': {'key': 'properties.groupingEnabled', 'type': 'bool'}, - 'data': {'key': 'properties.data', 'type': '[str]'}, - 'total': {'key': 'properties.total', 'type': 'int'}, - 'category': {'key': 'properties.category', 'type': 'str'}, - '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.description = kwargs.get('description', None) - self.filter_enabled = kwargs.get('filter_enabled', None) - self.grouping_enabled = kwargs.get('grouping_enabled', None) - self.data = kwargs.get('data', None) - self.total = kwargs.get('total', None) - self.category = kwargs.get('category', None) - 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/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/dimension_py3.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/dimension_py3.py deleted file mode 100644 index ae7f8d7ca51f..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/dimension_py3.py +++ /dev/null @@ -1,82 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource_py3 import Resource - - -class 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 description: - :type description: str - :param filter_enabled: - :type filter_enabled: bool - :param grouping_enabled: - :type grouping_enabled: bool - :param data: - :type data: list[str] - :param total: - :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}'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'filter_enabled': {'key': 'properties.filterEnabled', 'type': 'bool'}, - 'grouping_enabled': {'key': 'properties.groupingEnabled', 'type': 'bool'}, - 'data': {'key': 'properties.data', 'type': '[str]'}, - 'total': {'key': 'properties.total', 'type': 'int'}, - 'category': {'key': 'properties.category', 'type': 'str'}, - '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, *, description: str=None, filter_enabled: bool=None, grouping_enabled: bool=None, data=None, total: int=None, category: str=None, usage_start=None, usage_end=None, next_link: str=None, **kwargs) -> None: - super(Dimension, self).__init__(**kwargs) - self.description = description - self.filter_enabled = filter_enabled - self.grouping_enabled = grouping_enabled - self.data = data - self.total = total - self.category = category - self.usage_start = usage_start - self.usage_end = usage_end - self.next_link = next_link diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details.py deleted file mode 100644 index 03f3e23d2153..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class 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/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details_py3.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details_py3.py deleted file mode 100644 index f9e1adeac9fe..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class 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/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_response.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_response.py deleted file mode 100644 index 981621ff3605..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_response.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model -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/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_response_py3.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_response_py3.py deleted file mode 100644 index 5d3046468167..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_response_py3.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model -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/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export.py deleted file mode 100644 index 9ec61149f406..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export.py +++ /dev/null @@ -1,67 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource import Resource - - -class Export(Resource): - """A export resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :param format: The format of the export being delivered. Possible values - include: 'Csv' - :type format: str or ~azure.mgmt.costmanagement.models.FormatType - :param delivery_info: Required. Has delivery information for the export. - :type delivery_info: ~azure.mgmt.costmanagement.models.ExportDeliveryInfo - :param definition: Required. Has definition for the export. - :type definition: ~azure.mgmt.costmanagement.models.QueryDefinition - :param schedule: Has schedule information for the export. - :type schedule: ~azure.mgmt.costmanagement.models.ExportSchedule - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'tags': {'readonly': True}, - 'delivery_info': {'required': True}, - 'definition': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'format': {'key': 'properties.format', 'type': 'str'}, - 'delivery_info': {'key': 'properties.deliveryInfo', 'type': 'ExportDeliveryInfo'}, - 'definition': {'key': 'properties.definition', 'type': 'QueryDefinition'}, - 'schedule': {'key': 'properties.schedule', 'type': 'ExportSchedule'}, - } - - def __init__(self, **kwargs): - super(Export, self).__init__(**kwargs) - self.format = kwargs.get('format', None) - self.delivery_info = kwargs.get('delivery_info', None) - self.definition = kwargs.get('definition', None) - self.schedule = kwargs.get('schedule', None) diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_destination.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_destination.py deleted file mode 100644 index 949d25357d8e..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_destination.py +++ /dev/null @@ -1,46 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ExportDeliveryDestination(Model): - """The destination information for the delivery of the export. - - All required parameters must be populated in order to send to Azure. - - :param resource_id: Required. The resource id of the storage account where - exports will be delivered. - :type resource_id: str - :param container: Required. The name of the container where exports will - be uploaded. - :type container: str - :param root_folder_path: The name of the directory where exports will be - uploaded. - :type root_folder_path: str - """ - - _validation = { - 'resource_id': {'required': True}, - 'container': {'required': True}, - } - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'container': {'key': 'container', 'type': 'str'}, - 'root_folder_path': {'key': 'rootFolderPath', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ExportDeliveryDestination, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.container = kwargs.get('container', None) - self.root_folder_path = kwargs.get('root_folder_path', None) diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_destination_py3.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_destination_py3.py deleted file mode 100644 index 3f2f70bffd4a..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_destination_py3.py +++ /dev/null @@ -1,46 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ExportDeliveryDestination(Model): - """The destination information for the delivery of the export. - - All required parameters must be populated in order to send to Azure. - - :param resource_id: Required. The resource id of the storage account where - exports will be delivered. - :type resource_id: str - :param container: Required. The name of the container where exports will - be uploaded. - :type container: str - :param root_folder_path: The name of the directory where exports will be - uploaded. - :type root_folder_path: str - """ - - _validation = { - 'resource_id': {'required': True}, - 'container': {'required': True}, - } - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'container': {'key': 'container', 'type': 'str'}, - 'root_folder_path': {'key': 'rootFolderPath', 'type': 'str'}, - } - - def __init__(self, *, resource_id: str, container: str, root_folder_path: str=None, **kwargs) -> None: - super(ExportDeliveryDestination, self).__init__(**kwargs) - self.resource_id = resource_id - self.container = container - self.root_folder_path = root_folder_path diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_info.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_info.py deleted file mode 100644 index 996aa73156d6..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_info.py +++ /dev/null @@ -1,36 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ExportDeliveryInfo(Model): - """The delivery information associated with a export. - - All required parameters must be populated in order to send to Azure. - - :param destination: Required. Has destination for the export being - delivered. - :type destination: - ~azure.mgmt.costmanagement.models.ExportDeliveryDestination - """ - - _validation = { - 'destination': {'required': True}, - } - - _attribute_map = { - 'destination': {'key': 'destination', 'type': 'ExportDeliveryDestination'}, - } - - def __init__(self, **kwargs): - super(ExportDeliveryInfo, self).__init__(**kwargs) - self.destination = kwargs.get('destination', None) diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_info_py3.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_info_py3.py deleted file mode 100644 index 43fce117f331..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_info_py3.py +++ /dev/null @@ -1,36 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ExportDeliveryInfo(Model): - """The delivery information associated with a export. - - All required parameters must be populated in order to send to Azure. - - :param destination: Required. Has destination for the export being - delivered. - :type destination: - ~azure.mgmt.costmanagement.models.ExportDeliveryDestination - """ - - _validation = { - 'destination': {'required': True}, - } - - _attribute_map = { - 'destination': {'key': 'destination', 'type': 'ExportDeliveryDestination'}, - } - - def __init__(self, *, destination, **kwargs) -> None: - super(ExportDeliveryInfo, self).__init__(**kwargs) - self.destination = destination diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution.py deleted file mode 100644 index 7843f0594630..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution.py +++ /dev/null @@ -1,86 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource import Resource - - -class ExportExecution(Resource): - """A export execution. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :param execution_type: The type of the export execution. Possible values - include: 'OnDemand', 'Scheduled' - :type execution_type: str or - ~azure.mgmt.costmanagement.models.ExecutionType - :param status: The status of the export execution. Possible values - include: 'Queued', 'InProgress', 'Completed', 'Failed', 'Timeout', - 'NewDataNotAvailable', 'DataNotAvailable' - :type status: str or ~azure.mgmt.costmanagement.models.ExecutionStatus - :param submitted_by: The identifier for the entity that executed the - export. For OnDemand executions, it is the email id. For Scheduled - executions, it is the constant value - System. - :type submitted_by: str - :param submitted_time: The time when export was queued to be executed. - :type submitted_time: datetime - :param processing_start_time: The time when export was picked up to be - executed. - :type processing_start_time: datetime - :param processing_end_time: The time when export execution finished. - :type processing_end_time: datetime - :param file_name: The name of the file export got written to. - :type file_name: str - :param run_settings: - :type run_settings: - ~azure.mgmt.costmanagement.models.CommonExportProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'tags': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'execution_type': {'key': 'properties.executionType', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'submitted_by': {'key': 'properties.submittedBy', 'type': 'str'}, - 'submitted_time': {'key': 'properties.submittedTime', 'type': 'iso-8601'}, - 'processing_start_time': {'key': 'properties.processingStartTime', 'type': 'iso-8601'}, - 'processing_end_time': {'key': 'properties.processingEndTime', 'type': 'iso-8601'}, - 'file_name': {'key': 'properties.fileName', 'type': 'str'}, - 'run_settings': {'key': 'properties.runSettings', 'type': 'CommonExportProperties'}, - } - - def __init__(self, **kwargs): - super(ExportExecution, self).__init__(**kwargs) - self.execution_type = kwargs.get('execution_type', None) - self.status = kwargs.get('status', None) - self.submitted_by = kwargs.get('submitted_by', None) - self.submitted_time = kwargs.get('submitted_time', None) - self.processing_start_time = kwargs.get('processing_start_time', None) - self.processing_end_time = kwargs.get('processing_end_time', None) - self.file_name = kwargs.get('file_name', None) - self.run_settings = kwargs.get('run_settings', None) diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution_list_result.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution_list_result.py deleted file mode 100644 index d3a017601d17..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution_list_result.py +++ /dev/null @@ -1,35 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ExportExecutionListResult(Model): - """Result of listing exports execution history of a export by name. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar value: The list of export executions. - :vartype value: list[~azure.mgmt.costmanagement.models.ExportExecution] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ExportExecution]'}, - } - - def __init__(self, **kwargs): - super(ExportExecutionListResult, self).__init__(**kwargs) - self.value = None diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution_list_result_py3.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution_list_result_py3.py deleted file mode 100644 index ae37c54c2e60..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution_list_result_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ExportExecutionListResult(Model): - """Result of listing exports execution history of a export by name. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar value: The list of export executions. - :vartype value: list[~azure.mgmt.costmanagement.models.ExportExecution] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ExportExecution]'}, - } - - def __init__(self, **kwargs) -> None: - super(ExportExecutionListResult, self).__init__(**kwargs) - self.value = None diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution_py3.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution_py3.py deleted file mode 100644 index 00d8281329cc..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution_py3.py +++ /dev/null @@ -1,86 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource_py3 import Resource - - -class ExportExecution(Resource): - """A export execution. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :param execution_type: The type of the export execution. Possible values - include: 'OnDemand', 'Scheduled' - :type execution_type: str or - ~azure.mgmt.costmanagement.models.ExecutionType - :param status: The status of the export execution. Possible values - include: 'Queued', 'InProgress', 'Completed', 'Failed', 'Timeout', - 'NewDataNotAvailable', 'DataNotAvailable' - :type status: str or ~azure.mgmt.costmanagement.models.ExecutionStatus - :param submitted_by: The identifier for the entity that executed the - export. For OnDemand executions, it is the email id. For Scheduled - executions, it is the constant value - System. - :type submitted_by: str - :param submitted_time: The time when export was queued to be executed. - :type submitted_time: datetime - :param processing_start_time: The time when export was picked up to be - executed. - :type processing_start_time: datetime - :param processing_end_time: The time when export execution finished. - :type processing_end_time: datetime - :param file_name: The name of the file export got written to. - :type file_name: str - :param run_settings: - :type run_settings: - ~azure.mgmt.costmanagement.models.CommonExportProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'tags': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'execution_type': {'key': 'properties.executionType', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'submitted_by': {'key': 'properties.submittedBy', 'type': 'str'}, - 'submitted_time': {'key': 'properties.submittedTime', 'type': 'iso-8601'}, - 'processing_start_time': {'key': 'properties.processingStartTime', 'type': 'iso-8601'}, - 'processing_end_time': {'key': 'properties.processingEndTime', 'type': 'iso-8601'}, - 'file_name': {'key': 'properties.fileName', 'type': 'str'}, - 'run_settings': {'key': 'properties.runSettings', 'type': 'CommonExportProperties'}, - } - - def __init__(self, *, execution_type=None, status=None, submitted_by: str=None, submitted_time=None, processing_start_time=None, processing_end_time=None, file_name: str=None, run_settings=None, **kwargs) -> None: - super(ExportExecution, self).__init__(**kwargs) - self.execution_type = execution_type - self.status = status - self.submitted_by = submitted_by - self.submitted_time = submitted_time - self.processing_start_time = processing_start_time - self.processing_end_time = processing_end_time - self.file_name = file_name - self.run_settings = run_settings diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_list_result.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_list_result.py deleted file mode 100644 index 0a894f869f41..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_list_result.py +++ /dev/null @@ -1,36 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ExportListResult(Model): - """Result of listing exports. It contains a list of available exports in the - scope provided. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar value: The list of exports. - :vartype value: list[~azure.mgmt.costmanagement.models.Export] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Export]'}, - } - - def __init__(self, **kwargs): - super(ExportListResult, self).__init__(**kwargs) - self.value = None diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_list_result_py3.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_list_result_py3.py deleted file mode 100644 index 562f78ca565e..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_list_result_py3.py +++ /dev/null @@ -1,36 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ExportListResult(Model): - """Result of listing exports. It contains a list of available exports in the - scope provided. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar value: The list of exports. - :vartype value: list[~azure.mgmt.costmanagement.models.Export] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Export]'}, - } - - def __init__(self, **kwargs) -> None: - super(ExportListResult, self).__init__(**kwargs) - self.value = None diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_py3.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_py3.py deleted file mode 100644 index bf8cbd862cb0..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_py3.py +++ /dev/null @@ -1,67 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource_py3 import Resource - - -class Export(Resource): - """A export resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :param format: The format of the export being delivered. Possible values - include: 'Csv' - :type format: str or ~azure.mgmt.costmanagement.models.FormatType - :param delivery_info: Required. Has delivery information for the export. - :type delivery_info: ~azure.mgmt.costmanagement.models.ExportDeliveryInfo - :param definition: Required. Has definition for the export. - :type definition: ~azure.mgmt.costmanagement.models.QueryDefinition - :param schedule: Has schedule information for the export. - :type schedule: ~azure.mgmt.costmanagement.models.ExportSchedule - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'tags': {'readonly': True}, - 'delivery_info': {'required': True}, - 'definition': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'format': {'key': 'properties.format', 'type': 'str'}, - 'delivery_info': {'key': 'properties.deliveryInfo', 'type': 'ExportDeliveryInfo'}, - 'definition': {'key': 'properties.definition', 'type': 'QueryDefinition'}, - 'schedule': {'key': 'properties.schedule', 'type': 'ExportSchedule'}, - } - - def __init__(self, *, delivery_info, definition, format=None, schedule=None, **kwargs) -> None: - super(Export, self).__init__(**kwargs) - self.format = format - self.delivery_info = delivery_info - self.definition = definition - self.schedule = schedule diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_recurrence_period.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_recurrence_period.py deleted file mode 100644 index 928221e85bfa..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_recurrence_period.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ExportRecurrencePeriod(Model): - """The start and end date for recurrence schedule. - - All required parameters must be populated in order to send to Azure. - - :param from_property: Required. The start date of recurrence. - :type from_property: datetime - :param to: The end date of recurrence. - :type to: datetime - """ - - _validation = { - 'from_property': {'required': True}, - } - - _attribute_map = { - 'from_property': {'key': 'from', 'type': 'iso-8601'}, - 'to': {'key': 'to', 'type': 'iso-8601'}, - } - - def __init__(self, **kwargs): - super(ExportRecurrencePeriod, self).__init__(**kwargs) - self.from_property = kwargs.get('from_property', None) - self.to = kwargs.get('to', None) diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_recurrence_period_py3.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_recurrence_period_py3.py deleted file mode 100644 index 98cc8316fb69..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_recurrence_period_py3.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ExportRecurrencePeriod(Model): - """The start and end date for recurrence schedule. - - All required parameters must be populated in order to send to Azure. - - :param from_property: Required. The start date of recurrence. - :type from_property: datetime - :param to: The end date of recurrence. - :type to: datetime - """ - - _validation = { - 'from_property': {'required': True}, - } - - _attribute_map = { - 'from_property': {'key': 'from', 'type': 'iso-8601'}, - 'to': {'key': 'to', 'type': 'iso-8601'}, - } - - def __init__(self, *, from_property, to=None, **kwargs) -> None: - super(ExportRecurrencePeriod, self).__init__(**kwargs) - self.from_property = from_property - self.to = to diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_schedule.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_schedule.py deleted file mode 100644 index 29ed33f58aa3..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_schedule.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ExportSchedule(Model): - """The schedule associated with a export. - - All required parameters must be populated in order to send to Azure. - - :param status: The status of the schedule. Whether active or not. If - inactive, the export's scheduled execution is paused. Possible values - include: 'Active', 'Inactive' - :type status: str or ~azure.mgmt.costmanagement.models.StatusType - :param recurrence: Required. The schedule recurrence. Possible values - include: 'Daily', 'Weekly', 'Monthly', 'Annually' - :type recurrence: str or ~azure.mgmt.costmanagement.models.RecurrenceType - :param recurrence_period: Has start and end date of the recurrence. The - start date must be in future. If present, the end date must be greater - than start date. - :type recurrence_period: - ~azure.mgmt.costmanagement.models.ExportRecurrencePeriod - """ - - _validation = { - 'recurrence': {'required': True}, - } - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'recurrence': {'key': 'recurrence', 'type': 'str'}, - 'recurrence_period': {'key': 'recurrencePeriod', 'type': 'ExportRecurrencePeriod'}, - } - - def __init__(self, **kwargs): - super(ExportSchedule, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.recurrence = kwargs.get('recurrence', None) - self.recurrence_period = kwargs.get('recurrence_period', None) diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_schedule_py3.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_schedule_py3.py deleted file mode 100644 index 76235e40c282..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_schedule_py3.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ExportSchedule(Model): - """The schedule associated with a export. - - All required parameters must be populated in order to send to Azure. - - :param status: The status of the schedule. Whether active or not. If - inactive, the export's scheduled execution is paused. Possible values - include: 'Active', 'Inactive' - :type status: str or ~azure.mgmt.costmanagement.models.StatusType - :param recurrence: Required. The schedule recurrence. Possible values - include: 'Daily', 'Weekly', 'Monthly', 'Annually' - :type recurrence: str or ~azure.mgmt.costmanagement.models.RecurrenceType - :param recurrence_period: Has start and end date of the recurrence. The - start date must be in future. If present, the end date must be greater - than start date. - :type recurrence_period: - ~azure.mgmt.costmanagement.models.ExportRecurrencePeriod - """ - - _validation = { - 'recurrence': {'required': True}, - } - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'recurrence': {'key': 'recurrence', 'type': 'str'}, - 'recurrence_period': {'key': 'recurrencePeriod', 'type': 'ExportRecurrencePeriod'}, - } - - def __init__(self, *, recurrence, status=None, recurrence_period=None, **kwargs) -> None: - super(ExportSchedule, self).__init__(**kwargs) - self.status = status - self.recurrence = recurrence - self.recurrence_period = recurrence_period diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation.py deleted file mode 100644 index c5965e54743a..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Operation(Model): - """A Cost management REST API operation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name: Operation name: {provider}/{resource}/{operation}. - :vartype name: str - :param display: The object that represents the operation. - :type display: ~azure.mgmt.costmanagement.models.OperationDisplay - """ - - _validation = { - 'name': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - } - - def __init__(self, **kwargs): - super(Operation, self).__init__(**kwargs) - self.name = None - self.display = kwargs.get('display', None) diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation_display.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation_display.py deleted file mode 100644 index e85e6e2a6647..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation_display.py +++ /dev/null @@ -1,46 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class OperationDisplay(Model): - """The object that represents the operation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar provider: Service provider: Microsoft.CostManagement. - :vartype provider: str - :ivar resource: Resource on which the operation is performed: Dimensions, - Query. - :vartype resource: str - :ivar operation: Operation type: Read, write, delete, etc. - :vartype operation: str - """ - - _validation = { - 'provider': {'readonly': True}, - 'resource': {'readonly': True}, - 'operation': {'readonly': True}, - } - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(OperationDisplay, self).__init__(**kwargs) - self.provider = None - self.resource = None - self.operation = None diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation_display_py3.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation_display_py3.py deleted file mode 100644 index 63ff2a7e14df..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation_display_py3.py +++ /dev/null @@ -1,46 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class OperationDisplay(Model): - """The object that represents the operation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar provider: Service provider: Microsoft.CostManagement. - :vartype provider: str - :ivar resource: Resource on which the operation is performed: Dimensions, - Query. - :vartype resource: str - :ivar operation: Operation type: Read, write, delete, etc. - :vartype operation: str - """ - - _validation = { - 'provider': {'readonly': True}, - 'resource': {'readonly': True}, - 'operation': {'readonly': True}, - } - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(OperationDisplay, self).__init__(**kwargs) - self.provider = None - self.resource = None - self.operation = None diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation_paged.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation_paged.py deleted file mode 100644 index 2127f26e1525..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class OperationPaged(Paged): - """ - A paging container for iterating over a list of :class:`Operation ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Operation]'} - } - - def __init__(self, *args, **kwargs): - - super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation_py3.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation_py3.py deleted file mode 100644 index c69e983617b9..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Operation(Model): - """A Cost management REST API operation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name: Operation name: {provider}/{resource}/{operation}. - :vartype name: str - :param display: The object that represents the operation. - :type display: ~azure.mgmt.costmanagement.models.OperationDisplay - """ - - _validation = { - 'name': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - } - - def __init__(self, *, display=None, **kwargs) -> None: - super(Operation, self).__init__(**kwargs) - self.name = None - self.display = display diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query.py deleted file mode 100644 index d2dd13ad3e7f..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query.py +++ /dev/null @@ -1,58 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource import Resource - - -class 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/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_aggregation.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_aggregation.py deleted file mode 100644 index d6b23a1e6980..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_aggregation.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class QueryAggregation(Model): - """The aggregation expression to be used in the query. - - Variables are only populated by the server, and will be ignored when - sending a request. - - 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(QueryAggregation, self).__init__(**kwargs) - self.name = kwargs.get('name', None) diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_aggregation_py3.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_aggregation_py3.py deleted file mode 100644 index 653dd6683433..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_aggregation_py3.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class QueryAggregation(Model): - """The aggregation expression to be used in the query. - - Variables are only populated by the server, and will be ignored when - sending a request. - - 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(QueryAggregation, self).__init__(**kwargs) - self.name = name diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_column.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_column.py deleted file mode 100644 index 3aa1734245bf..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_column.py +++ /dev/null @@ -1,32 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class 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/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_column_py3.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_column_py3.py deleted file mode 100644 index 903dd9b8c11d..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_column_py3.py +++ /dev/null @@ -1,32 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class 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/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_comparison_expression.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_comparison_expression.py deleted file mode 100644 index c932b1a9a232..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_comparison_expression.py +++ /dev/null @@ -1,49 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class QueryComparisonExpression(Model): - """The comparison expression to be used in the query. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the column to use in comparison. - :type name: str - :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(QueryComparisonExpression, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.values = kwargs.get('values', None) diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_comparison_expression_py3.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_comparison_expression_py3.py deleted file mode 100644 index d7f1f445571a..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_comparison_expression_py3.py +++ /dev/null @@ -1,49 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class QueryComparisonExpression(Model): - """The comparison expression to be used in the query. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the column to use in comparison. - :type name: str - :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(QueryComparisonExpression, self).__init__(**kwargs) - self.name = name - self.values = values diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset.py deleted file mode 100644 index f34f504aa888..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset.py +++ /dev/null @@ -1,62 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class QueryDataset(Model): - """The definition of data present in the query. - - :param granularity: The granularity of rows in the query. Possible values - include: 'Daily', 'Hourly' - :type granularity: str or - ~azure.mgmt.costmanagement.models.GranularityType - :param configuration: Has configuration information for the data in the - export. The configuration will be ignored if aggregation and grouping are - provided. - :type configuration: - ~azure.mgmt.costmanagement.models.QueryDatasetConfiguration - :param aggregation: Dictionary of aggregation expression to use in the - query. The key of each item in the dictionary is the alias for the - aggregated column. Query can have up to 2 aggregation clauses. - :type aggregation: dict[str, - ~azure.mgmt.costmanagement.models.QueryAggregation] - :param grouping: Array of group by expression to use in the query. Query - can have up to 2 group by clauses. - :type grouping: list[~azure.mgmt.costmanagement.models.QueryGrouping] - :param sorting: Array of sorting by columns in query. - :type sorting: - list[~azure.mgmt.costmanagement.models.QuerySortingConfiguration] - :param filter: Has filter expression to use in the query. - :type filter: ~azure.mgmt.costmanagement.models.QueryFilter - """ - - _validation = { - 'grouping': {'max_items': 2}, - } - - _attribute_map = { - 'granularity': {'key': 'granularity', 'type': 'str'}, - 'configuration': {'key': 'configuration', 'type': 'QueryDatasetConfiguration'}, - 'aggregation': {'key': 'aggregation', 'type': '{QueryAggregation}'}, - 'grouping': {'key': 'grouping', 'type': '[QueryGrouping]'}, - 'sorting': {'key': 'sorting', 'type': '[QuerySortingConfiguration]'}, - 'filter': {'key': 'filter', 'type': 'QueryFilter'}, - } - - def __init__(self, **kwargs): - super(QueryDataset, 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.sorting = kwargs.get('sorting', None) - self.filter = kwargs.get('filter', None) diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset_configuration.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset_configuration.py deleted file mode 100644 index 2b77baab82cc..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset_configuration.py +++ /dev/null @@ -1,30 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class QueryDatasetConfiguration(Model): - """The configuration of dataset in the query. - - :param columns: Array of column names to be included in the query. Any - valid query column name is allowed. If not provided, then query includes - all columns. - :type columns: list[str] - """ - - _attribute_map = { - 'columns': {'key': 'columns', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(QueryDatasetConfiguration, self).__init__(**kwargs) - self.columns = kwargs.get('columns', None) diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset_configuration_py3.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset_configuration_py3.py deleted file mode 100644 index 4a660322a527..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset_configuration_py3.py +++ /dev/null @@ -1,30 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class QueryDatasetConfiguration(Model): - """The configuration of dataset in the query. - - :param columns: Array of column names to be included in the query. Any - valid query column name is allowed. If not provided, then query includes - all columns. - :type columns: list[str] - """ - - _attribute_map = { - 'columns': {'key': 'columns', 'type': '[str]'}, - } - - def __init__(self, *, columns=None, **kwargs) -> None: - super(QueryDatasetConfiguration, self).__init__(**kwargs) - self.columns = columns diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset_py3.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset_py3.py deleted file mode 100644 index 016173c300c5..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset_py3.py +++ /dev/null @@ -1,62 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class QueryDataset(Model): - """The definition of data present in the query. - - :param granularity: The granularity of rows in the query. Possible values - include: 'Daily', 'Hourly' - :type granularity: str or - ~azure.mgmt.costmanagement.models.GranularityType - :param configuration: Has configuration information for the data in the - export. The configuration will be ignored if aggregation and grouping are - provided. - :type configuration: - ~azure.mgmt.costmanagement.models.QueryDatasetConfiguration - :param aggregation: Dictionary of aggregation expression to use in the - query. The key of each item in the dictionary is the alias for the - aggregated column. Query can have up to 2 aggregation clauses. - :type aggregation: dict[str, - ~azure.mgmt.costmanagement.models.QueryAggregation] - :param grouping: Array of group by expression to use in the query. Query - can have up to 2 group by clauses. - :type grouping: list[~azure.mgmt.costmanagement.models.QueryGrouping] - :param sorting: Array of sorting by columns in query. - :type sorting: - list[~azure.mgmt.costmanagement.models.QuerySortingConfiguration] - :param filter: Has filter expression to use in the query. - :type filter: ~azure.mgmt.costmanagement.models.QueryFilter - """ - - _validation = { - 'grouping': {'max_items': 2}, - } - - _attribute_map = { - 'granularity': {'key': 'granularity', 'type': 'str'}, - 'configuration': {'key': 'configuration', 'type': 'QueryDatasetConfiguration'}, - 'aggregation': {'key': 'aggregation', 'type': '{QueryAggregation}'}, - 'grouping': {'key': 'grouping', 'type': '[QueryGrouping]'}, - 'sorting': {'key': 'sorting', 'type': '[QuerySortingConfiguration]'}, - 'filter': {'key': 'filter', 'type': 'QueryFilter'}, - } - - def __init__(self, *, granularity=None, configuration=None, aggregation=None, grouping=None, sorting=None, filter=None, **kwargs) -> None: - super(QueryDataset, self).__init__(**kwargs) - self.granularity = granularity - self.configuration = configuration - self.aggregation = aggregation - self.grouping = grouping - self.sorting = sorting - self.filter = filter diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_definition.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_definition.py deleted file mode 100644 index 2893fb7ba3fc..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_definition.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class QueryDefinition(Model): - """The definition of a query. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar type: Required. The type of the query. Default value: "Usage" . - :vartype type: str - :param timeframe: Required. The time frame for pulling data for the query. - If custom, then a specific time period must be provided. Possible values - include: 'WeekToDate', 'MonthToDate', 'YearToDate', 'TheLastWeek', - 'TheLastMonth', 'TheLastYear', 'Custom' - :type timeframe: str or ~azure.mgmt.costmanagement.models.TimeframeType - :param time_period: Has time period for pulling data for the query. - :type time_period: ~azure.mgmt.costmanagement.models.QueryTimePeriod - :param dataset: Has definition for data in this query. - :type dataset: ~azure.mgmt.costmanagement.models.QueryDataset - """ - - _validation = { - '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': 'QueryTimePeriod'}, - 'dataset': {'key': 'dataset', 'type': 'QueryDataset'}, - } - - type = "Usage" - - def __init__(self, **kwargs): - super(QueryDefinition, self).__init__(**kwargs) - self.timeframe = kwargs.get('timeframe', None) - self.time_period = kwargs.get('time_period', None) - self.dataset = kwargs.get('dataset', None) diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_definition_py3.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_definition_py3.py deleted file mode 100644 index bf088e52b50a..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_definition_py3.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class QueryDefinition(Model): - """The definition of a query. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar type: Required. The type of the query. Default value: "Usage" . - :vartype type: str - :param timeframe: Required. The time frame for pulling data for the query. - If custom, then a specific time period must be provided. Possible values - include: 'WeekToDate', 'MonthToDate', 'YearToDate', 'TheLastWeek', - 'TheLastMonth', 'TheLastYear', 'Custom' - :type timeframe: str or ~azure.mgmt.costmanagement.models.TimeframeType - :param time_period: Has time period for pulling data for the query. - :type time_period: ~azure.mgmt.costmanagement.models.QueryTimePeriod - :param dataset: Has definition for data in this query. - :type dataset: ~azure.mgmt.costmanagement.models.QueryDataset - """ - - _validation = { - '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': 'QueryTimePeriod'}, - 'dataset': {'key': 'dataset', 'type': 'QueryDataset'}, - } - - type = "Usage" - - def __init__(self, *, timeframe, time_period=None, dataset=None, **kwargs) -> None: - super(QueryDefinition, self).__init__(**kwargs) - self.timeframe = timeframe - self.time_period = time_period - self.dataset = dataset diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_filter.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_filter.py deleted file mode 100644 index 0242d37de76d..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_filter.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class QueryFilter(Model): - """The filter expression to be used in the export. - - :param and_property: The logical "AND" expression. Must have at least 2 - items. - :type and_property: list[~azure.mgmt.costmanagement.models.QueryFilter] - :param or_property: The logical "OR" expression. Must have at least 2 - items. - :type or_property: list[~azure.mgmt.costmanagement.models.QueryFilter] - :param not_property: The logical "NOT" expression. - :type not_property: ~azure.mgmt.costmanagement.models.QueryFilter - :param dimension: Has comparison expression for a dimension - :type dimension: - ~azure.mgmt.costmanagement.models.QueryComparisonExpression - :param tag: Has comparison expression for a tag - :type tag: ~azure.mgmt.costmanagement.models.QueryComparisonExpression - """ - - _validation = { - 'and_property': {'min_items': 2}, - 'or_property': {'min_items': 2}, - } - - _attribute_map = { - 'and_property': {'key': 'and', 'type': '[QueryFilter]'}, - 'or_property': {'key': 'or', 'type': '[QueryFilter]'}, - 'not_property': {'key': 'not', 'type': 'QueryFilter'}, - 'dimension': {'key': 'dimension', 'type': 'QueryComparisonExpression'}, - 'tag': {'key': 'tag', 'type': 'QueryComparisonExpression'}, - } - - def __init__(self, **kwargs): - super(QueryFilter, self).__init__(**kwargs) - self.and_property = kwargs.get('and_property', None) - self.or_property = kwargs.get('or_property', None) - self.not_property = kwargs.get('not_property', None) - self.dimension = kwargs.get('dimension', None) - self.tag = kwargs.get('tag', None) diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_filter_py3.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_filter_py3.py deleted file mode 100644 index f6e4f0ee5976..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_filter_py3.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class QueryFilter(Model): - """The filter expression to be used in the export. - - :param and_property: The logical "AND" expression. Must have at least 2 - items. - :type and_property: list[~azure.mgmt.costmanagement.models.QueryFilter] - :param or_property: The logical "OR" expression. Must have at least 2 - items. - :type or_property: list[~azure.mgmt.costmanagement.models.QueryFilter] - :param not_property: The logical "NOT" expression. - :type not_property: ~azure.mgmt.costmanagement.models.QueryFilter - :param dimension: Has comparison expression for a dimension - :type dimension: - ~azure.mgmt.costmanagement.models.QueryComparisonExpression - :param tag: Has comparison expression for a tag - :type tag: ~azure.mgmt.costmanagement.models.QueryComparisonExpression - """ - - _validation = { - 'and_property': {'min_items': 2}, - 'or_property': {'min_items': 2}, - } - - _attribute_map = { - 'and_property': {'key': 'and', 'type': '[QueryFilter]'}, - 'or_property': {'key': 'or', 'type': '[QueryFilter]'}, - 'not_property': {'key': 'not', 'type': 'QueryFilter'}, - 'dimension': {'key': 'dimension', 'type': 'QueryComparisonExpression'}, - 'tag': {'key': 'tag', 'type': 'QueryComparisonExpression'}, - } - - def __init__(self, *, and_property=None, or_property=None, not_property=None, dimension=None, tag=None, **kwargs) -> None: - super(QueryFilter, 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/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_grouping.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_grouping.py deleted file mode 100644 index ee61a9990685..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_grouping.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class QueryGrouping(Model): - """The group by expression to be used in the query. - - All required parameters must be populated in order to send to Azure. - - :param type: Required. Has type of the column to group. Possible values - include: 'Tag', 'Dimension' - :type type: str or ~azure.mgmt.costmanagement.models.QueryColumnType - :param name: Required. The name of the column to group. - :type name: str - """ - - _validation = { - 'type': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(QueryGrouping, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.name = kwargs.get('name', None) diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_grouping_py3.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_grouping_py3.py deleted file mode 100644 index 65f4b79f255f..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_grouping_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class QueryGrouping(Model): - """The group by expression to be used in the query. - - All required parameters must be populated in order to send to Azure. - - :param type: Required. Has type of the column to group. Possible values - include: 'Tag', 'Dimension' - :type type: str or ~azure.mgmt.costmanagement.models.QueryColumnType - :param name: Required. The name of the column to group. - :type name: str - """ - - _validation = { - 'type': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, type, name: str, **kwargs) -> None: - super(QueryGrouping, self).__init__(**kwargs) - self.type = type - self.name = name diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_paged.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_paged.py deleted file mode 100644 index fe30582676d5..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class 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/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_py3.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_py3.py deleted file mode 100644 index d0d08fb08457..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_py3.py +++ /dev/null @@ -1,58 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource_py3 import Resource - - -class 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/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_sorting_configuration.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_sorting_configuration.py deleted file mode 100644 index ea1704928e03..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_sorting_configuration.py +++ /dev/null @@ -1,34 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class QuerySortingConfiguration(Model): - """The configuration for sorting in the query. - - :param query_sorting_direction: The sorting direction. Possible values - include: 'Ascending', 'Descending' - :type query_sorting_direction: str or - ~azure.mgmt.costmanagement.models.SortDirection - :param name: The name of the column to use in sorting. - :type name: str - """ - - _attribute_map = { - 'query_sorting_direction': {'key': 'querySortingDirection', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(QuerySortingConfiguration, self).__init__(**kwargs) - self.query_sorting_direction = kwargs.get('query_sorting_direction', None) - self.name = kwargs.get('name', None) diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_sorting_configuration_py3.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_sorting_configuration_py3.py deleted file mode 100644 index fc7524c322d3..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_sorting_configuration_py3.py +++ /dev/null @@ -1,34 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class QuerySortingConfiguration(Model): - """The configuration for sorting in the query. - - :param query_sorting_direction: The sorting direction. Possible values - include: 'Ascending', 'Descending' - :type query_sorting_direction: str or - ~azure.mgmt.costmanagement.models.SortDirection - :param name: The name of the column to use in sorting. - :type name: str - """ - - _attribute_map = { - 'query_sorting_direction': {'key': 'querySortingDirection', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, query_sorting_direction=None, name: str=None, **kwargs) -> None: - super(QuerySortingConfiguration, self).__init__(**kwargs) - self.query_sorting_direction = query_sorting_direction - self.name = name diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_time_period.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_time_period.py deleted file mode 100644 index 3c0dc37b8619..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_time_period.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class QueryTimePeriod(Model): - """The start and end date for pulling data for the query. - - All required parameters must be populated in order to send to Azure. - - :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(QueryTimePeriod, self).__init__(**kwargs) - self.from_property = kwargs.get('from_property', None) - self.to = kwargs.get('to', None) diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_time_period_py3.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_time_period_py3.py deleted file mode 100644 index 63a1d7d6e08c..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_time_period_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class QueryTimePeriod(Model): - """The start and end date for pulling data for the query. - - All required parameters must be populated in order to send to Azure. - - :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(QueryTimePeriod, self).__init__(**kwargs) - self.from_property = from_property - self.to = to diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/resource.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/resource.py deleted file mode 100644 index 08e36f3f8091..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/resource.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class 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/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/resource_py3.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/resource_py3.py deleted file mode 100644 index 38b4ca3ee6af..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/resource_py3.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class 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/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py index fbf3fa761115..ed3adf92c621 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py @@ -9,10 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .dimensions_operations import DimensionsOperations -from .query_operations import QueryOperations -from .exports_operations import ExportsOperations -from .operations import Operations +from ._dimensions_operations import DimensionsOperations +from ._query_operations import QueryOperations +from ._exports_operations import ExportsOperations +from ._operations import Operations __all__ = [ 'DimensionsOperations', diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/dimensions_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_dimensions_operations.py similarity index 83% rename from sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/dimensions_operations.py rename to sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_dimensions_operations.py index 5bdad8c6f173..a753fb553a79 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/dimensions_operations.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_dimensions_operations.py @@ -18,11 +18,13 @@ class DimensionsOperations(object): """DimensionsOperations operations. + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2018-05-31. Constant value: "2019-01-01". + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-11-01. Constant value: "2019-11-01". """ models = models @@ -32,11 +34,11 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-01-01" + self.api_version = "2019-11-01" self.config = config - def list_by_subscription( + def list( self, scope, filter=None, expand=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config): """Lists the dimensions by the defined scope. @@ -49,9 +51,15 @@ def list_by_subscription( '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - for EnrollmentAccount scope and + for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' - for Management Group scope.. + for Management Group scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + for billingProfile scope, + 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + for invoiceSection scope, and + 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' + specific for partners. :type scope: str :param filter: May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. @@ -80,11 +88,10 @@ def list_by_subscription( :raises: :class:`ErrorResponseException` """ - def internal_paging(next_link=None, raw=False): - + def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_subscription.metadata['url'] + url = self.list.metadata['url'] path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) } @@ -118,6 +125,11 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: @@ -126,12 +138,10 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.DimensionPaged(internal_paging, self._deserialize.dependencies) - + header_dict = None if raw: header_dict = {} - client_raw_response = models.DimensionPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response + deserialized = models.DimensionPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list_by_subscription.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/dimensions'} + list.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/dimensions'} diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/exports_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_exports_operations.py similarity index 78% rename from sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/exports_operations.py rename to sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_exports_operations.py index f08534765780..73edeb506961 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/exports_operations.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_exports_operations.py @@ -18,11 +18,13 @@ class ExportsOperations(object): """ExportsOperations operations. + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2018-05-31. Constant value: "2019-01-01". + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-11-01. Constant value: "2019-11-01". """ models = models @@ -32,16 +34,17 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-01-01" + self.api_version = "2019-11-01" self.config = config def list( self, scope, custom_headers=None, raw=False, **operation_config): - """Lists all exports at the given scope. + """The operation to list all exports at the given scope. - :param scope: The scope associated with export operations. This - includes '/subscriptions/{subscriptionId}' for subscription scope, + :param scope: The scope associated with query and export operations. + This includes '/subscriptions/{subscriptionId}/' for subscription + scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for @@ -49,7 +52,15 @@ def list( '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - for EnrollmentAccount scope. + for EnrollmentAccount scope, + '/providers/Microsoft.Management/managementGroups/{managementGroupId} + for Management Group scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + for billingProfile scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + for invoiceSection scope, and + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' + specific for partners. :type scope: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -91,7 +102,6 @@ def list( raise models.ErrorResponseException(self._deserialize, response) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('ExportListResult', response) @@ -104,10 +114,11 @@ def list( def get( self, scope, export_name, custom_headers=None, raw=False, **operation_config): - """Gets the export for the defined scope by export name. + """The operation to get the export for the defined scope by export name. - :param scope: The scope associated with export operations. This - includes '/subscriptions/{subscriptionId}' for subscription scope, + :param scope: The scope associated with query and export operations. + This includes '/subscriptions/{subscriptionId}/' for subscription + scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for @@ -115,7 +126,15 @@ def get( '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - for EnrollmentAccount scope. + for EnrollmentAccount scope, + '/providers/Microsoft.Management/managementGroups/{managementGroupId} + for Management Group scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + for billingProfile scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + for invoiceSection scope, and + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' + specific for partners. :type scope: str :param export_name: Export Name. :type export_name: str @@ -160,7 +179,6 @@ def get( raise models.ErrorResponseException(self._deserialize, response) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('Export', response) @@ -177,8 +195,9 @@ def create_or_update( latest eTag to be set in the request. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag. - :param scope: The scope associated with export operations. This - includes '/subscriptions/{subscriptionId}' for subscription scope, + :param scope: The scope associated with query and export operations. + This includes '/subscriptions/{subscriptionId}/' for subscription + scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for @@ -186,7 +205,15 @@ def create_or_update( '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - for EnrollmentAccount scope. + for EnrollmentAccount scope, + '/providers/Microsoft.Management/managementGroups/{managementGroupId} + for Management Group scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + for billingProfile scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + for invoiceSection scope, and + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' + specific for partners. :type scope: str :param export_name: Export Name. :type export_name: str @@ -238,7 +265,6 @@ def create_or_update( raise models.ErrorResponseException(self._deserialize, response) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('Export', response) if response.status_code == 201: @@ -255,8 +281,9 @@ def delete( self, scope, export_name, custom_headers=None, raw=False, **operation_config): """The operation to delete a export. - :param scope: The scope associated with export operations. This - includes '/subscriptions/{subscriptionId}' for subscription scope, + :param scope: The scope associated with query and export operations. + This includes '/subscriptions/{subscriptionId}/' for subscription + scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for @@ -264,7 +291,15 @@ def delete( '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - for EnrollmentAccount scope. + for EnrollmentAccount scope, + '/providers/Microsoft.Management/managementGroups/{managementGroupId} + for Management Group scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + for billingProfile scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + for invoiceSection scope, and + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' + specific for partners. :type scope: str :param export_name: Export Name. :type export_name: str @@ -315,8 +350,9 @@ def execute( self, scope, export_name, custom_headers=None, raw=False, **operation_config): """The operation to execute a export. - :param scope: The scope associated with export operations. This - includes '/subscriptions/{subscriptionId}' for subscription scope, + :param scope: The scope associated with query and export operations. + This includes '/subscriptions/{subscriptionId}/' for subscription + scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for @@ -324,7 +360,15 @@ def execute( '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - for EnrollmentAccount scope. + for EnrollmentAccount scope, + '/providers/Microsoft.Management/managementGroups/{managementGroupId} + for Management Group scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + for billingProfile scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + for invoiceSection scope, and + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' + specific for partners. :type scope: str :param export_name: Export Name. :type export_name: str @@ -373,11 +417,12 @@ def execute( def get_execution_history( self, scope, export_name, custom_headers=None, raw=False, **operation_config): - """Gets the execution history of a export for the defined scope by export - name. + """The operation to get the execution history of an export for the defined + scope by export name. - :param scope: The scope associated with export operations. This - includes '/subscriptions/{subscriptionId}' for subscription scope, + :param scope: The scope associated with query and export operations. + This includes '/subscriptions/{subscriptionId}/' for subscription + scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for @@ -385,7 +430,15 @@ def get_execution_history( '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - for EnrollmentAccount scope. + for EnrollmentAccount scope, + '/providers/Microsoft.Management/managementGroups/{managementGroupId} + for Management Group scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + for billingProfile scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + for invoiceSection scope, and + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' + specific for partners. :type scope: str :param export_name: Export Name. :type export_name: str @@ -430,7 +483,6 @@ def get_execution_history( raise models.ErrorResponseException(self._deserialize, response) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('ExportExecutionListResult', response) diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_operations.py similarity index 87% rename from sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/operations.py rename to sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_operations.py index ab1bdbe26fc0..9b8e7a21167b 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/operations.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_operations.py @@ -18,11 +18,13 @@ class Operations(object): """Operations operations. + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2018-05-31. Constant value: "2019-01-01". + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-11-01. Constant value: "2019-11-01". """ models = models @@ -32,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-01-01" + self.api_version = "2019-11-01" self.config = config @@ -51,8 +53,7 @@ def list( :raises: :class:`ErrorResponseException` """ - def internal_paging(next_link=None, raw=False): - + def prepare_request(next_link=None): if not next_link: # Construct URL url = self.list.metadata['url'] @@ -77,6 +78,11 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: @@ -85,12 +91,10 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies) - + header_dict = None if raw: header_dict = {} - client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list.metadata = {'url': '/providers/Microsoft.CostManagement/operations'} diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_query_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_query_operations.py new file mode 100644 index 000000000000..00191d7f0ddf --- /dev/null +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_query_operations.py @@ -0,0 +1,120 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class QueryOperations(object): + """QueryOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-11-01. Constant value: "2019-11-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-11-01" + + self.config = config + + def usage( + self, scope, parameters, custom_headers=None, raw=False, **operation_config): + """Query the usage data for scope defined. + + :param scope: The scope associated with query and export operations. + This includes '/subscriptions/{subscriptionId}/' for subscription + scope, + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' + for resourceGroup scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for + Billing Account scope and + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' + for Department scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + for EnrollmentAccount scope, + '/providers/Microsoft.Management/managementGroups/{managementGroupId} + for Management Group scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + for billingProfile scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + for invoiceSection scope, and + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' + specific for partners. + :type scope: str + :param parameters: Parameters supplied to the CreateOrUpdate Query + Config operation. + :type parameters: ~azure.mgmt.costmanagement.models.QueryDefinition + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: QueryResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.costmanagement.models.QueryResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.usage.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, 'QueryDefinition') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('QueryResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + usage.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/query'} diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/query_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/query_operations.py deleted file mode 100644 index c855c0cdd6f4..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/query_operations.py +++ /dev/null @@ -1,120 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse - -from .. import models - - -class QueryOperations(object): - """QueryOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2018-05-31. Constant value: "2019-01-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-01-01" - - self.config = config - - def usage_by_scope( - self, scope, parameters, custom_headers=None, raw=False, **operation_config): - """Query the usage data for scope defined. - - :param scope: The scope associated with query operations. This - includes '/subscriptions/{subscriptionId}/' for subscription scope, - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' - for resourceGroup scope, - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for - Billing Account scope and - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' - for Department scope, - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - for EnrollmentAccount scope and - '/providers/Microsoft.Management/managementGroups/{managementGroupId} - for Management Group scope.. - :type scope: str - :param parameters: Parameters supplied to the CreateOrUpdate Query - Config operation. - :type parameters: ~azure.mgmt.costmanagement.models.QueryDefinition - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Query - :rtype: - ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.usage_by_scope.metadata['url'] - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'QueryDefinition') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - usage_by_scope.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/query'}