From 9cf34cc6374b2e4960ce989d36cb31c0220605ed Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Sat, 4 May 2019 07:53:58 -0700 Subject: [PATCH] [AutoPR] cost-management/resource-manager (#2924) * Generated from 58db2cd8519af2e0e6f428c7ab82da2891b440f5 (#2836) add README file for cost management * Generated from 7d375b2ce4c679c5e3a1f63185925ca83422c098 (#3068) Add Connector resource type as preview to CostManagement RP * Initial commit for Microsoft.CostManagement 2018-09-01-preview * Add Connector resource type as preview to CostManagement RP * [AutoPR cost-management/resource-manager] Reports API moved from stable to preview version with addition of documentation of a couple of new APIs (#3145) * Generated from 9f3607b94b9c3f9b6c2fa12ae00ed71a80d42699 Updated reports api documentation * Generated from 41ff04d4ffb063505850fbecd4dd6061f4072f29 Undo remove of API from stable version * [AutoPR cost-management/resource-manager] Fixing examples and adding missed properties (#3480) * Generated from 73f83b4c51d265aca17132381382f60da78d5f7a Fixing examples and adding missed properties * Packaging update of azure-mgmt-costmanagement * [AutoPR cost-management/resource-manager] typo: Microsoft.CostManagement (#3929) * Generated from 56aef8383527613e2ee15566cd34c6b92fd07647 typo: Microsoft.CostManagement - acount -> account - dategory -> category - upto -> up to - atleast -> at least - comaprison -> comparison - exeuction -> execution - occuring -> occurring - overriden -> overridden - managment -. management * Packaging update of azure-mgmt-costmanagement * Generated from 855ab2ed573e2d8fe8a65f8a8e638e8a9b033759 (#4202) Suppress OperationsAPIImplementation error for Microsoft.Billing * [AutoPR cost-management/resource-manager] PR - Introduce new API version (2019-01-01) with new (Export-related APIs) introduced (#4291) * Generated from 1fd359a4268074a5afb5b0706411b500260ea8ac readme updated to update tag package name per reviewers suggestion to fix check errors. * Packaging update of azure-mgmt-costmanagement * Generated from 8b2e7a5828fed35240abcbd92caca0f5a612a470 Based on ARM review introduced the use of 'scope' and abstracted out different scopes for API paths defined * Generated from fe55f184a9e5d9b66823d36ffe90a8a89411da2b ARM review based changes. * Generated from 97b0e06c068c2403ec16aa2ecea95e4c79d4d65a ARM review based change. Updated path to represent 'scope'. * Generated from 526b0925dc38b30e76398f351a475a013b77cac7 updated query parameter scope to include management group path * Update HISTORY.rst * Update sdk_packaging.toml * Update version.py * Packaging update of azure-mgmt-costmanagement * Generated from a2af3bff7af39874c0611ca27d8b00c33e79be3b (#4413) Add Put Rule * [AutoPR cost-management/resource-manager] [Hub Generated] Review request for Microsoft.CostManagement to add version stable/2019-01-01 (#4825) * Generated from b8c32f37aa9e744d36530fcbd4caac35a37828f2 Adds suppression to readme * Packaging update of azure-mgmt-costmanagement * Generated from dda9bf78560444698902a49dadcbf2a5598dd1e9 updated examples with scope param and fixed syntax error * 0.1.0 --- azure-mgmt-costmanagement/HISTORY.rst | 9 + azure-mgmt-costmanagement/MANIFEST.in | 5 + azure-mgmt-costmanagement/README.rst | 33 ++ azure-mgmt-costmanagement/azure/__init__.py | 1 + .../azure/mgmt/__init__.py | 1 + .../azure/mgmt/costmanagement/__init__.py | 18 + .../costmanagement/cost_management_client.py | 96 ++++ .../mgmt/costmanagement/models/__init__.py | 120 +++++ .../models/common_export_properties.py | 44 ++ .../models/common_export_properties_py3.py | 44 ++ .../models/cost_management_client_enums.py | 77 +++ .../mgmt/costmanagement/models/dimension.py | 82 ++++ .../costmanagement/models/dimension_paged.py | 27 ++ .../costmanagement/models/dimension_py3.py | 82 ++++ .../costmanagement/models/error_details.py | 40 ++ .../models/error_details_py3.py | 40 ++ .../costmanagement/models/error_response.py | 42 ++ .../models/error_response_py3.py | 42 ++ .../mgmt/costmanagement/models/export.py | 67 +++ .../models/export_delivery_destination.py | 46 ++ .../models/export_delivery_destination_py3.py | 46 ++ .../models/export_delivery_info.py | 36 ++ .../models/export_delivery_info_py3.py | 36 ++ .../costmanagement/models/export_execution.py | 86 ++++ .../models/export_execution_list_result.py | 35 ++ .../export_execution_list_result_py3.py | 35 ++ .../models/export_execution_py3.py | 86 ++++ .../models/export_list_result.py | 36 ++ .../models/export_list_result_py3.py | 36 ++ .../mgmt/costmanagement/models/export_py3.py | 67 +++ .../models/export_recurrence_period.py | 38 ++ .../models/export_recurrence_period_py3.py | 38 ++ .../costmanagement/models/export_schedule.py | 48 ++ .../models/export_schedule_py3.py | 48 ++ .../mgmt/costmanagement/models/operation.py | 39 ++ .../models/operation_display.py | 46 ++ .../models/operation_display_py3.py | 46 ++ .../costmanagement/models/operation_paged.py | 27 ++ .../costmanagement/models/operation_py3.py | 39 ++ .../azure/mgmt/costmanagement/models/query.py | 58 +++ .../models/query_aggregation.py | 44 ++ .../models/query_aggregation_py3.py | 44 ++ .../costmanagement/models/query_column.py | 32 ++ .../costmanagement/models/query_column_py3.py | 32 ++ .../models/query_comparison_expression.py | 49 ++ .../models/query_comparison_expression_py3.py | 49 ++ .../costmanagement/models/query_dataset.py | 62 +++ .../models/query_dataset_configuration.py | 30 ++ .../models/query_dataset_configuration_py3.py | 30 ++ .../models/query_dataset_py3.py | 62 +++ .../costmanagement/models/query_definition.py | 54 +++ .../models/query_definition_py3.py | 54 +++ .../costmanagement/models/query_filter.py | 52 +++ .../costmanagement/models/query_filter_py3.py | 52 +++ .../costmanagement/models/query_grouping.py | 40 ++ .../models/query_grouping_py3.py | 40 ++ .../mgmt/costmanagement/models/query_paged.py | 27 ++ .../mgmt/costmanagement/models/query_py3.py | 58 +++ .../models/query_sorting_configuration.py | 34 ++ .../models/query_sorting_configuration_py3.py | 34 ++ .../models/query_time_period.py | 39 ++ .../models/query_time_period_py3.py | 39 ++ .../mgmt/costmanagement/models/resource.py | 50 ++ .../costmanagement/models/resource_py3.py | 50 ++ .../costmanagement/operations/__init__.py | 22 + .../operations/dimensions_operations.py | 137 ++++++ .../operations/exports_operations.py | 442 ++++++++++++++++++ .../costmanagement/operations/operations.py | 96 ++++ .../operations/query_operations.py | 120 +++++ .../azure/mgmt/costmanagement/version.py | 13 + azure-mgmt-costmanagement/sdk_packaging.toml | 7 + azure-mgmt-costmanagement/setup.cfg | 2 + azure-mgmt-costmanagement/setup.py | 88 ++++ 73 files changed, 3826 insertions(+) create mode 100644 azure-mgmt-costmanagement/HISTORY.rst create mode 100644 azure-mgmt-costmanagement/MANIFEST.in create mode 100644 azure-mgmt-costmanagement/README.rst create mode 100644 azure-mgmt-costmanagement/azure/__init__.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/__init__.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/__init__.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/cost_management_client.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/common_export_properties.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/common_export_properties_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/cost_management_client_enums.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/dimension.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/dimension_paged.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/dimension_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_response.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_response_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_destination.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_destination_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_info.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_info_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution_list_result.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution_list_result_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_list_result.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_list_result_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_recurrence_period.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_recurrence_period_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_schedule.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_schedule_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation_display.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation_display_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation_paged.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_aggregation.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_aggregation_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_column.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_column_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_comparison_expression.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_comparison_expression_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset_configuration.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset_configuration_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_definition.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_definition_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_filter.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_filter_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_grouping.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_grouping_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_paged.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_sorting_configuration.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_sorting_configuration_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_time_period.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_time_period_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/resource.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/resource_py3.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/dimensions_operations.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/exports_operations.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/operations.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/query_operations.py create mode 100644 azure-mgmt-costmanagement/azure/mgmt/costmanagement/version.py create mode 100644 azure-mgmt-costmanagement/sdk_packaging.toml create mode 100644 azure-mgmt-costmanagement/setup.cfg create mode 100644 azure-mgmt-costmanagement/setup.py diff --git a/azure-mgmt-costmanagement/HISTORY.rst b/azure-mgmt-costmanagement/HISTORY.rst new file mode 100644 index 000000000000..3d8ece1c7a41 --- /dev/null +++ b/azure-mgmt-costmanagement/HISTORY.rst @@ -0,0 +1,9 @@ +.. :changelog: + +Release History +=============== + +0.1.0 (2019-05-04) +++++++++++++++++++ + +* Initial Release diff --git a/azure-mgmt-costmanagement/MANIFEST.in b/azure-mgmt-costmanagement/MANIFEST.in new file mode 100644 index 000000000000..e4884efef41b --- /dev/null +++ b/azure-mgmt-costmanagement/MANIFEST.in @@ -0,0 +1,5 @@ +recursive-include tests *.py *.yaml +include *.rst +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/azure-mgmt-costmanagement/README.rst b/azure-mgmt-costmanagement/README.rst new file mode 100644 index 000000000000..57a3d5212207 --- /dev/null +++ b/azure-mgmt-costmanagement/README.rst @@ -0,0 +1,33 @@ +Microsoft Azure SDK for Python +============================== + +This is the Microsoft Azure Cost Management Client Library. + +Azure Resource Manager (ARM) is the next generation of management APIs that +replace the old Azure Service Management (ASM). + +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. + +For the older Azure Service Management (ASM) libraries, see +`azure-servicemanagement-legacy `__ library. + +For a more complete set of Azure libraries, see the `azure `__ bundle package. + + +Usage +===== + +For code examples, see `Cost Management +`__ +on docs.microsoft.com. + + +Provide Feedback +================ + +If you encounter any bugs or have suggestions, please file an issue in the +`Issues `__ +section of the project. + + +.. image:: https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-costmanagement%2FREADME.png diff --git a/azure-mgmt-costmanagement/azure/__init__.py b/azure-mgmt-costmanagement/azure/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/azure-mgmt-costmanagement/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-mgmt-costmanagement/azure/mgmt/__init__.py b/azure-mgmt-costmanagement/azure/mgmt/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/__init__.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/__init__.py new file mode 100644 index 000000000000..b6ddbca6316a --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/__init__.py @@ -0,0 +1,18 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .cost_management_client import CostManagementClient +from .version import VERSION + +__all__ = ['CostManagementClient'] + +__version__ = VERSION + diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/cost_management_client.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/cost_management_client.py new file mode 100644 index 000000000000..cc8458f1727e --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/cost_management_client.py @@ -0,0 +1,96 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +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 + + +class CostManagementClient(SDKClient): + """CostManagementClient + + :ivar config: Configuration for client. + :vartype config: CostManagementClientConfiguration + + :ivar dimensions: Dimensions operations + :vartype dimensions: azure.mgmt.costmanagement.operations.DimensionsOperations + :ivar query: Query operations + :vartype query: azure.mgmt.costmanagement.operations.QueryOperations + :ivar exports: Exports operations + :vartype exports: azure.mgmt.costmanagement.operations.ExportsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.costmanagement.operations.Operations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Azure Subscription ID. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = CostManagementClientConfiguration(credentials, subscription_id, base_url) + super(CostManagementClient, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2019-01-01' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.dimensions = DimensionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.query = QueryOperations( + self._client, self.config, self._serialize, self._deserialize) + self.exports = ExportsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py new file mode 100644 index 000000000000..1fc845d344b9 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.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. +# -------------------------------------------------------------------------- + +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 +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 ( + TimeframeType, + GranularityType, + QueryColumnType, + SortDirection, + StatusType, + RecurrenceType, + FormatType, + ExecutionType, + ExecutionStatus, +) + +__all__ = [ + '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', + 'DimensionPaged', + 'QueryPaged', + 'OperationPaged', + 'TimeframeType', + 'GranularityType', + 'QueryColumnType', + 'SortDirection', + 'StatusType', + 'RecurrenceType', + 'FormatType', + 'ExecutionType', + 'ExecutionStatus', +] diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/common_export_properties.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/common_export_properties.py new file mode 100644 index 000000000000..9024a61aeff2 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/common_export_properties.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CommonExportProperties(Model): + """The common properties of the export. + + All required parameters must be populated in order to send to Azure. + + :param format: The format of the export being delivered. Possible values + include: 'Csv' + :type format: str or ~azure.mgmt.costmanagement.models.FormatType + :param delivery_info: Required. Has delivery information for the export. + :type delivery_info: ~azure.mgmt.costmanagement.models.ExportDeliveryInfo + :param definition: Required. Has definition for the export. + :type definition: ~azure.mgmt.costmanagement.models.QueryDefinition + """ + + _validation = { + 'delivery_info': {'required': True}, + 'definition': {'required': True}, + } + + _attribute_map = { + 'format': {'key': 'format', 'type': 'str'}, + 'delivery_info': {'key': 'deliveryInfo', 'type': 'ExportDeliveryInfo'}, + 'definition': {'key': 'definition', 'type': 'QueryDefinition'}, + } + + def __init__(self, **kwargs): + super(CommonExportProperties, self).__init__(**kwargs) + self.format = kwargs.get('format', None) + self.delivery_info = kwargs.get('delivery_info', None) + self.definition = kwargs.get('definition', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/common_export_properties_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/common_export_properties_py3.py new file mode 100644 index 000000000000..6841ba2a2dce --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/common_export_properties_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CommonExportProperties(Model): + """The common properties of the export. + + All required parameters must be populated in order to send to Azure. + + :param format: The format of the export being delivered. Possible values + include: 'Csv' + :type format: str or ~azure.mgmt.costmanagement.models.FormatType + :param delivery_info: Required. Has delivery information for the export. + :type delivery_info: ~azure.mgmt.costmanagement.models.ExportDeliveryInfo + :param definition: Required. Has definition for the export. + :type definition: ~azure.mgmt.costmanagement.models.QueryDefinition + """ + + _validation = { + 'delivery_info': {'required': True}, + 'definition': {'required': True}, + } + + _attribute_map = { + 'format': {'key': 'format', 'type': 'str'}, + 'delivery_info': {'key': 'deliveryInfo', 'type': 'ExportDeliveryInfo'}, + 'definition': {'key': 'definition', 'type': 'QueryDefinition'}, + } + + def __init__(self, *, delivery_info, definition, format=None, **kwargs) -> None: + super(CommonExportProperties, self).__init__(**kwargs) + self.format = format + self.delivery_info = delivery_info + self.definition = definition diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/cost_management_client_enums.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/cost_management_client_enums.py new file mode 100644 index 000000000000..26507b572db1 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/cost_management_client_enums.py @@ -0,0 +1,77 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum + + +class TimeframeType(str, Enum): + + week_to_date = "WeekToDate" + month_to_date = "MonthToDate" + year_to_date = "YearToDate" + the_last_week = "TheLastWeek" + the_last_month = "TheLastMonth" + the_last_year = "TheLastYear" + custom = "Custom" + + +class GranularityType(str, Enum): + + daily = "Daily" + hourly = "Hourly" + + +class QueryColumnType(str, Enum): + + tag = "Tag" + dimension = "Dimension" + + +class SortDirection(str, Enum): + + ascending = "Ascending" + descending = "Descending" + + +class StatusType(str, Enum): + + active = "Active" + inactive = "Inactive" + + +class RecurrenceType(str, Enum): + + daily = "Daily" + weekly = "Weekly" + monthly = "Monthly" + annually = "Annually" + + +class FormatType(str, Enum): + + csv = "Csv" + + +class ExecutionType(str, Enum): + + on_demand = "OnDemand" + scheduled = "Scheduled" + + +class ExecutionStatus(str, Enum): + + queued = "Queued" + in_progress = "InProgress" + completed = "Completed" + failed = "Failed" + timeout = "Timeout" + new_data_not_available = "NewDataNotAvailable" + data_not_available = "DataNotAvailable" diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/dimension.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/dimension.py new file mode 100644 index 000000000000..8a54c783616d --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/dimension.py @@ -0,0 +1,82 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/dimension_paged.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/dimension_paged.py new file mode 100644 index 000000000000..ef41cfaa70f2 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/dimension_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class DimensionPaged(Paged): + """ + A paging container for iterating over a list of :class:`Dimension ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Dimension]'} + } + + def __init__(self, *args, **kwargs): + + super(DimensionPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/dimension_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/dimension_py3.py new file mode 100644 index 000000000000..ae7f8d7ca51f --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/dimension_py3.py @@ -0,0 +1,82 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details.py new file mode 100644 index 000000000000..03f3e23d2153 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ErrorDetails(Model): + """The details of the error. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: Error code. + :vartype code: str + :ivar message: Error message indicating why the operation failed. + :vartype message: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ErrorDetails, self).__init__(**kwargs) + self.code = None + self.message = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details_py3.py new file mode 100644 index 000000000000..f9e1adeac9fe --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ErrorDetails(Model): + """The details of the error. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: Error code. + :vartype code: str + :ivar message: Error message indicating why the operation failed. + :vartype message: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorDetails, self).__init__(**kwargs) + self.code = None + self.message = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_response.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_response.py new file mode 100644 index 000000000000..981621ff3605 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_response.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class ErrorResponse(Model): + """Error response indicates that the service is not able to process the + incoming request. The reason is provided in the error message. + + :param error: The details of the error. + :type error: ~azure.mgmt.costmanagement.models.ErrorDetails + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetails'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_response_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_response_py3.py new file mode 100644 index 000000000000..5d3046468167 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_response_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class ErrorResponse(Model): + """Error response indicates that the service is not able to process the + incoming request. The reason is provided in the error message. + + :param error: The details of the error. + :type error: ~azure.mgmt.costmanagement.models.ErrorDetails + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetails'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export.py new file mode 100644 index 000000000000..9ec61149f406 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class Export(Resource): + """A export resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :param format: The format of the export being delivered. Possible values + include: 'Csv' + :type format: str or ~azure.mgmt.costmanagement.models.FormatType + :param delivery_info: Required. Has delivery information for the export. + :type delivery_info: ~azure.mgmt.costmanagement.models.ExportDeliveryInfo + :param definition: Required. Has definition for the export. + :type definition: ~azure.mgmt.costmanagement.models.QueryDefinition + :param schedule: Has schedule information for the export. + :type schedule: ~azure.mgmt.costmanagement.models.ExportSchedule + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'delivery_info': {'required': True}, + 'definition': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'format': {'key': 'properties.format', 'type': 'str'}, + 'delivery_info': {'key': 'properties.deliveryInfo', 'type': 'ExportDeliveryInfo'}, + 'definition': {'key': 'properties.definition', 'type': 'QueryDefinition'}, + 'schedule': {'key': 'properties.schedule', 'type': 'ExportSchedule'}, + } + + def __init__(self, **kwargs): + super(Export, self).__init__(**kwargs) + self.format = kwargs.get('format', None) + self.delivery_info = kwargs.get('delivery_info', None) + self.definition = kwargs.get('definition', None) + self.schedule = kwargs.get('schedule', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_destination.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_destination.py new file mode 100644 index 000000000000..949d25357d8e --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_destination.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExportDeliveryDestination(Model): + """The destination information for the delivery of the export. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. The resource id of the storage account where + exports will be delivered. + :type resource_id: str + :param container: Required. The name of the container where exports will + be uploaded. + :type container: str + :param root_folder_path: The name of the directory where exports will be + uploaded. + :type root_folder_path: str + """ + + _validation = { + 'resource_id': {'required': True}, + 'container': {'required': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'container': {'key': 'container', 'type': 'str'}, + 'root_folder_path': {'key': 'rootFolderPath', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ExportDeliveryDestination, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.container = kwargs.get('container', None) + self.root_folder_path = kwargs.get('root_folder_path', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_destination_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_destination_py3.py new file mode 100644 index 000000000000..3f2f70bffd4a --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_destination_py3.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExportDeliveryDestination(Model): + """The destination information for the delivery of the export. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. The resource id of the storage account where + exports will be delivered. + :type resource_id: str + :param container: Required. The name of the container where exports will + be uploaded. + :type container: str + :param root_folder_path: The name of the directory where exports will be + uploaded. + :type root_folder_path: str + """ + + _validation = { + 'resource_id': {'required': True}, + 'container': {'required': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'container': {'key': 'container', 'type': 'str'}, + 'root_folder_path': {'key': 'rootFolderPath', 'type': 'str'}, + } + + def __init__(self, *, resource_id: str, container: str, root_folder_path: str=None, **kwargs) -> None: + super(ExportDeliveryDestination, self).__init__(**kwargs) + self.resource_id = resource_id + self.container = container + self.root_folder_path = root_folder_path diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_info.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_info.py new file mode 100644 index 000000000000..996aa73156d6 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_info.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExportDeliveryInfo(Model): + """The delivery information associated with a export. + + All required parameters must be populated in order to send to Azure. + + :param destination: Required. Has destination for the export being + delivered. + :type destination: + ~azure.mgmt.costmanagement.models.ExportDeliveryDestination + """ + + _validation = { + 'destination': {'required': True}, + } + + _attribute_map = { + 'destination': {'key': 'destination', 'type': 'ExportDeliveryDestination'}, + } + + def __init__(self, **kwargs): + super(ExportDeliveryInfo, self).__init__(**kwargs) + self.destination = kwargs.get('destination', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_info_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_info_py3.py new file mode 100644 index 000000000000..43fce117f331 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_info_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExportDeliveryInfo(Model): + """The delivery information associated with a export. + + All required parameters must be populated in order to send to Azure. + + :param destination: Required. Has destination for the export being + delivered. + :type destination: + ~azure.mgmt.costmanagement.models.ExportDeliveryDestination + """ + + _validation = { + 'destination': {'required': True}, + } + + _attribute_map = { + 'destination': {'key': 'destination', 'type': 'ExportDeliveryDestination'}, + } + + def __init__(self, *, destination, **kwargs) -> None: + super(ExportDeliveryInfo, self).__init__(**kwargs) + self.destination = destination diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution.py new file mode 100644 index 000000000000..7843f0594630 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution.py @@ -0,0 +1,86 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ExportExecution(Resource): + """A export execution. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :param execution_type: The type of the export execution. Possible values + include: 'OnDemand', 'Scheduled' + :type execution_type: str or + ~azure.mgmt.costmanagement.models.ExecutionType + :param status: The status of the export execution. Possible values + include: 'Queued', 'InProgress', 'Completed', 'Failed', 'Timeout', + 'NewDataNotAvailable', 'DataNotAvailable' + :type status: str or ~azure.mgmt.costmanagement.models.ExecutionStatus + :param submitted_by: The identifier for the entity that executed the + export. For OnDemand executions, it is the email id. For Scheduled + executions, it is the constant value - System. + :type submitted_by: str + :param submitted_time: The time when export was queued to be executed. + :type submitted_time: datetime + :param processing_start_time: The time when export was picked up to be + executed. + :type processing_start_time: datetime + :param processing_end_time: The time when export execution finished. + :type processing_end_time: datetime + :param file_name: The name of the file export got written to. + :type file_name: str + :param run_settings: + :type run_settings: + ~azure.mgmt.costmanagement.models.CommonExportProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'execution_type': {'key': 'properties.executionType', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'submitted_by': {'key': 'properties.submittedBy', 'type': 'str'}, + 'submitted_time': {'key': 'properties.submittedTime', 'type': 'iso-8601'}, + 'processing_start_time': {'key': 'properties.processingStartTime', 'type': 'iso-8601'}, + 'processing_end_time': {'key': 'properties.processingEndTime', 'type': 'iso-8601'}, + 'file_name': {'key': 'properties.fileName', 'type': 'str'}, + 'run_settings': {'key': 'properties.runSettings', 'type': 'CommonExportProperties'}, + } + + def __init__(self, **kwargs): + super(ExportExecution, self).__init__(**kwargs) + self.execution_type = kwargs.get('execution_type', None) + self.status = kwargs.get('status', None) + self.submitted_by = kwargs.get('submitted_by', None) + self.submitted_time = kwargs.get('submitted_time', None) + self.processing_start_time = kwargs.get('processing_start_time', None) + self.processing_end_time = kwargs.get('processing_end_time', None) + self.file_name = kwargs.get('file_name', None) + self.run_settings = kwargs.get('run_settings', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution_list_result.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution_list_result.py new file mode 100644 index 000000000000..d3a017601d17 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution_list_result.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExportExecutionListResult(Model): + """Result of listing exports execution history of a export by name. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of export executions. + :vartype value: list[~azure.mgmt.costmanagement.models.ExportExecution] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExportExecution]'}, + } + + def __init__(self, **kwargs): + super(ExportExecutionListResult, self).__init__(**kwargs) + self.value = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution_list_result_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution_list_result_py3.py new file mode 100644 index 000000000000..ae37c54c2e60 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution_list_result_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExportExecutionListResult(Model): + """Result of listing exports execution history of a export by name. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of export executions. + :vartype value: list[~azure.mgmt.costmanagement.models.ExportExecution] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExportExecution]'}, + } + + def __init__(self, **kwargs) -> None: + super(ExportExecutionListResult, self).__init__(**kwargs) + self.value = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution_py3.py new file mode 100644 index 000000000000..00d8281329cc --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution_py3.py @@ -0,0 +1,86 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class ExportExecution(Resource): + """A export execution. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :param execution_type: The type of the export execution. Possible values + include: 'OnDemand', 'Scheduled' + :type execution_type: str or + ~azure.mgmt.costmanagement.models.ExecutionType + :param status: The status of the export execution. Possible values + include: 'Queued', 'InProgress', 'Completed', 'Failed', 'Timeout', + 'NewDataNotAvailable', 'DataNotAvailable' + :type status: str or ~azure.mgmt.costmanagement.models.ExecutionStatus + :param submitted_by: The identifier for the entity that executed the + export. For OnDemand executions, it is the email id. For Scheduled + executions, it is the constant value - System. + :type submitted_by: str + :param submitted_time: The time when export was queued to be executed. + :type submitted_time: datetime + :param processing_start_time: The time when export was picked up to be + executed. + :type processing_start_time: datetime + :param processing_end_time: The time when export execution finished. + :type processing_end_time: datetime + :param file_name: The name of the file export got written to. + :type file_name: str + :param run_settings: + :type run_settings: + ~azure.mgmt.costmanagement.models.CommonExportProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'execution_type': {'key': 'properties.executionType', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'submitted_by': {'key': 'properties.submittedBy', 'type': 'str'}, + 'submitted_time': {'key': 'properties.submittedTime', 'type': 'iso-8601'}, + 'processing_start_time': {'key': 'properties.processingStartTime', 'type': 'iso-8601'}, + 'processing_end_time': {'key': 'properties.processingEndTime', 'type': 'iso-8601'}, + 'file_name': {'key': 'properties.fileName', 'type': 'str'}, + 'run_settings': {'key': 'properties.runSettings', 'type': 'CommonExportProperties'}, + } + + def __init__(self, *, execution_type=None, status=None, submitted_by: str=None, submitted_time=None, processing_start_time=None, processing_end_time=None, file_name: str=None, run_settings=None, **kwargs) -> None: + super(ExportExecution, self).__init__(**kwargs) + self.execution_type = execution_type + self.status = status + self.submitted_by = submitted_by + self.submitted_time = submitted_time + self.processing_start_time = processing_start_time + self.processing_end_time = processing_end_time + self.file_name = file_name + self.run_settings = run_settings diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_list_result.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_list_result.py new file mode 100644 index 000000000000..0a894f869f41 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_list_result.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_list_result_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_list_result_py3.py new file mode 100644 index 000000000000..562f78ca565e --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_list_result_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExportListResult(Model): + """Result of listing exports. It contains a list of available exports in the + scope provided. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of exports. + :vartype value: list[~azure.mgmt.costmanagement.models.Export] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Export]'}, + } + + def __init__(self, **kwargs) -> None: + super(ExportListResult, self).__init__(**kwargs) + self.value = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_py3.py new file mode 100644 index 000000000000..bf8cbd862cb0 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_py3.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class Export(Resource): + """A export resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :param format: The format of the export being delivered. Possible values + include: 'Csv' + :type format: str or ~azure.mgmt.costmanagement.models.FormatType + :param delivery_info: Required. Has delivery information for the export. + :type delivery_info: ~azure.mgmt.costmanagement.models.ExportDeliveryInfo + :param definition: Required. Has definition for the export. + :type definition: ~azure.mgmt.costmanagement.models.QueryDefinition + :param schedule: Has schedule information for the export. + :type schedule: ~azure.mgmt.costmanagement.models.ExportSchedule + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'delivery_info': {'required': True}, + 'definition': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'format': {'key': 'properties.format', 'type': 'str'}, + 'delivery_info': {'key': 'properties.deliveryInfo', 'type': 'ExportDeliveryInfo'}, + 'definition': {'key': 'properties.definition', 'type': 'QueryDefinition'}, + 'schedule': {'key': 'properties.schedule', 'type': 'ExportSchedule'}, + } + + def __init__(self, *, delivery_info, definition, format=None, schedule=None, **kwargs) -> None: + super(Export, self).__init__(**kwargs) + self.format = format + self.delivery_info = delivery_info + self.definition = definition + self.schedule = schedule diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_recurrence_period.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_recurrence_period.py new file mode 100644 index 000000000000..928221e85bfa --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_recurrence_period.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExportRecurrencePeriod(Model): + """The start and end date for recurrence schedule. + + All required parameters must be populated in order to send to Azure. + + :param from_property: Required. The start date of recurrence. + :type from_property: datetime + :param to: The end date of recurrence. + :type to: datetime + """ + + _validation = { + 'from_property': {'required': True}, + } + + _attribute_map = { + 'from_property': {'key': 'from', 'type': 'iso-8601'}, + 'to': {'key': 'to', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(ExportRecurrencePeriod, self).__init__(**kwargs) + self.from_property = kwargs.get('from_property', None) + self.to = kwargs.get('to', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_recurrence_period_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_recurrence_period_py3.py new file mode 100644 index 000000000000..98cc8316fb69 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_recurrence_period_py3.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExportRecurrencePeriod(Model): + """The start and end date for recurrence schedule. + + All required parameters must be populated in order to send to Azure. + + :param from_property: Required. The start date of recurrence. + :type from_property: datetime + :param to: The end date of recurrence. + :type to: datetime + """ + + _validation = { + 'from_property': {'required': True}, + } + + _attribute_map = { + 'from_property': {'key': 'from', 'type': 'iso-8601'}, + 'to': {'key': 'to', 'type': 'iso-8601'}, + } + + def __init__(self, *, from_property, to=None, **kwargs) -> None: + super(ExportRecurrencePeriod, self).__init__(**kwargs) + self.from_property = from_property + self.to = to diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_schedule.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_schedule.py new file mode 100644 index 000000000000..29ed33f58aa3 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_schedule.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExportSchedule(Model): + """The schedule associated with a export. + + All required parameters must be populated in order to send to Azure. + + :param status: The status of the schedule. Whether active or not. If + inactive, the export's scheduled execution is paused. Possible values + include: 'Active', 'Inactive' + :type status: str or ~azure.mgmt.costmanagement.models.StatusType + :param recurrence: Required. The schedule recurrence. Possible values + include: 'Daily', 'Weekly', 'Monthly', 'Annually' + :type recurrence: str or ~azure.mgmt.costmanagement.models.RecurrenceType + :param recurrence_period: Has start and end date of the recurrence. The + start date must be in future. If present, the end date must be greater + than start date. + :type recurrence_period: + ~azure.mgmt.costmanagement.models.ExportRecurrencePeriod + """ + + _validation = { + 'recurrence': {'required': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'recurrence': {'key': 'recurrence', 'type': 'str'}, + 'recurrence_period': {'key': 'recurrencePeriod', 'type': 'ExportRecurrencePeriod'}, + } + + def __init__(self, **kwargs): + super(ExportSchedule, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.recurrence = kwargs.get('recurrence', None) + self.recurrence_period = kwargs.get('recurrence_period', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_schedule_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_schedule_py3.py new file mode 100644 index 000000000000..76235e40c282 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_schedule_py3.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExportSchedule(Model): + """The schedule associated with a export. + + All required parameters must be populated in order to send to Azure. + + :param status: The status of the schedule. Whether active or not. If + inactive, the export's scheduled execution is paused. Possible values + include: 'Active', 'Inactive' + :type status: str or ~azure.mgmt.costmanagement.models.StatusType + :param recurrence: Required. The schedule recurrence. Possible values + include: 'Daily', 'Weekly', 'Monthly', 'Annually' + :type recurrence: str or ~azure.mgmt.costmanagement.models.RecurrenceType + :param recurrence_period: Has start and end date of the recurrence. The + start date must be in future. If present, the end date must be greater + than start date. + :type recurrence_period: + ~azure.mgmt.costmanagement.models.ExportRecurrencePeriod + """ + + _validation = { + 'recurrence': {'required': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'recurrence': {'key': 'recurrence', 'type': 'str'}, + 'recurrence_period': {'key': 'recurrencePeriod', 'type': 'ExportRecurrencePeriod'}, + } + + def __init__(self, *, recurrence, status=None, recurrence_period=None, **kwargs) -> None: + super(ExportSchedule, self).__init__(**kwargs) + self.status = status + self.recurrence = recurrence + self.recurrence_period = recurrence_period diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation.py new file mode 100644 index 000000000000..c5965e54743a --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Operation(Model): + """A Cost management REST API operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Operation name: {provider}/{resource}/{operation}. + :vartype name: str + :param display: The object that represents the operation. + :type display: ~azure.mgmt.costmanagement.models.OperationDisplay + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = kwargs.get('display', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation_display.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation_display.py new file mode 100644 index 000000000000..e85e6e2a6647 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation_display.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDisplay(Model): + """The object that represents the operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: Service provider: Microsoft.CostManagement. + :vartype provider: str + :ivar resource: Resource on which the operation is performed: Dimensions, + Query. + :vartype resource: str + :ivar operation: Operation type: Read, write, delete, etc. + :vartype operation: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation_display_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation_display_py3.py new file mode 100644 index 000000000000..63ff2a7e14df --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation_display_py3.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDisplay(Model): + """The object that represents the operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: Service provider: Microsoft.CostManagement. + :vartype provider: str + :ivar resource: Resource on which the operation is performed: Dimensions, + Query. + :vartype resource: str + :ivar operation: Operation type: Read, write, delete, etc. + :vartype operation: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation_paged.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation_paged.py new file mode 100644 index 000000000000..2127f26e1525 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation_py3.py new file mode 100644 index 000000000000..c69e983617b9 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/operation_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Operation(Model): + """A Cost management REST API operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Operation name: {provider}/{resource}/{operation}. + :vartype name: str + :param display: The object that represents the operation. + :type display: ~azure.mgmt.costmanagement.models.OperationDisplay + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, *, display=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = display diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query.py new file mode 100644 index 000000000000..d2dd13ad3e7f --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class Query(Resource): + """Query. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :param next_link: + :type next_link: str + :param columns: Array of columns + :type columns: list[~azure.mgmt.costmanagement.models.QueryColumn] + :param rows: + :type rows: list[list[object]] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'next_link': {'key': 'properties.nextLink', 'type': 'str'}, + 'columns': {'key': 'properties.columns', 'type': '[QueryColumn]'}, + 'rows': {'key': 'properties.rows', 'type': '[[object]]'}, + } + + def __init__(self, **kwargs): + super(Query, self).__init__(**kwargs) + self.next_link = kwargs.get('next_link', None) + self.columns = kwargs.get('columns', None) + self.rows = kwargs.get('rows', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_aggregation.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_aggregation.py new file mode 100644 index 000000000000..d6b23a1e6980 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_aggregation.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_aggregation_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_aggregation_py3.py new file mode 100644 index 000000000000..653dd6683433 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_aggregation_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_column.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_column.py new file mode 100644 index 000000000000..3aa1734245bf --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_column.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class QueryColumn(Model): + """QueryColumn. + + :param name: + :type name: str + :param type: + :type type: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(QueryColumn, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_column_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_column_py3.py new file mode 100644 index 000000000000..903dd9b8c11d --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_column_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class QueryColumn(Model): + """QueryColumn. + + :param name: + :type name: str + :param type: + :type type: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, type: str=None, **kwargs) -> None: + super(QueryColumn, self).__init__(**kwargs) + self.name = name + self.type = type diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_comparison_expression.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_comparison_expression.py new file mode 100644 index 000000000000..c932b1a9a232 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_comparison_expression.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_comparison_expression_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_comparison_expression_py3.py new file mode 100644 index 000000000000..d7f1f445571a --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_comparison_expression_py3.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset.py new file mode 100644 index 000000000000..f34f504aa888 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset.py @@ -0,0 +1,62 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset_configuration.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset_configuration.py new file mode 100644 index 000000000000..2b77baab82cc --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset_configuration.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset_configuration_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset_configuration_py3.py new file mode 100644 index 000000000000..4a660322a527 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset_configuration_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset_py3.py new file mode 100644 index 000000000000..016173c300c5 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset_py3.py @@ -0,0 +1,62 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_definition.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_definition.py new file mode 100644 index 000000000000..2893fb7ba3fc --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_definition.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_definition_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_definition_py3.py new file mode 100644 index 000000000000..bf088e52b50a --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_definition_py3.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_filter.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_filter.py new file mode 100644 index 000000000000..0242d37de76d --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_filter.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_filter_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_filter_py3.py new file mode 100644 index 000000000000..f6e4f0ee5976 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_filter_py3.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_grouping.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_grouping.py new file mode 100644 index 000000000000..ee61a9990685 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_grouping.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_grouping_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_grouping_py3.py new file mode 100644 index 000000000000..65f4b79f255f --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_grouping_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_paged.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_paged.py new file mode 100644 index 000000000000..fe30582676d5 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class QueryPaged(Paged): + """ + A paging container for iterating over a list of :class:`Query ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Query]'} + } + + def __init__(self, *args, **kwargs): + + super(QueryPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_py3.py new file mode 100644 index 000000000000..d0d08fb08457 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_py3.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class Query(Resource): + """Query. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :param next_link: + :type next_link: str + :param columns: Array of columns + :type columns: list[~azure.mgmt.costmanagement.models.QueryColumn] + :param rows: + :type rows: list[list[object]] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'next_link': {'key': 'properties.nextLink', 'type': 'str'}, + 'columns': {'key': 'properties.columns', 'type': '[QueryColumn]'}, + 'rows': {'key': 'properties.rows', 'type': '[[object]]'}, + } + + def __init__(self, *, next_link: str=None, columns=None, rows=None, **kwargs) -> None: + super(Query, self).__init__(**kwargs) + self.next_link = next_link + self.columns = columns + self.rows = rows diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_sorting_configuration.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_sorting_configuration.py new file mode 100644 index 000000000000..ea1704928e03 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_sorting_configuration.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class QuerySortingConfiguration(Model): + """The configuration for sorting in the query. + + :param query_sorting_direction: The sorting direction. Possible values + include: 'Ascending', 'Descending' + :type query_sorting_direction: str or + ~azure.mgmt.costmanagement.models.SortDirection + :param name: The name of the column to use in sorting. + :type name: str + """ + + _attribute_map = { + 'query_sorting_direction': {'key': 'querySortingDirection', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **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/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_sorting_configuration_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_sorting_configuration_py3.py new file mode 100644 index 000000000000..fc7524c322d3 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_sorting_configuration_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class QuerySortingConfiguration(Model): + """The configuration for sorting in the query. + + :param query_sorting_direction: The sorting direction. Possible values + include: 'Ascending', 'Descending' + :type query_sorting_direction: str or + ~azure.mgmt.costmanagement.models.SortDirection + :param name: The name of the column to use in sorting. + :type name: str + """ + + _attribute_map = { + 'query_sorting_direction': {'key': 'querySortingDirection', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, query_sorting_direction=None, name: str=None, **kwargs) -> None: + super(QuerySortingConfiguration, self).__init__(**kwargs) + self.query_sorting_direction = query_sorting_direction + self.name = name diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_time_period.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_time_period.py new file mode 100644 index 000000000000..3c0dc37b8619 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_time_period.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_time_period_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_time_period_py3.py new file mode 100644 index 000000000000..63a1d7d6e08c --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_time_period_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/resource.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/resource.py new file mode 100644 index 000000000000..08e36f3f8091 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/resource.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """The Resource model definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.tags = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/resource_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/resource_py3.py new file mode 100644 index 000000000000..38b4ca3ee6af --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/resource_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """The Resource model definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.tags = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py new file mode 100644 index 000000000000..fbf3fa761115 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .dimensions_operations import DimensionsOperations +from .query_operations import QueryOperations +from .exports_operations import ExportsOperations +from .operations import Operations + +__all__ = [ + 'DimensionsOperations', + 'QueryOperations', + 'ExportsOperations', + 'Operations', +] diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/dimensions_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/dimensions_operations.py new file mode 100644 index 000000000000..5bdad8c6f173 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/dimensions_operations.py @@ -0,0 +1,137 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class DimensionsOperations(object): + """DimensionsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-05-31. Constant value: "2019-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-01-01" + + self.config = config + + def list_by_subscription( + self, scope, filter=None, expand=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config): + """Lists the dimensions by the defined scope. + + :param scope: The scope associated with dimension operations. This + includes '/subscriptions/{subscriptionId}/' for subscription scope, + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' + for resourceGroup scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for + Billing Account scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' + for Department scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + for EnrollmentAccount scope and + '/providers/Microsoft.Management/managementGroups/{managementGroupId}' + for Management Group scope.. + :type scope: str + :param filter: May be used to filter dimensions by + properties/category, properties/usageStart, properties/usageEnd. + Supported operators are 'eq','lt', 'gt', 'le', 'ge'. + :type filter: str + :param expand: May be used to expand the properties/data within a + dimension category. By default, data is not included when listing + dimensions. + :type expand: str + :param skiptoken: Skiptoken is only used if a previous operation + returned a partial result. If a previous response contains a nextLink + element, the value of the nextLink element will include a skiptoken + parameter that specifies a starting point to use for subsequent calls. + :type skiptoken: str + :param top: May be used to limit the number of results to the most + recent N dimension data. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Dimension + :rtype: + ~azure.mgmt.costmanagement.models.DimensionPaged[~azure.mgmt.costmanagement.models.Dimension] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] + path_format_arguments = { + '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') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.DimensionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DimensionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_subscription.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/dimensions'} diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/exports_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/exports_operations.py new file mode 100644 index 000000000000..f08534765780 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/exports_operations.py @@ -0,0 +1,442 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ExportsOperations(object): + """ExportsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-05-31. Constant value: "2019-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-01-01" + + self.config = config + + def list( + self, scope, custom_headers=None, raw=False, **operation_config): + """Lists all exports at the given scope. + + :param scope: The scope associated with 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. + :type scope: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ExportListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.costmanagement.models.ExportListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ExportListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports'} + + def get( + self, scope, export_name, custom_headers=None, raw=False, **operation_config): + """Gets the export for the defined scope by export name. + + :param scope: The scope associated with 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. + :type scope: str + :param export_name: Export Name. + :type export_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Export or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.costmanagement.models.Export or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'exportName': self._serialize.url("export_name", export_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Export', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}'} + + def create_or_update( + self, scope, export_name, parameters, custom_headers=None, raw=False, **operation_config): + """The operation to create or update a export. Update operation requires + latest eTag to be set in the request. You may obtain the latest eTag by + performing a get operation. Create operation does not require eTag. + + :param scope: The scope associated with 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. + :type scope: str + :param export_name: Export Name. + :type export_name: str + :param parameters: Parameters supplied to the CreateOrUpdate Export + operation. + :type parameters: ~azure.mgmt.costmanagement.models.Export + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Export or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.costmanagement.models.Export or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'exportName': self._serialize.url("export_name", export_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'Export') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Export', response) + if response.status_code == 201: + deserialized = self._deserialize('Export', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}'} + + def delete( + self, scope, export_name, custom_headers=None, raw=False, **operation_config): + """The operation to delete a export. + + :param scope: The scope associated with 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. + :type scope: str + :param export_name: Export Name. + :type export_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'exportName': self._serialize.url("export_name", export_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}'} + + def execute( + self, scope, export_name, custom_headers=None, raw=False, **operation_config): + """The operation to execute a export. + + :param scope: The scope associated with 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. + :type scope: str + :param export_name: Export Name. + :type export_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.execute.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'exportName': self._serialize.url("export_name", export_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + execute.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/run'} + + def get_execution_history( + self, scope, export_name, custom_headers=None, raw=False, **operation_config): + """Gets the execution history of a export for the defined scope by export + name. + + :param scope: The scope associated with 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. + :type scope: str + :param export_name: Export Name. + :type export_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ExportExecutionListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.costmanagement.models.ExportExecutionListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_execution_history.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'exportName': self._serialize.url("export_name", export_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ExportExecutionListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_execution_history.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/runHistory'} diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/operations.py new file mode 100644 index 000000000000..ab1bdbe26fc0 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/operations.py @@ -0,0 +1,96 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class Operations(object): + """Operations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-05-31. Constant value: "2019-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-01-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available cost management REST API operations. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Operation + :rtype: + ~azure.mgmt.costmanagement.models.OperationPaged[~azure.mgmt.costmanagement.models.Operation] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.CostManagement/operations'} diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/query_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/query_operations.py new file mode 100644 index 000000000000..c855c0cdd6f4 --- /dev/null +++ b/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. + + :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'} diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/version.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/version.py new file mode 100644 index 000000000000..e0ec669828cb --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/version.py @@ -0,0 +1,13 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +VERSION = "0.1.0" + diff --git a/azure-mgmt-costmanagement/sdk_packaging.toml b/azure-mgmt-costmanagement/sdk_packaging.toml new file mode 100644 index 000000000000..52e7c62ecb14 --- /dev/null +++ b/azure-mgmt-costmanagement/sdk_packaging.toml @@ -0,0 +1,7 @@ +[packaging] +package_name = "azure-mgmt-costmanagement" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "Cost Management" +package_doc_id = "" +is_stable = false +is_arm = true diff --git a/azure-mgmt-costmanagement/setup.cfg b/azure-mgmt-costmanagement/setup.cfg new file mode 100644 index 000000000000..3c6e79cf31da --- /dev/null +++ b/azure-mgmt-costmanagement/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/azure-mgmt-costmanagement/setup.py b/azure-mgmt-costmanagement/setup.py new file mode 100644 index 000000000000..acc358f95393 --- /dev/null +++ b/azure-mgmt-costmanagement/setup.py @@ -0,0 +1,88 @@ +#!/usr/bin/env python + +#------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +#-------------------------------------------------------------------------- + +import re +import os.path +from io import open +from setuptools import find_packages, setup + +# Change the PACKAGE_NAME only to change folder and different name +PACKAGE_NAME = "azure-mgmt-costmanagement" +PACKAGE_PPRINT_NAME = "Cost Management" + +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace('-', '/') +# a-b-c => a.b.c +namespace_name = PACKAGE_NAME.replace('-', '.') + +# azure v0.x is not compatible with this package +# azure v0.x used to have a __version__ attribute (newer versions don't) +try: + import azure + try: + ver = azure.__version__ + raise Exception( + 'This package is incompatible with azure=={}. '.format(ver) + + 'Uninstall it with "pip uninstall azure".' + ) + except AttributeError: + pass +except ImportError: + pass + +# Version extraction inspired from 'requests' +with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd: + version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', + fd.read(), re.MULTILINE).group(1) + +if not version: + raise RuntimeError('Cannot find version information') + +with open('README.rst', encoding='utf-8') as f: + readme = f.read() +with open('HISTORY.rst', encoding='utf-8') as f: + history = f.read() + +setup( + name=PACKAGE_NAME, + version=version, + description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), + long_description=readme + '\n\n' + history, + long_description_content_type='text/x-rst', + license='MIT License', + author='Microsoft Corporation', + author_email='azpysdkhelp@microsoft.com', + url='https://github.com/Azure/azure-sdk-for-python', + classifiers=[ + 'Development Status :: 4 - Beta', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'License :: OSI Approved :: MIT License', + ], + zip_safe=False, + packages=find_packages(exclude=[ + 'tests', + # Exclude packages that will be covered by PEP420 or nspkg + 'azure', + 'azure.mgmt', + ]), + install_requires=[ + 'msrest>=0.5.0', + 'msrestazure>=0.4.32,<2.0.0', + 'azure-common~=1.1', + ], + extras_require={ + ":python_version<'3.0'": ['azure-mgmt-nspkg'], + } +)