diff --git a/azure-mgmt-costmanagement/README.rst b/azure-mgmt-costmanagement/README.rst index 45de4e6b43dd..d0429ebc7565 100644 --- a/azure-mgmt-costmanagement/README.rst +++ b/azure-mgmt-costmanagement/README.rst @@ -14,25 +14,6 @@ For the older Azure Service Management (ASM) libraries, see For a more complete set of Azure libraries, see the `azure `__ bundle package. -Compatibility -============= - -**IMPORTANT**: If you have an earlier version of the azure package -(version < 1.0), you should uninstall it before installing this package. - -You can check the version using pip: - -.. code:: shell - - pip freeze - -If you see azure==0.11.0 (or any version below 1.0), uninstall it first: - -.. code:: shell - - pip uninstall azure - - Usage ===== diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/cost_management_client.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/cost_management_client.py index 7c6ed75c6e33..cc8458f1727e 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/cost_management_client.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/cost_management_client.py @@ -15,11 +15,7 @@ from .version import VERSION from .operations.dimensions_operations import DimensionsOperations from .operations.query_operations import QueryOperations -from .operations.forecast_operations import ForecastOperations -from .operations.cloud_connector_operations import CloudConnectorOperations -from .operations.external_billing_account_operations import ExternalBillingAccountOperations -from .operations.external_subscription_operations import ExternalSubscriptionOperations -from .operations.entities_operations import EntitiesOperations +from .operations.exports_operations import ExportsOperations from .operations.operations import Operations from . import models @@ -66,16 +62,8 @@ class CostManagementClient(SDKClient): :vartype dimensions: azure.mgmt.costmanagement.operations.DimensionsOperations :ivar query: Query operations :vartype query: azure.mgmt.costmanagement.operations.QueryOperations - :ivar forecast: Forecast operations - :vartype forecast: azure.mgmt.costmanagement.operations.ForecastOperations - :ivar cloud_connector: CloudConnector operations - :vartype cloud_connector: azure.mgmt.costmanagement.operations.CloudConnectorOperations - :ivar external_billing_account: ExternalBillingAccount operations - :vartype external_billing_account: azure.mgmt.costmanagement.operations.ExternalBillingAccountOperations - :ivar external_subscription: ExternalSubscription operations - :vartype external_subscription: azure.mgmt.costmanagement.operations.ExternalSubscriptionOperations - :ivar entities: Entities operations - :vartype entities: azure.mgmt.costmanagement.operations.EntitiesOperations + :ivar exports: Exports operations + :vartype exports: azure.mgmt.costmanagement.operations.ExportsOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.costmanagement.operations.Operations @@ -94,7 +82,7 @@ def __init__( super(CostManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2019-03-01-preview' + self.api_version = '2019-01-01' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) @@ -102,15 +90,7 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.query = QueryOperations( self._client, self.config, self._serialize, self._deserialize) - self.forecast = ForecastOperations( - self._client, self.config, self._serialize, self._deserialize) - self.cloud_connector = CloudConnectorOperations( - self._client, self.config, self._serialize, self._deserialize) - self.external_billing_account = ExternalBillingAccountOperations( - self._client, self.config, self._serialize, self._deserialize) - self.external_subscription = ExternalSubscriptionOperations( - self._client, self.config, self._serialize, self._deserialize) - self.entities = EntitiesOperations( + self.exports = ExportsOperations( self._client, self.config, self._serialize, self._deserialize) self.operations = Operations( self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py index 7e3edca4af5e..1fc845d344b9 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py @@ -10,110 +10,111 @@ # -------------------------------------------------------------------------- try: - from .error_base_py3 import ErrorBase from .error_details_py3 import ErrorDetails from .error_response_py3 import ErrorResponse, ErrorResponseException from .resource_py3 import Resource - from .report_config_time_period_py3 import ReportConfigTimePeriod - from .report_config_dataset_configuration_py3 import ReportConfigDatasetConfiguration - from .report_config_aggregation_py3 import ReportConfigAggregation - from .report_config_grouping_py3 import ReportConfigGrouping - from .report_config_sorting_py3 import ReportConfigSorting - from .report_config_comparison_expression_py3 import ReportConfigComparisonExpression - from .report_config_filter_py3 import ReportConfigFilter - from .report_config_dataset_py3 import ReportConfigDataset - from .report_config_definition_py3 import ReportConfigDefinition from .dimension_py3 import Dimension from .query_column_py3 import QueryColumn from .query_py3 import Query - from .connector_collection_error_info_py3 import ConnectorCollectionErrorInfo - from .connector_collection_info_py3 import ConnectorCollectionInfo - from .connector_definition_py3 import ConnectorDefinition - from .external_billing_account_definition_py3 import ExternalBillingAccountDefinition - from .external_subscription_definition_py3 import ExternalSubscriptionDefinition - from .entity_parent_group_info_py3 import EntityParentGroupInfo - from .entity_info_py3 import EntityInfo from .operation_display_py3 import OperationDisplay from .operation_py3 import Operation + from .query_time_period_py3 import QueryTimePeriod + from .query_dataset_configuration_py3 import QueryDatasetConfiguration + from .query_aggregation_py3 import QueryAggregation + from .query_grouping_py3 import QueryGrouping + from .query_sorting_configuration_py3 import QuerySortingConfiguration + from .query_comparison_expression_py3 import QueryComparisonExpression + from .query_filter_py3 import QueryFilter + from .query_dataset_py3 import QueryDataset + from .query_definition_py3 import QueryDefinition + from .export_recurrence_period_py3 import ExportRecurrencePeriod + from .export_schedule_py3 import ExportSchedule + from .export_py3 import Export + from .export_list_result_py3 import ExportListResult + from .export_delivery_destination_py3 import ExportDeliveryDestination + from .export_delivery_info_py3 import ExportDeliveryInfo + from .common_export_properties_py3 import CommonExportProperties + from .export_execution_py3 import ExportExecution + from .export_execution_list_result_py3 import ExportExecutionListResult except (SyntaxError, ImportError): - from .error_base import ErrorBase from .error_details import ErrorDetails from .error_response import ErrorResponse, ErrorResponseException from .resource import Resource - from .report_config_time_period import ReportConfigTimePeriod - from .report_config_dataset_configuration import ReportConfigDatasetConfiguration - from .report_config_aggregation import ReportConfigAggregation - from .report_config_grouping import ReportConfigGrouping - from .report_config_sorting import ReportConfigSorting - from .report_config_comparison_expression import ReportConfigComparisonExpression - from .report_config_filter import ReportConfigFilter - from .report_config_dataset import ReportConfigDataset - from .report_config_definition import ReportConfigDefinition from .dimension import Dimension from .query_column import QueryColumn from .query import Query - from .connector_collection_error_info import ConnectorCollectionErrorInfo - from .connector_collection_info import ConnectorCollectionInfo - from .connector_definition import ConnectorDefinition - from .external_billing_account_definition import ExternalBillingAccountDefinition - from .external_subscription_definition import ExternalSubscriptionDefinition - from .entity_parent_group_info import EntityParentGroupInfo - from .entity_info import EntityInfo from .operation_display import OperationDisplay from .operation import Operation + from .query_time_period import QueryTimePeriod + from .query_dataset_configuration import QueryDatasetConfiguration + from .query_aggregation import QueryAggregation + from .query_grouping import QueryGrouping + from .query_sorting_configuration import QuerySortingConfiguration + from .query_comparison_expression import QueryComparisonExpression + from .query_filter import QueryFilter + from .query_dataset import QueryDataset + from .query_definition import QueryDefinition + from .export_recurrence_period import ExportRecurrencePeriod + from .export_schedule import ExportSchedule + from .export import Export + from .export_list_result import ExportListResult + from .export_delivery_destination import ExportDeliveryDestination + from .export_delivery_info import ExportDeliveryInfo + from .common_export_properties import CommonExportProperties + from .export_execution import ExportExecution + from .export_execution_list_result import ExportExecutionListResult from .dimension_paged import DimensionPaged from .query_paged import QueryPaged -from .connector_definition_paged import ConnectorDefinitionPaged -from .external_billing_account_definition_paged import ExternalBillingAccountDefinitionPaged -from .external_subscription_definition_paged import ExternalSubscriptionDefinitionPaged -from .entity_info_paged import EntityInfoPaged from .operation_paged import OperationPaged from .cost_management_client_enums import ( TimeframeType, GranularityType, - ReportConfigColumnType, - OperatorType, - ConnectorStatus, - ConnectorBillingModel, + QueryColumnType, + SortDirection, + StatusType, + RecurrenceType, + FormatType, + ExecutionType, + ExecutionStatus, ) __all__ = [ - 'ErrorBase', 'ErrorDetails', 'ErrorResponse', 'ErrorResponseException', 'Resource', - 'ReportConfigTimePeriod', - 'ReportConfigDatasetConfiguration', - 'ReportConfigAggregation', - 'ReportConfigGrouping', - 'ReportConfigSorting', - 'ReportConfigComparisonExpression', - 'ReportConfigFilter', - 'ReportConfigDataset', - 'ReportConfigDefinition', 'Dimension', 'QueryColumn', 'Query', - 'ConnectorCollectionErrorInfo', - 'ConnectorCollectionInfo', - 'ConnectorDefinition', - 'ExternalBillingAccountDefinition', - 'ExternalSubscriptionDefinition', - 'EntityParentGroupInfo', - 'EntityInfo', 'OperationDisplay', 'Operation', + 'QueryTimePeriod', + 'QueryDatasetConfiguration', + 'QueryAggregation', + 'QueryGrouping', + 'QuerySortingConfiguration', + 'QueryComparisonExpression', + 'QueryFilter', + 'QueryDataset', + 'QueryDefinition', + 'ExportRecurrencePeriod', + 'ExportSchedule', + 'Export', + 'ExportListResult', + 'ExportDeliveryDestination', + 'ExportDeliveryInfo', + 'CommonExportProperties', + 'ExportExecution', + 'ExportExecutionListResult', 'DimensionPaged', 'QueryPaged', - 'ConnectorDefinitionPaged', - 'ExternalBillingAccountDefinitionPaged', - 'ExternalSubscriptionDefinitionPaged', - 'EntityInfoPaged', 'OperationPaged', 'TimeframeType', 'GranularityType', - 'ReportConfigColumnType', - 'OperatorType', - 'ConnectorStatus', - 'ConnectorBillingModel', + 'QueryColumnType', + 'SortDirection', + 'StatusType', + 'RecurrenceType', + 'FormatType', + 'ExecutionType', + 'ExecutionStatus', ] diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/common_export_properties.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/common_export_properties.py new file mode 100644 index 000000000000..9024a61aeff2 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/common_export_properties.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CommonExportProperties(Model): + """The common properties of the export. + + All required parameters must be populated in order to send to Azure. + + :param format: The format of the export being delivered. Possible values + include: 'Csv' + :type format: str or ~azure.mgmt.costmanagement.models.FormatType + :param delivery_info: Required. Has delivery information for the export. + :type delivery_info: ~azure.mgmt.costmanagement.models.ExportDeliveryInfo + :param definition: Required. Has definition for the export. + :type definition: ~azure.mgmt.costmanagement.models.QueryDefinition + """ + + _validation = { + 'delivery_info': {'required': True}, + 'definition': {'required': True}, + } + + _attribute_map = { + 'format': {'key': 'format', 'type': 'str'}, + 'delivery_info': {'key': 'deliveryInfo', 'type': 'ExportDeliveryInfo'}, + 'definition': {'key': 'definition', 'type': 'QueryDefinition'}, + } + + def __init__(self, **kwargs): + super(CommonExportProperties, self).__init__(**kwargs) + self.format = kwargs.get('format', None) + self.delivery_info = kwargs.get('delivery_info', None) + self.definition = kwargs.get('definition', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/common_export_properties_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/common_export_properties_py3.py new file mode 100644 index 000000000000..6841ba2a2dce --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/common_export_properties_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CommonExportProperties(Model): + """The common properties of the export. + + All required parameters must be populated in order to send to Azure. + + :param format: The format of the export being delivered. Possible values + include: 'Csv' + :type format: str or ~azure.mgmt.costmanagement.models.FormatType + :param delivery_info: Required. Has delivery information for the export. + :type delivery_info: ~azure.mgmt.costmanagement.models.ExportDeliveryInfo + :param definition: Required. Has definition for the export. + :type definition: ~azure.mgmt.costmanagement.models.QueryDefinition + """ + + _validation = { + 'delivery_info': {'required': True}, + 'definition': {'required': True}, + } + + _attribute_map = { + 'format': {'key': 'format', 'type': 'str'}, + 'delivery_info': {'key': 'deliveryInfo', 'type': 'ExportDeliveryInfo'}, + 'definition': {'key': 'definition', 'type': 'QueryDefinition'}, + } + + def __init__(self, *, delivery_info, definition, format=None, **kwargs) -> None: + super(CommonExportProperties, self).__init__(**kwargs) + self.format = format + self.delivery_info = delivery_info + self.definition = definition diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_error_info.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_error_info.py deleted file mode 100644 index 74d4eb5288f1..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_error_info.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ConnectorCollectionErrorInfo(Model): - """Details of any error encountered on last collection attempt. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar error_message: Detailed error message - :vartype error_message: str - :ivar error_inner_message: External Provider error message - :vartype error_inner_message: str - :ivar error_code: Short error code - :vartype error_code: str - :ivar error_start_time: Time the error started occurring (Last time error - occurred in lastChecked) - :vartype error_start_time: datetime - """ - - _validation = { - 'error_message': {'readonly': True}, - 'error_inner_message': {'readonly': True}, - 'error_code': {'readonly': True}, - 'error_start_time': {'readonly': True}, - } - - _attribute_map = { - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'error_inner_message': {'key': 'errorInnerMessage', 'type': 'str'}, - 'error_code': {'key': 'errorCode', 'type': 'str'}, - 'error_start_time': {'key': 'errorStartTime', 'type': 'iso-8601'}, - } - - def __init__(self, **kwargs): - super(ConnectorCollectionErrorInfo, self).__init__(**kwargs) - self.error_message = None - self.error_inner_message = None - self.error_code = None - self.error_start_time = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_error_info_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_error_info_py3.py deleted file mode 100644 index 8d26ae24a8ca..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_error_info_py3.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ConnectorCollectionErrorInfo(Model): - """Details of any error encountered on last collection attempt. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar error_message: Detailed error message - :vartype error_message: str - :ivar error_inner_message: External Provider error message - :vartype error_inner_message: str - :ivar error_code: Short error code - :vartype error_code: str - :ivar error_start_time: Time the error started occurring (Last time error - occurred in lastChecked) - :vartype error_start_time: datetime - """ - - _validation = { - 'error_message': {'readonly': True}, - 'error_inner_message': {'readonly': True}, - 'error_code': {'readonly': True}, - 'error_start_time': {'readonly': True}, - } - - _attribute_map = { - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'error_inner_message': {'key': 'errorInnerMessage', 'type': 'str'}, - 'error_code': {'key': 'errorCode', 'type': 'str'}, - 'error_start_time': {'key': 'errorStartTime', 'type': 'iso-8601'}, - } - - def __init__(self, **kwargs) -> None: - super(ConnectorCollectionErrorInfo, self).__init__(**kwargs) - self.error_message = None - self.error_inner_message = None - self.error_code = None - self.error_start_time = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_info.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_info.py deleted file mode 100644 index ad4397017060..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_info.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ConnectorCollectionInfo(Model): - """Collection and ingestion information. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar last_checked: Last time the data acquisition process initiated - connecting to the external provider - :vartype last_checked: datetime - :ivar source_last_updated: Source timestamp of external data currently - available in Azure (eg AWS last processed CUR file timestamp) - :vartype source_last_updated: datetime - :ivar last_updated: Last time the external data was updated into Azure - :vartype last_updated: datetime - :param error: Error information of last collection - :type error: - ~azure.mgmt.costmanagement.models.ConnectorCollectionErrorInfo - """ - - _validation = { - 'last_checked': {'readonly': True}, - 'source_last_updated': {'readonly': True}, - 'last_updated': {'readonly': True}, - } - - _attribute_map = { - 'last_checked': {'key': 'lastChecked', 'type': 'iso-8601'}, - 'source_last_updated': {'key': 'sourceLastUpdated', 'type': 'iso-8601'}, - 'last_updated': {'key': 'lastUpdated', 'type': 'iso-8601'}, - 'error': {'key': 'error', 'type': 'ConnectorCollectionErrorInfo'}, - } - - def __init__(self, **kwargs): - super(ConnectorCollectionInfo, self).__init__(**kwargs) - self.last_checked = None - self.source_last_updated = None - self.last_updated = None - self.error = kwargs.get('error', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_info_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_info_py3.py deleted file mode 100644 index ce4cfe464f52..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_info_py3.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ConnectorCollectionInfo(Model): - """Collection and ingestion information. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar last_checked: Last time the data acquisition process initiated - connecting to the external provider - :vartype last_checked: datetime - :ivar source_last_updated: Source timestamp of external data currently - available in Azure (eg AWS last processed CUR file timestamp) - :vartype source_last_updated: datetime - :ivar last_updated: Last time the external data was updated into Azure - :vartype last_updated: datetime - :param error: Error information of last collection - :type error: - ~azure.mgmt.costmanagement.models.ConnectorCollectionErrorInfo - """ - - _validation = { - 'last_checked': {'readonly': True}, - 'source_last_updated': {'readonly': True}, - 'last_updated': {'readonly': True}, - } - - _attribute_map = { - 'last_checked': {'key': 'lastChecked', 'type': 'iso-8601'}, - 'source_last_updated': {'key': 'sourceLastUpdated', 'type': 'iso-8601'}, - 'last_updated': {'key': 'lastUpdated', 'type': 'iso-8601'}, - 'error': {'key': 'error', 'type': 'ConnectorCollectionErrorInfo'}, - } - - def __init__(self, *, error=None, **kwargs) -> None: - super(ConnectorCollectionInfo, self).__init__(**kwargs) - self.last_checked = None - self.source_last_updated = None - self.last_updated = None - self.error = error diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_definition.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_definition.py deleted file mode 100644 index 1c52fbbed1a0..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_definition.py +++ /dev/null @@ -1,112 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ConnectorDefinition(Model): - """The Connector model definition. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param kind: Connector kind (eg aws) - :type kind: str - :ivar id: Connector id - :vartype id: str - :ivar name: Connector name - :vartype name: str - :ivar type: Connector type - :vartype type: str - :param display_name: Connector DisplayName - :type display_name: str - :ivar provider_account_id: Connector providerAccountId (determined from - credentials) - :vartype provider_account_id: str - :param credentials_key: Credentials authentication key (eg AWS ARN) - :type credentials_key: str - :param credentials_secret: Credentials secret (eg AWS ExternalId) - :type credentials_secret: str - :param report_id: Identifying source report. (For AWS this is a CUR report - name, defined with Daily and with Resources) - :type report_id: str - :ivar created_on: Connector definition creation datetime - :vartype created_on: datetime - :ivar modified_on: Connector last modified datetime - :vartype modified_on: datetime - :param status: Connector status. Possible values include: 'active', - 'error', 'suspended' - :type status: str or ~azure.mgmt.costmanagement.models.ConnectorStatus - :param default_management_group_id: Default ManagementGroupId - :type default_management_group_id: str - :param subscription_id: Billing SubscriptionId - :type subscription_id: str - :param billing_model: Connector billing model. Possible values include: - 'trial', 'autoUpgrade', 'premium', 'expired' - :type billing_model: str or - ~azure.mgmt.costmanagement.models.ConnectorBillingModel - :ivar days_trial_remaining: Number of days remaining of trial - :vartype days_trial_remaining: int - :ivar collection_info: Collection information - :vartype collection_info: - ~azure.mgmt.costmanagement.models.ConnectorCollectionInfo - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'provider_account_id': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'days_trial_remaining': {'readonly': True}, - 'collection_info': {'readonly': True}, - } - - _attribute_map = { - 'kind': {'key': 'kind', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'provider_account_id': {'key': 'properties.providerAccountId', 'type': 'str'}, - 'credentials_key': {'key': 'properties.credentialsKey', 'type': 'str'}, - 'credentials_secret': {'key': 'properties.credentialsSecret', 'type': 'str'}, - 'report_id': {'key': 'properties.reportId', 'type': 'str'}, - 'created_on': {'key': 'properties.createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'properties.modifiedOn', 'type': 'iso-8601'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'default_management_group_id': {'key': 'properties.defaultManagementGroupId', 'type': 'str'}, - 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, - 'billing_model': {'key': 'properties.billingModel', 'type': 'str'}, - 'days_trial_remaining': {'key': 'properties.daysTrialRemaining', 'type': 'int'}, - 'collection_info': {'key': 'properties.collectionInfo', 'type': 'ConnectorCollectionInfo'}, - } - - def __init__(self, **kwargs): - super(ConnectorDefinition, self).__init__(**kwargs) - self.kind = kwargs.get('kind', None) - self.id = None - self.name = None - self.type = None - self.display_name = kwargs.get('display_name', None) - self.provider_account_id = None - self.credentials_key = kwargs.get('credentials_key', None) - self.credentials_secret = kwargs.get('credentials_secret', None) - self.report_id = kwargs.get('report_id', None) - self.created_on = None - self.modified_on = None - self.status = kwargs.get('status', None) - self.default_management_group_id = kwargs.get('default_management_group_id', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.billing_model = kwargs.get('billing_model', None) - self.days_trial_remaining = None - self.collection_info = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_definition_paged.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_definition_paged.py deleted file mode 100644 index 23e223c92208..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_definition_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class ConnectorDefinitionPaged(Paged): - """ - A paging container for iterating over a list of :class:`ConnectorDefinition ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ConnectorDefinition]'} - } - - def __init__(self, *args, **kwargs): - - super(ConnectorDefinitionPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_definition_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_definition_py3.py deleted file mode 100644 index 39c96d302e55..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_definition_py3.py +++ /dev/null @@ -1,112 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ConnectorDefinition(Model): - """The Connector model definition. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param kind: Connector kind (eg aws) - :type kind: str - :ivar id: Connector id - :vartype id: str - :ivar name: Connector name - :vartype name: str - :ivar type: Connector type - :vartype type: str - :param display_name: Connector DisplayName - :type display_name: str - :ivar provider_account_id: Connector providerAccountId (determined from - credentials) - :vartype provider_account_id: str - :param credentials_key: Credentials authentication key (eg AWS ARN) - :type credentials_key: str - :param credentials_secret: Credentials secret (eg AWS ExternalId) - :type credentials_secret: str - :param report_id: Identifying source report. (For AWS this is a CUR report - name, defined with Daily and with Resources) - :type report_id: str - :ivar created_on: Connector definition creation datetime - :vartype created_on: datetime - :ivar modified_on: Connector last modified datetime - :vartype modified_on: datetime - :param status: Connector status. Possible values include: 'active', - 'error', 'suspended' - :type status: str or ~azure.mgmt.costmanagement.models.ConnectorStatus - :param default_management_group_id: Default ManagementGroupId - :type default_management_group_id: str - :param subscription_id: Billing SubscriptionId - :type subscription_id: str - :param billing_model: Connector billing model. Possible values include: - 'trial', 'autoUpgrade', 'premium', 'expired' - :type billing_model: str or - ~azure.mgmt.costmanagement.models.ConnectorBillingModel - :ivar days_trial_remaining: Number of days remaining of trial - :vartype days_trial_remaining: int - :ivar collection_info: Collection information - :vartype collection_info: - ~azure.mgmt.costmanagement.models.ConnectorCollectionInfo - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'provider_account_id': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'days_trial_remaining': {'readonly': True}, - 'collection_info': {'readonly': True}, - } - - _attribute_map = { - 'kind': {'key': 'kind', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'provider_account_id': {'key': 'properties.providerAccountId', 'type': 'str'}, - 'credentials_key': {'key': 'properties.credentialsKey', 'type': 'str'}, - 'credentials_secret': {'key': 'properties.credentialsSecret', 'type': 'str'}, - 'report_id': {'key': 'properties.reportId', 'type': 'str'}, - 'created_on': {'key': 'properties.createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'properties.modifiedOn', 'type': 'iso-8601'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'default_management_group_id': {'key': 'properties.defaultManagementGroupId', 'type': 'str'}, - 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, - 'billing_model': {'key': 'properties.billingModel', 'type': 'str'}, - 'days_trial_remaining': {'key': 'properties.daysTrialRemaining', 'type': 'int'}, - 'collection_info': {'key': 'properties.collectionInfo', 'type': 'ConnectorCollectionInfo'}, - } - - def __init__(self, *, kind: str=None, display_name: str=None, credentials_key: str=None, credentials_secret: str=None, report_id: str=None, status=None, default_management_group_id: str=None, subscription_id: str=None, billing_model=None, **kwargs) -> None: - super(ConnectorDefinition, self).__init__(**kwargs) - self.kind = kind - self.id = None - self.name = None - self.type = None - self.display_name = display_name - self.provider_account_id = None - self.credentials_key = credentials_key - self.credentials_secret = credentials_secret - self.report_id = report_id - self.created_on = None - self.modified_on = None - self.status = status - self.default_management_group_id = default_management_group_id - self.subscription_id = subscription_id - self.billing_model = billing_model - self.days_trial_remaining = None - self.collection_info = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/cost_management_client_enums.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/cost_management_client_enums.py index 24088511f298..26507b572db1 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/cost_management_client_enums.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/cost_management_client_enums.py @@ -17,37 +17,61 @@ class TimeframeType(str, Enum): week_to_date = "WeekToDate" month_to_date = "MonthToDate" year_to_date = "YearToDate" + the_last_week = "TheLastWeek" + the_last_month = "TheLastMonth" + the_last_year = "TheLastYear" custom = "Custom" class GranularityType(str, Enum): daily = "Daily" - monthly = "Monthly" + hourly = "Hourly" -class ReportConfigColumnType(str, Enum): +class QueryColumnType(str, Enum): tag = "Tag" dimension = "Dimension" -class OperatorType(str, Enum): +class SortDirection(str, Enum): + + ascending = "Ascending" + descending = "Descending" + + +class StatusType(str, Enum): + + active = "Active" + inactive = "Inactive" + + +class RecurrenceType(str, Enum): + + daily = "Daily" + weekly = "Weekly" + monthly = "Monthly" + annually = "Annually" + + +class FormatType(str, Enum): - in_enum = "In" - contains = "Contains" + csv = "Csv" -class ConnectorStatus(str, Enum): +class ExecutionType(str, Enum): - active = "active" - error = "error" - suspended = "suspended" + on_demand = "OnDemand" + scheduled = "Scheduled" -class ConnectorBillingModel(str, Enum): +class ExecutionStatus(str, Enum): - trial = "trial" - auto_upgrade = "autoUpgrade" - premium = "premium" - expired = "expired" + queued = "Queued" + in_progress = "InProgress" + completed = "Completed" + failed = "Failed" + timeout = "Timeout" + new_data_not_available = "NewDataNotAvailable" + data_not_available = "DataNotAvailable" diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_info.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_info.py deleted file mode 100644 index 996a86f4e81d..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_info.py +++ /dev/null @@ -1,102 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class EntityInfo(Model): - """The entity. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: The fully qualified ID for the entity. For example, - /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 - :vartype id: str - :ivar type: The type of the resource. For example, - /providers/Microsoft.Management/managementGroups - :vartype type: str - :ivar name: The name of the entity. For example, - 00000000-0000-0000-0000-000000000000 - :vartype name: str - :ivar kind: The kind of the resource - :vartype kind: str - :param tenant_id: The AAD Tenant ID associated with the entity. For - example, 00000000-0000-0000-0000-000000000000 - :type tenant_id: str - :param display_name: The friendly name of the management group. - :type display_name: str - :param parent: Parent. - :type parent: ~azure.mgmt.costmanagement.models.EntityParentGroupInfo - :param permissions: Permissions. Possible values include: 'noaccess', - 'view', 'edit', 'delete' - :type permissions: str or ~azure.mgmt.costmanagement.models.enum - :param inherited_permissions: Inherited Permissions. Possible values - include: 'noaccess', 'view', 'edit', 'delete' - :type inherited_permissions: str or ~azure.mgmt.costmanagement.models.enum - :param number_of_descendants: Number of Descendants. - :type number_of_descendants: int - :param number_of_children: Number of Children. Number of children is the - number of Groups and Subscriptions that are exactly one level underneath - the current Group. - :type number_of_children: int - :param number_of_child_groups: Number of Child Groups. Number of child - groups is the number of Groups that are exactly one level underneath the - current Group. - :type number_of_child_groups: int - :param parent_display_name_chain: The parent display name chain from the - root group to the immediate parent - :type parent_display_name_chain: list[str] - :param parent_name_chain: The parent name chain from the root group to the - immediate parent - :type parent_name_chain: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'type': {'readonly': True}, - 'name': {'readonly': True}, - 'kind': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'parent': {'key': 'properties.parent', 'type': 'EntityParentGroupInfo'}, - 'permissions': {'key': 'properties.permissions', 'type': 'str'}, - 'inherited_permissions': {'key': 'properties.inheritedPermissions', 'type': 'str'}, - 'number_of_descendants': {'key': 'properties.numberOfDescendants', 'type': 'int'}, - 'number_of_children': {'key': 'properties.numberOfChildren', 'type': 'int'}, - 'number_of_child_groups': {'key': 'properties.numberOfChildGroups', 'type': 'int'}, - 'parent_display_name_chain': {'key': 'properties.parentDisplayNameChain', 'type': '[str]'}, - 'parent_name_chain': {'key': 'properties.parentNameChain', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(EntityInfo, self).__init__(**kwargs) - self.id = None - self.type = None - self.name = None - self.kind = None - self.tenant_id = kwargs.get('tenant_id', None) - self.display_name = kwargs.get('display_name', None) - self.parent = kwargs.get('parent', None) - self.permissions = kwargs.get('permissions', None) - self.inherited_permissions = kwargs.get('inherited_permissions', None) - self.number_of_descendants = kwargs.get('number_of_descendants', None) - self.number_of_children = kwargs.get('number_of_children', None) - self.number_of_child_groups = kwargs.get('number_of_child_groups', None) - self.parent_display_name_chain = kwargs.get('parent_display_name_chain', None) - self.parent_name_chain = kwargs.get('parent_name_chain', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_info_paged.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_info_paged.py deleted file mode 100644 index d7a741cef532..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_info_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class EntityInfoPaged(Paged): - """ - A paging container for iterating over a list of :class:`EntityInfo ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[EntityInfo]'} - } - - def __init__(self, *args, **kwargs): - - super(EntityInfoPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_info_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_info_py3.py deleted file mode 100644 index 7f44120d0fd9..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_info_py3.py +++ /dev/null @@ -1,102 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class EntityInfo(Model): - """The entity. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: The fully qualified ID for the entity. For example, - /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 - :vartype id: str - :ivar type: The type of the resource. For example, - /providers/Microsoft.Management/managementGroups - :vartype type: str - :ivar name: The name of the entity. For example, - 00000000-0000-0000-0000-000000000000 - :vartype name: str - :ivar kind: The kind of the resource - :vartype kind: str - :param tenant_id: The AAD Tenant ID associated with the entity. For - example, 00000000-0000-0000-0000-000000000000 - :type tenant_id: str - :param display_name: The friendly name of the management group. - :type display_name: str - :param parent: Parent. - :type parent: ~azure.mgmt.costmanagement.models.EntityParentGroupInfo - :param permissions: Permissions. Possible values include: 'noaccess', - 'view', 'edit', 'delete' - :type permissions: str or ~azure.mgmt.costmanagement.models.enum - :param inherited_permissions: Inherited Permissions. Possible values - include: 'noaccess', 'view', 'edit', 'delete' - :type inherited_permissions: str or ~azure.mgmt.costmanagement.models.enum - :param number_of_descendants: Number of Descendants. - :type number_of_descendants: int - :param number_of_children: Number of Children. Number of children is the - number of Groups and Subscriptions that are exactly one level underneath - the current Group. - :type number_of_children: int - :param number_of_child_groups: Number of Child Groups. Number of child - groups is the number of Groups that are exactly one level underneath the - current Group. - :type number_of_child_groups: int - :param parent_display_name_chain: The parent display name chain from the - root group to the immediate parent - :type parent_display_name_chain: list[str] - :param parent_name_chain: The parent name chain from the root group to the - immediate parent - :type parent_name_chain: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'type': {'readonly': True}, - 'name': {'readonly': True}, - 'kind': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'parent': {'key': 'properties.parent', 'type': 'EntityParentGroupInfo'}, - 'permissions': {'key': 'properties.permissions', 'type': 'str'}, - 'inherited_permissions': {'key': 'properties.inheritedPermissions', 'type': 'str'}, - 'number_of_descendants': {'key': 'properties.numberOfDescendants', 'type': 'int'}, - 'number_of_children': {'key': 'properties.numberOfChildren', 'type': 'int'}, - 'number_of_child_groups': {'key': 'properties.numberOfChildGroups', 'type': 'int'}, - 'parent_display_name_chain': {'key': 'properties.parentDisplayNameChain', 'type': '[str]'}, - 'parent_name_chain': {'key': 'properties.parentNameChain', 'type': '[str]'}, - } - - def __init__(self, *, tenant_id: str=None, display_name: str=None, parent=None, permissions=None, inherited_permissions=None, number_of_descendants: int=None, number_of_children: int=None, number_of_child_groups: int=None, parent_display_name_chain=None, parent_name_chain=None, **kwargs) -> None: - super(EntityInfo, self).__init__(**kwargs) - self.id = None - self.type = None - self.name = None - self.kind = None - self.tenant_id = tenant_id - self.display_name = display_name - self.parent = parent - self.permissions = permissions - self.inherited_permissions = inherited_permissions - self.number_of_descendants = number_of_descendants - self.number_of_children = number_of_children - self.number_of_child_groups = number_of_child_groups - self.parent_display_name_chain = parent_display_name_chain - self.parent_name_chain = parent_name_chain diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_parent_group_info_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_parent_group_info_py3.py deleted file mode 100644 index b0275df6a41f..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_parent_group_info_py3.py +++ /dev/null @@ -1,30 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class EntityParentGroupInfo(Model): - """(Optional) The ID of the parent management group. - - :param id: The fully qualified ID for the parent management group. For - example, - /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__(self, *, id: str=None, **kwargs) -> None: - super(EntityParentGroupInfo, self).__init__(**kwargs) - self.id = id diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_base.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_base.py deleted file mode 100644 index 06850f19f08c..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_base.py +++ /dev/null @@ -1,46 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ErrorBase(Model): - """The details of the error. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar code: A machine readable error code. - :vartype code: str - :ivar message: A human readable error message. - :vartype message: str - :ivar target: Indicates which property in the request is responsible for - the error. - :vartype target: str - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ErrorBase, self).__init__(**kwargs) - self.code = None - self.message = None - self.target = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details.py index 0c5831e7ee91..03f3e23d2153 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details.py @@ -18,15 +18,10 @@ class ErrorDetails(Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar code: A machine readable error code. + :ivar code: Error code. :vartype code: str - :ivar message: A human readable error message. + :ivar message: Error message indicating why the operation failed. :vartype message: str - :param target: Indicates which property in the request is responsible for - the error. - :type target: str - :param details: error details. - :type details: list[~azure.mgmt.costmanagement.models.ErrorBase] """ _validation = { @@ -37,13 +32,9 @@ class ErrorDetails(Model): _attribute_map = { 'code': {'key': 'code', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorBase]'}, } def __init__(self, **kwargs): super(ErrorDetails, self).__init__(**kwargs) self.code = None self.message = None - self.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details_py3.py index 3d4a63c6ab50..f9e1adeac9fe 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details_py3.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details_py3.py @@ -18,15 +18,10 @@ class ErrorDetails(Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar code: A machine readable error code. + :ivar code: Error code. :vartype code: str - :ivar message: A human readable error message. + :ivar message: Error message indicating why the operation failed. :vartype message: str - :param target: Indicates which property in the request is responsible for - the error. - :type target: str - :param details: error details. - :type details: list[~azure.mgmt.costmanagement.models.ErrorBase] """ _validation = { @@ -37,13 +32,9 @@ class ErrorDetails(Model): _attribute_map = { 'code': {'key': 'code', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorBase]'}, } - def __init__(self, *, target: str=None, details=None, **kwargs) -> None: + def __init__(self, **kwargs) -> None: super(ErrorDetails, self).__init__(**kwargs) self.code = None self.message = None - self.target = target - self.details = details diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export.py new file mode 100644 index 000000000000..9ec61149f406 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class Export(Resource): + """A export resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :param format: The format of the export being delivered. Possible values + include: 'Csv' + :type format: str or ~azure.mgmt.costmanagement.models.FormatType + :param delivery_info: Required. Has delivery information for the export. + :type delivery_info: ~azure.mgmt.costmanagement.models.ExportDeliveryInfo + :param definition: Required. Has definition for the export. + :type definition: ~azure.mgmt.costmanagement.models.QueryDefinition + :param schedule: Has schedule information for the export. + :type schedule: ~azure.mgmt.costmanagement.models.ExportSchedule + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'delivery_info': {'required': True}, + 'definition': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'format': {'key': 'properties.format', 'type': 'str'}, + 'delivery_info': {'key': 'properties.deliveryInfo', 'type': 'ExportDeliveryInfo'}, + 'definition': {'key': 'properties.definition', 'type': 'QueryDefinition'}, + 'schedule': {'key': 'properties.schedule', 'type': 'ExportSchedule'}, + } + + def __init__(self, **kwargs): + super(Export, self).__init__(**kwargs) + self.format = kwargs.get('format', None) + self.delivery_info = kwargs.get('delivery_info', None) + self.definition = kwargs.get('definition', None) + self.schedule = kwargs.get('schedule', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_destination.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_destination.py new file mode 100644 index 000000000000..949d25357d8e --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_destination.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExportDeliveryDestination(Model): + """The destination information for the delivery of the export. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. The resource id of the storage account where + exports will be delivered. + :type resource_id: str + :param container: Required. The name of the container where exports will + be uploaded. + :type container: str + :param root_folder_path: The name of the directory where exports will be + uploaded. + :type root_folder_path: str + """ + + _validation = { + 'resource_id': {'required': True}, + 'container': {'required': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'container': {'key': 'container', 'type': 'str'}, + 'root_folder_path': {'key': 'rootFolderPath', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ExportDeliveryDestination, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.container = kwargs.get('container', None) + self.root_folder_path = kwargs.get('root_folder_path', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_destination_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_destination_py3.py new file mode 100644 index 000000000000..3f2f70bffd4a --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_destination_py3.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExportDeliveryDestination(Model): + """The destination information for the delivery of the export. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. The resource id of the storage account where + exports will be delivered. + :type resource_id: str + :param container: Required. The name of the container where exports will + be uploaded. + :type container: str + :param root_folder_path: The name of the directory where exports will be + uploaded. + :type root_folder_path: str + """ + + _validation = { + 'resource_id': {'required': True}, + 'container': {'required': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'container': {'key': 'container', 'type': 'str'}, + 'root_folder_path': {'key': 'rootFolderPath', 'type': 'str'}, + } + + def __init__(self, *, resource_id: str, container: str, root_folder_path: str=None, **kwargs) -> None: + super(ExportDeliveryDestination, self).__init__(**kwargs) + self.resource_id = resource_id + self.container = container + self.root_folder_path = root_folder_path diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_info.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_info.py new file mode 100644 index 000000000000..996aa73156d6 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_info.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExportDeliveryInfo(Model): + """The delivery information associated with a export. + + All required parameters must be populated in order to send to Azure. + + :param destination: Required. Has destination for the export being + delivered. + :type destination: + ~azure.mgmt.costmanagement.models.ExportDeliveryDestination + """ + + _validation = { + 'destination': {'required': True}, + } + + _attribute_map = { + 'destination': {'key': 'destination', 'type': 'ExportDeliveryDestination'}, + } + + def __init__(self, **kwargs): + super(ExportDeliveryInfo, self).__init__(**kwargs) + self.destination = kwargs.get('destination', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_info_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_info_py3.py new file mode 100644 index 000000000000..43fce117f331 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_delivery_info_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExportDeliveryInfo(Model): + """The delivery information associated with a export. + + All required parameters must be populated in order to send to Azure. + + :param destination: Required. Has destination for the export being + delivered. + :type destination: + ~azure.mgmt.costmanagement.models.ExportDeliveryDestination + """ + + _validation = { + 'destination': {'required': True}, + } + + _attribute_map = { + 'destination': {'key': 'destination', 'type': 'ExportDeliveryDestination'}, + } + + def __init__(self, *, destination, **kwargs) -> None: + super(ExportDeliveryInfo, self).__init__(**kwargs) + self.destination = destination diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution.py new file mode 100644 index 000000000000..7843f0594630 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution.py @@ -0,0 +1,86 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ExportExecution(Resource): + """A export execution. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :param execution_type: The type of the export execution. Possible values + include: 'OnDemand', 'Scheduled' + :type execution_type: str or + ~azure.mgmt.costmanagement.models.ExecutionType + :param status: The status of the export execution. Possible values + include: 'Queued', 'InProgress', 'Completed', 'Failed', 'Timeout', + 'NewDataNotAvailable', 'DataNotAvailable' + :type status: str or ~azure.mgmt.costmanagement.models.ExecutionStatus + :param submitted_by: The identifier for the entity that executed the + export. For OnDemand executions, it is the email id. For Scheduled + executions, it is the constant value - System. + :type submitted_by: str + :param submitted_time: The time when export was queued to be executed. + :type submitted_time: datetime + :param processing_start_time: The time when export was picked up to be + executed. + :type processing_start_time: datetime + :param processing_end_time: The time when export execution finished. + :type processing_end_time: datetime + :param file_name: The name of the file export got written to. + :type file_name: str + :param run_settings: + :type run_settings: + ~azure.mgmt.costmanagement.models.CommonExportProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'execution_type': {'key': 'properties.executionType', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'submitted_by': {'key': 'properties.submittedBy', 'type': 'str'}, + 'submitted_time': {'key': 'properties.submittedTime', 'type': 'iso-8601'}, + 'processing_start_time': {'key': 'properties.processingStartTime', 'type': 'iso-8601'}, + 'processing_end_time': {'key': 'properties.processingEndTime', 'type': 'iso-8601'}, + 'file_name': {'key': 'properties.fileName', 'type': 'str'}, + 'run_settings': {'key': 'properties.runSettings', 'type': 'CommonExportProperties'}, + } + + def __init__(self, **kwargs): + super(ExportExecution, self).__init__(**kwargs) + self.execution_type = kwargs.get('execution_type', None) + self.status = kwargs.get('status', None) + self.submitted_by = kwargs.get('submitted_by', None) + self.submitted_time = kwargs.get('submitted_time', None) + self.processing_start_time = kwargs.get('processing_start_time', None) + self.processing_end_time = kwargs.get('processing_end_time', None) + self.file_name = kwargs.get('file_name', None) + self.run_settings = kwargs.get('run_settings', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution_list_result.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution_list_result.py new file mode 100644 index 000000000000..d3a017601d17 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution_list_result.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExportExecutionListResult(Model): + """Result of listing exports execution history of a export by name. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of export executions. + :vartype value: list[~azure.mgmt.costmanagement.models.ExportExecution] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExportExecution]'}, + } + + def __init__(self, **kwargs): + super(ExportExecutionListResult, self).__init__(**kwargs) + self.value = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_base_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution_list_result_py3.py similarity index 50% rename from azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_base_py3.py rename to azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution_list_result_py3.py index ce93c67b953b..ae37c54c2e60 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_base_py3.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution_list_result_py3.py @@ -12,35 +12,24 @@ from msrest.serialization import Model -class ErrorBase(Model): - """The details of the error. +class ExportExecutionListResult(Model): + """Result of listing exports execution history of a export by name. Variables are only populated by the server, and will be ignored when sending a request. - :ivar code: A machine readable error code. - :vartype code: str - :ivar message: A human readable error message. - :vartype message: str - :ivar target: Indicates which property in the request is responsible for - the error. - :vartype target: str + :ivar value: The list of export executions. + :vartype value: list[~azure.mgmt.costmanagement.models.ExportExecution] """ _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, + 'value': {'readonly': True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[ExportExecution]'}, } def __init__(self, **kwargs) -> None: - super(ErrorBase, self).__init__(**kwargs) - self.code = None - self.message = None - self.target = None + super(ExportExecutionListResult, self).__init__(**kwargs) + self.value = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution_py3.py new file mode 100644 index 000000000000..00d8281329cc --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_execution_py3.py @@ -0,0 +1,86 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class ExportExecution(Resource): + """A export execution. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :param execution_type: The type of the export execution. Possible values + include: 'OnDemand', 'Scheduled' + :type execution_type: str or + ~azure.mgmt.costmanagement.models.ExecutionType + :param status: The status of the export execution. Possible values + include: 'Queued', 'InProgress', 'Completed', 'Failed', 'Timeout', + 'NewDataNotAvailable', 'DataNotAvailable' + :type status: str or ~azure.mgmt.costmanagement.models.ExecutionStatus + :param submitted_by: The identifier for the entity that executed the + export. For OnDemand executions, it is the email id. For Scheduled + executions, it is the constant value - System. + :type submitted_by: str + :param submitted_time: The time when export was queued to be executed. + :type submitted_time: datetime + :param processing_start_time: The time when export was picked up to be + executed. + :type processing_start_time: datetime + :param processing_end_time: The time when export execution finished. + :type processing_end_time: datetime + :param file_name: The name of the file export got written to. + :type file_name: str + :param run_settings: + :type run_settings: + ~azure.mgmt.costmanagement.models.CommonExportProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'execution_type': {'key': 'properties.executionType', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'submitted_by': {'key': 'properties.submittedBy', 'type': 'str'}, + 'submitted_time': {'key': 'properties.submittedTime', 'type': 'iso-8601'}, + 'processing_start_time': {'key': 'properties.processingStartTime', 'type': 'iso-8601'}, + 'processing_end_time': {'key': 'properties.processingEndTime', 'type': 'iso-8601'}, + 'file_name': {'key': 'properties.fileName', 'type': 'str'}, + 'run_settings': {'key': 'properties.runSettings', 'type': 'CommonExportProperties'}, + } + + def __init__(self, *, execution_type=None, status=None, submitted_by: str=None, submitted_time=None, processing_start_time=None, processing_end_time=None, file_name: str=None, run_settings=None, **kwargs) -> None: + super(ExportExecution, self).__init__(**kwargs) + self.execution_type = execution_type + self.status = status + self.submitted_by = submitted_by + self.submitted_time = submitted_time + self.processing_start_time = processing_start_time + self.processing_end_time = processing_end_time + self.file_name = file_name + self.run_settings = run_settings diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_parent_group_info.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_list_result.py similarity index 52% rename from azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_parent_group_info.py rename to azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_list_result.py index 7e26dca6f12c..0a894f869f41 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_parent_group_info.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_list_result.py @@ -12,19 +12,25 @@ from msrest.serialization import Model -class EntityParentGroupInfo(Model): - """(Optional) The ID of the parent management group. +class ExportListResult(Model): + """Result of listing exports. It contains a list of available exports in the + scope provided. - :param id: The fully qualified ID for the parent management group. For - example, - /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 - :type id: str + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of exports. + :vartype value: list[~azure.mgmt.costmanagement.models.Export] """ + _validation = { + 'value': {'readonly': True}, + } + _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[Export]'}, } def __init__(self, **kwargs): - super(EntityParentGroupInfo, self).__init__(**kwargs) - self.id = kwargs.get('id', None) + super(ExportListResult, self).__init__(**kwargs) + self.value = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_list_result_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_list_result_py3.py new file mode 100644 index 000000000000..562f78ca565e --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_list_result_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExportListResult(Model): + """Result of listing exports. It contains a list of available exports in the + scope provided. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of exports. + :vartype value: list[~azure.mgmt.costmanagement.models.Export] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Export]'}, + } + + def __init__(self, **kwargs) -> None: + super(ExportListResult, self).__init__(**kwargs) + self.value = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_py3.py new file mode 100644 index 000000000000..bf8cbd862cb0 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_py3.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class Export(Resource): + """A export resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :param format: The format of the export being delivered. Possible values + include: 'Csv' + :type format: str or ~azure.mgmt.costmanagement.models.FormatType + :param delivery_info: Required. Has delivery information for the export. + :type delivery_info: ~azure.mgmt.costmanagement.models.ExportDeliveryInfo + :param definition: Required. Has definition for the export. + :type definition: ~azure.mgmt.costmanagement.models.QueryDefinition + :param schedule: Has schedule information for the export. + :type schedule: ~azure.mgmt.costmanagement.models.ExportSchedule + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'delivery_info': {'required': True}, + 'definition': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'format': {'key': 'properties.format', 'type': 'str'}, + 'delivery_info': {'key': 'properties.deliveryInfo', 'type': 'ExportDeliveryInfo'}, + 'definition': {'key': 'properties.definition', 'type': 'QueryDefinition'}, + 'schedule': {'key': 'properties.schedule', 'type': 'ExportSchedule'}, + } + + def __init__(self, *, delivery_info, definition, format=None, schedule=None, **kwargs) -> None: + super(Export, self).__init__(**kwargs) + self.format = format + self.delivery_info = delivery_info + self.definition = definition + self.schedule = schedule diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_recurrence_period.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_recurrence_period.py new file mode 100644 index 000000000000..928221e85bfa --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_recurrence_period.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExportRecurrencePeriod(Model): + """The start and end date for recurrence schedule. + + All required parameters must be populated in order to send to Azure. + + :param from_property: Required. The start date of recurrence. + :type from_property: datetime + :param to: The end date of recurrence. + :type to: datetime + """ + + _validation = { + 'from_property': {'required': True}, + } + + _attribute_map = { + 'from_property': {'key': 'from', 'type': 'iso-8601'}, + 'to': {'key': 'to', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(ExportRecurrencePeriod, self).__init__(**kwargs) + self.from_property = kwargs.get('from_property', None) + self.to = kwargs.get('to', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_recurrence_period_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_recurrence_period_py3.py new file mode 100644 index 000000000000..98cc8316fb69 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_recurrence_period_py3.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExportRecurrencePeriod(Model): + """The start and end date for recurrence schedule. + + All required parameters must be populated in order to send to Azure. + + :param from_property: Required. The start date of recurrence. + :type from_property: datetime + :param to: The end date of recurrence. + :type to: datetime + """ + + _validation = { + 'from_property': {'required': True}, + } + + _attribute_map = { + 'from_property': {'key': 'from', 'type': 'iso-8601'}, + 'to': {'key': 'to', 'type': 'iso-8601'}, + } + + def __init__(self, *, from_property, to=None, **kwargs) -> None: + super(ExportRecurrencePeriod, self).__init__(**kwargs) + self.from_property = from_property + self.to = to diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_schedule.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_schedule.py new file mode 100644 index 000000000000..29ed33f58aa3 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_schedule.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExportSchedule(Model): + """The schedule associated with a export. + + All required parameters must be populated in order to send to Azure. + + :param status: The status of the schedule. Whether active or not. If + inactive, the export's scheduled execution is paused. Possible values + include: 'Active', 'Inactive' + :type status: str or ~azure.mgmt.costmanagement.models.StatusType + :param recurrence: Required. The schedule recurrence. Possible values + include: 'Daily', 'Weekly', 'Monthly', 'Annually' + :type recurrence: str or ~azure.mgmt.costmanagement.models.RecurrenceType + :param recurrence_period: Has start and end date of the recurrence. The + start date must be in future. If present, the end date must be greater + than start date. + :type recurrence_period: + ~azure.mgmt.costmanagement.models.ExportRecurrencePeriod + """ + + _validation = { + 'recurrence': {'required': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'recurrence': {'key': 'recurrence', 'type': 'str'}, + 'recurrence_period': {'key': 'recurrencePeriod', 'type': 'ExportRecurrencePeriod'}, + } + + def __init__(self, **kwargs): + super(ExportSchedule, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.recurrence = kwargs.get('recurrence', None) + self.recurrence_period = kwargs.get('recurrence_period', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_schedule_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_schedule_py3.py new file mode 100644 index 000000000000..76235e40c282 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/export_schedule_py3.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExportSchedule(Model): + """The schedule associated with a export. + + All required parameters must be populated in order to send to Azure. + + :param status: The status of the schedule. Whether active or not. If + inactive, the export's scheduled execution is paused. Possible values + include: 'Active', 'Inactive' + :type status: str or ~azure.mgmt.costmanagement.models.StatusType + :param recurrence: Required. The schedule recurrence. Possible values + include: 'Daily', 'Weekly', 'Monthly', 'Annually' + :type recurrence: str or ~azure.mgmt.costmanagement.models.RecurrenceType + :param recurrence_period: Has start and end date of the recurrence. The + start date must be in future. If present, the end date must be greater + than start date. + :type recurrence_period: + ~azure.mgmt.costmanagement.models.ExportRecurrencePeriod + """ + + _validation = { + 'recurrence': {'required': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'recurrence': {'key': 'recurrence', 'type': 'str'}, + 'recurrence_period': {'key': 'recurrencePeriod', 'type': 'ExportRecurrencePeriod'}, + } + + def __init__(self, *, recurrence, status=None, recurrence_period=None, **kwargs) -> None: + super(ExportSchedule, self).__init__(**kwargs) + self.status = status + self.recurrence = recurrence + self.recurrence_period = recurrence_period diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_billing_account_definition.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_billing_account_definition.py deleted file mode 100644 index 5d18ffc55489..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_billing_account_definition.py +++ /dev/null @@ -1,60 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ExternalBillingAccountDefinition(Model): - """The ExternalBillingAccount model definition. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: ExternalBillingAccount id - :vartype id: str - :ivar name: ExternalBillingAccount name - :vartype name: str - :ivar type: ExternalBillingAccount type - :vartype type: str - :ivar kind: ExternalBillingAccount kind (eg aws) - :vartype kind: str - :ivar display_name: ExternalBillingAccount DisplayName - :vartype display_name: str - :ivar connector_id: Underlying ConnectorId - :vartype connector_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kind': {'readonly': True}, - 'display_name': {'readonly': True}, - 'connector_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'connector_id': {'key': 'properties.connectorId', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ExternalBillingAccountDefinition, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.kind = None - self.display_name = None - self.connector_id = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_billing_account_definition_paged.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_billing_account_definition_paged.py deleted file mode 100644 index ecb1d48256b3..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_billing_account_definition_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class ExternalBillingAccountDefinitionPaged(Paged): - """ - A paging container for iterating over a list of :class:`ExternalBillingAccountDefinition ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ExternalBillingAccountDefinition]'} - } - - def __init__(self, *args, **kwargs): - - super(ExternalBillingAccountDefinitionPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_billing_account_definition_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_billing_account_definition_py3.py deleted file mode 100644 index 7d1a93a5b22b..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_billing_account_definition_py3.py +++ /dev/null @@ -1,60 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ExternalBillingAccountDefinition(Model): - """The ExternalBillingAccount model definition. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: ExternalBillingAccount id - :vartype id: str - :ivar name: ExternalBillingAccount name - :vartype name: str - :ivar type: ExternalBillingAccount type - :vartype type: str - :ivar kind: ExternalBillingAccount kind (eg aws) - :vartype kind: str - :ivar display_name: ExternalBillingAccount DisplayName - :vartype display_name: str - :ivar connector_id: Underlying ConnectorId - :vartype connector_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kind': {'readonly': True}, - 'display_name': {'readonly': True}, - 'connector_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'connector_id': {'key': 'properties.connectorId', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(ExternalBillingAccountDefinition, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.kind = None - self.display_name = None - self.connector_id = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_subscription_definition.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_subscription_definition.py deleted file mode 100644 index b76ef94e4e4c..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_subscription_definition.py +++ /dev/null @@ -1,65 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ExternalSubscriptionDefinition(Model): - """The ExternalSubscription model definition. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: ExternalSubscription id - :vartype id: str - :ivar name: ExternalSubscription name - :vartype name: str - :ivar type: ExternalSubscription type - :vartype type: str - :ivar kind: ExternalSubscription kind (eg aws) - :vartype kind: str - :ivar display_name: ExternalSubscription DisplayName - :vartype display_name: str - :ivar management_group_id: Assigned ManagementGroupId - :vartype management_group_id: str - :ivar external_billing_account_id: Parent ExternalBillingAccountId - :vartype external_billing_account_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kind': {'readonly': True}, - 'display_name': {'readonly': True}, - 'management_group_id': {'readonly': True}, - 'external_billing_account_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'management_group_id': {'key': 'properties.managementGroupId', 'type': 'str'}, - 'external_billing_account_id': {'key': 'properties.externalBillingAccountId', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ExternalSubscriptionDefinition, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.kind = None - self.display_name = None - self.management_group_id = None - self.external_billing_account_id = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_subscription_definition_paged.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_subscription_definition_paged.py deleted file mode 100644 index f137ed1927ec..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_subscription_definition_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class ExternalSubscriptionDefinitionPaged(Paged): - """ - A paging container for iterating over a list of :class:`ExternalSubscriptionDefinition ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ExternalSubscriptionDefinition]'} - } - - def __init__(self, *args, **kwargs): - - super(ExternalSubscriptionDefinitionPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_subscription_definition_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_subscription_definition_py3.py deleted file mode 100644 index 5fa8fc479604..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_subscription_definition_py3.py +++ /dev/null @@ -1,65 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ExternalSubscriptionDefinition(Model): - """The ExternalSubscription model definition. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: ExternalSubscription id - :vartype id: str - :ivar name: ExternalSubscription name - :vartype name: str - :ivar type: ExternalSubscription type - :vartype type: str - :ivar kind: ExternalSubscription kind (eg aws) - :vartype kind: str - :ivar display_name: ExternalSubscription DisplayName - :vartype display_name: str - :ivar management_group_id: Assigned ManagementGroupId - :vartype management_group_id: str - :ivar external_billing_account_id: Parent ExternalBillingAccountId - :vartype external_billing_account_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kind': {'readonly': True}, - 'display_name': {'readonly': True}, - 'management_group_id': {'readonly': True}, - 'external_billing_account_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'management_group_id': {'key': 'properties.managementGroupId', 'type': 'str'}, - 'external_billing_account_id': {'key': 'properties.externalBillingAccountId', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(ExternalSubscriptionDefinition, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.kind = None - self.display_name = None - self.management_group_id = None - self.external_billing_account_id = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_aggregation.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_aggregation.py similarity index 88% rename from azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_aggregation.py rename to azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_aggregation.py index 0f148c5e80c6..d6b23a1e6980 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_aggregation.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_aggregation.py @@ -12,8 +12,8 @@ from msrest.serialization import Model -class ReportConfigAggregation(Model): - """The aggregation expression to be used in the report. +class QueryAggregation(Model): + """The aggregation expression to be used in the query. Variables are only populated by the server, and will be ignored when sending a request. @@ -40,5 +40,5 @@ class ReportConfigAggregation(Model): function = "Sum" def __init__(self, **kwargs): - super(ReportConfigAggregation, self).__init__(**kwargs) + super(QueryAggregation, self).__init__(**kwargs) self.name = kwargs.get('name', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_aggregation_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_aggregation_py3.py similarity index 88% rename from azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_aggregation_py3.py rename to azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_aggregation_py3.py index 61cf2de5e8ed..653dd6683433 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_aggregation_py3.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_aggregation_py3.py @@ -12,8 +12,8 @@ from msrest.serialization import Model -class ReportConfigAggregation(Model): - """The aggregation expression to be used in the report. +class QueryAggregation(Model): + """The aggregation expression to be used in the query. Variables are only populated by the server, and will be ignored when sending a request. @@ -40,5 +40,5 @@ class ReportConfigAggregation(Model): function = "Sum" def __init__(self, *, name: str, **kwargs) -> None: - super(ReportConfigAggregation, self).__init__(**kwargs) + super(QueryAggregation, self).__init__(**kwargs) self.name = name diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_comparison_expression.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_comparison_expression.py similarity index 72% rename from azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_comparison_expression.py rename to azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_comparison_expression.py index 1969db241c17..c932b1a9a232 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_comparison_expression.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_comparison_expression.py @@ -12,23 +12,26 @@ from msrest.serialization import Model -class ReportConfigComparisonExpression(Model): - """The comparison expression to be used in the report. +class QueryComparisonExpression(Model): + """The comparison expression to be used in the query. + + Variables are only populated by the server, and will be ignored when + sending a request. All required parameters must be populated in order to send to Azure. :param name: Required. The name of the column to use in comparison. :type name: str - :param operator: Required. The operator to use for comparison. Possible - values include: 'In', 'Contains' - :type operator: str or ~azure.mgmt.costmanagement.models.OperatorType + :ivar operator: Required. The operator to use for comparison. Default + value: "In" . + :vartype operator: str :param values: Required. Array of values to use for comparison :type values: list[str] """ _validation = { 'name': {'required': True}, - 'operator': {'required': True}, + 'operator': {'required': True, 'constant': True}, 'values': {'required': True, 'min_items': 1}, } @@ -38,8 +41,9 @@ class ReportConfigComparisonExpression(Model): 'values': {'key': 'values', 'type': '[str]'}, } + operator = "In" + def __init__(self, **kwargs): - super(ReportConfigComparisonExpression, self).__init__(**kwargs) + super(QueryComparisonExpression, self).__init__(**kwargs) self.name = kwargs.get('name', None) - self.operator = kwargs.get('operator', None) self.values = kwargs.get('values', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_comparison_expression_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_comparison_expression_py3.py similarity index 68% rename from azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_comparison_expression_py3.py rename to azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_comparison_expression_py3.py index 27dc0cdc1ea7..d7f1f445571a 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_comparison_expression_py3.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_comparison_expression_py3.py @@ -12,23 +12,26 @@ from msrest.serialization import Model -class ReportConfigComparisonExpression(Model): - """The comparison expression to be used in the report. +class QueryComparisonExpression(Model): + """The comparison expression to be used in the query. + + Variables are only populated by the server, and will be ignored when + sending a request. All required parameters must be populated in order to send to Azure. :param name: Required. The name of the column to use in comparison. :type name: str - :param operator: Required. The operator to use for comparison. Possible - values include: 'In', 'Contains' - :type operator: str or ~azure.mgmt.costmanagement.models.OperatorType + :ivar operator: Required. The operator to use for comparison. Default + value: "In" . + :vartype operator: str :param values: Required. Array of values to use for comparison :type values: list[str] """ _validation = { 'name': {'required': True}, - 'operator': {'required': True}, + 'operator': {'required': True, 'constant': True}, 'values': {'required': True, 'min_items': 1}, } @@ -38,8 +41,9 @@ class ReportConfigComparisonExpression(Model): 'values': {'key': 'values', 'type': '[str]'}, } - def __init__(self, *, name: str, operator, values, **kwargs) -> None: - super(ReportConfigComparisonExpression, self).__init__(**kwargs) + operator = "In" + + def __init__(self, *, name: str, values, **kwargs) -> None: + super(QueryComparisonExpression, self).__init__(**kwargs) self.name = name - self.operator = operator self.values = values diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset.py similarity index 51% rename from azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset.py rename to azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset.py index c65641a3008c..f34f504aa888 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset.py @@ -12,31 +12,31 @@ from msrest.serialization import Model -class ReportConfigDataset(Model): - """The definition of data present in the report. +class QueryDataset(Model): + """The definition of data present in the query. - :param granularity: The granularity of rows in the report. Possible values - include: 'Daily', 'Monthly' + :param granularity: The granularity of rows in the query. Possible values + include: 'Daily', 'Hourly' :type granularity: str or ~azure.mgmt.costmanagement.models.GranularityType :param configuration: Has configuration information for the data in the - report. The configuration will be ignored if aggregation and grouping are + export. The configuration will be ignored if aggregation and grouping are provided. :type configuration: - ~azure.mgmt.costmanagement.models.ReportConfigDatasetConfiguration + ~azure.mgmt.costmanagement.models.QueryDatasetConfiguration :param aggregation: Dictionary of aggregation expression to use in the - report. The key of each item in the dictionary is the alias for the - aggregated column. Report can have up to 2 aggregation clauses. + query. The key of each item in the dictionary is the alias for the + aggregated column. Query can have up to 2 aggregation clauses. :type aggregation: dict[str, - ~azure.mgmt.costmanagement.models.ReportConfigAggregation] - :param grouping: Array of group by expression to use in the report. Report + ~azure.mgmt.costmanagement.models.QueryAggregation] + :param grouping: Array of group by expression to use in the query. Query can have up to 2 group by clauses. - :type grouping: - list[~azure.mgmt.costmanagement.models.ReportConfigGrouping] - :param sorting: Array of order by expression to use in the report. - :type sorting: list[~azure.mgmt.costmanagement.models.ReportConfigSorting] - :param filter: Has filter expression to use in the report. - :type filter: ~azure.mgmt.costmanagement.models.ReportConfigFilter + :type grouping: list[~azure.mgmt.costmanagement.models.QueryGrouping] + :param sorting: Array of sorting by columns in query. + :type sorting: + list[~azure.mgmt.costmanagement.models.QuerySortingConfiguration] + :param filter: Has filter expression to use in the query. + :type filter: ~azure.mgmt.costmanagement.models.QueryFilter """ _validation = { @@ -45,15 +45,15 @@ class ReportConfigDataset(Model): _attribute_map = { 'granularity': {'key': 'granularity', 'type': 'str'}, - 'configuration': {'key': 'configuration', 'type': 'ReportConfigDatasetConfiguration'}, - 'aggregation': {'key': 'aggregation', 'type': '{ReportConfigAggregation}'}, - 'grouping': {'key': 'grouping', 'type': '[ReportConfigGrouping]'}, - 'sorting': {'key': 'sorting', 'type': '[ReportConfigSorting]'}, - 'filter': {'key': 'filter', 'type': 'ReportConfigFilter'}, + 'configuration': {'key': 'configuration', 'type': 'QueryDatasetConfiguration'}, + 'aggregation': {'key': 'aggregation', 'type': '{QueryAggregation}'}, + 'grouping': {'key': 'grouping', 'type': '[QueryGrouping]'}, + 'sorting': {'key': 'sorting', 'type': '[QuerySortingConfiguration]'}, + 'filter': {'key': 'filter', 'type': 'QueryFilter'}, } def __init__(self, **kwargs): - super(ReportConfigDataset, self).__init__(**kwargs) + super(QueryDataset, self).__init__(**kwargs) self.granularity = kwargs.get('granularity', None) self.configuration = kwargs.get('configuration', None) self.aggregation = kwargs.get('aggregation', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset_configuration.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset_configuration.py similarity index 75% rename from azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset_configuration.py rename to azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset_configuration.py index d22317c6e54c..2b77baab82cc 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset_configuration.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset_configuration.py @@ -12,11 +12,11 @@ from msrest.serialization import Model -class ReportConfigDatasetConfiguration(Model): - """The configuration of dataset in the report. +class QueryDatasetConfiguration(Model): + """The configuration of dataset in the query. - :param columns: Array of column names to be included in the report. Any - valid report column name is allowed. If not provided, then report includes + :param columns: Array of column names to be included in the query. Any + valid query column name is allowed. If not provided, then query includes all columns. :type columns: list[str] """ @@ -26,5 +26,5 @@ class ReportConfigDatasetConfiguration(Model): } def __init__(self, **kwargs): - super(ReportConfigDatasetConfiguration, self).__init__(**kwargs) + super(QueryDatasetConfiguration, self).__init__(**kwargs) self.columns = kwargs.get('columns', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset_configuration_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset_configuration_py3.py similarity index 75% rename from azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset_configuration_py3.py rename to azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset_configuration_py3.py index f0e9bc25d10e..4a660322a527 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset_configuration_py3.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset_configuration_py3.py @@ -12,11 +12,11 @@ from msrest.serialization import Model -class ReportConfigDatasetConfiguration(Model): - """The configuration of dataset in the report. +class QueryDatasetConfiguration(Model): + """The configuration of dataset in the query. - :param columns: Array of column names to be included in the report. Any - valid report column name is allowed. If not provided, then report includes + :param columns: Array of column names to be included in the query. Any + valid query column name is allowed. If not provided, then query includes all columns. :type columns: list[str] """ @@ -26,5 +26,5 @@ class ReportConfigDatasetConfiguration(Model): } def __init__(self, *, columns=None, **kwargs) -> None: - super(ReportConfigDatasetConfiguration, self).__init__(**kwargs) + super(QueryDatasetConfiguration, self).__init__(**kwargs) self.columns = columns diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset_py3.py similarity index 51% rename from azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset_py3.py rename to azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset_py3.py index 1f263ac3f3b4..016173c300c5 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset_py3.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_dataset_py3.py @@ -12,31 +12,31 @@ from msrest.serialization import Model -class ReportConfigDataset(Model): - """The definition of data present in the report. +class QueryDataset(Model): + """The definition of data present in the query. - :param granularity: The granularity of rows in the report. Possible values - include: 'Daily', 'Monthly' + :param granularity: The granularity of rows in the query. Possible values + include: 'Daily', 'Hourly' :type granularity: str or ~azure.mgmt.costmanagement.models.GranularityType :param configuration: Has configuration information for the data in the - report. The configuration will be ignored if aggregation and grouping are + export. The configuration will be ignored if aggregation and grouping are provided. :type configuration: - ~azure.mgmt.costmanagement.models.ReportConfigDatasetConfiguration + ~azure.mgmt.costmanagement.models.QueryDatasetConfiguration :param aggregation: Dictionary of aggregation expression to use in the - report. The key of each item in the dictionary is the alias for the - aggregated column. Report can have up to 2 aggregation clauses. + query. The key of each item in the dictionary is the alias for the + aggregated column. Query can have up to 2 aggregation clauses. :type aggregation: dict[str, - ~azure.mgmt.costmanagement.models.ReportConfigAggregation] - :param grouping: Array of group by expression to use in the report. Report + ~azure.mgmt.costmanagement.models.QueryAggregation] + :param grouping: Array of group by expression to use in the query. Query can have up to 2 group by clauses. - :type grouping: - list[~azure.mgmt.costmanagement.models.ReportConfigGrouping] - :param sorting: Array of order by expression to use in the report. - :type sorting: list[~azure.mgmt.costmanagement.models.ReportConfigSorting] - :param filter: Has filter expression to use in the report. - :type filter: ~azure.mgmt.costmanagement.models.ReportConfigFilter + :type grouping: list[~azure.mgmt.costmanagement.models.QueryGrouping] + :param sorting: Array of sorting by columns in query. + :type sorting: + list[~azure.mgmt.costmanagement.models.QuerySortingConfiguration] + :param filter: Has filter expression to use in the query. + :type filter: ~azure.mgmt.costmanagement.models.QueryFilter """ _validation = { @@ -45,15 +45,15 @@ class ReportConfigDataset(Model): _attribute_map = { 'granularity': {'key': 'granularity', 'type': 'str'}, - 'configuration': {'key': 'configuration', 'type': 'ReportConfigDatasetConfiguration'}, - 'aggregation': {'key': 'aggregation', 'type': '{ReportConfigAggregation}'}, - 'grouping': {'key': 'grouping', 'type': '[ReportConfigGrouping]'}, - 'sorting': {'key': 'sorting', 'type': '[ReportConfigSorting]'}, - 'filter': {'key': 'filter', 'type': 'ReportConfigFilter'}, + 'configuration': {'key': 'configuration', 'type': 'QueryDatasetConfiguration'}, + 'aggregation': {'key': 'aggregation', 'type': '{QueryAggregation}'}, + 'grouping': {'key': 'grouping', 'type': '[QueryGrouping]'}, + 'sorting': {'key': 'sorting', 'type': '[QuerySortingConfiguration]'}, + 'filter': {'key': 'filter', 'type': 'QueryFilter'}, } def __init__(self, *, granularity=None, configuration=None, aggregation=None, grouping=None, sorting=None, filter=None, **kwargs) -> None: - super(ReportConfigDataset, self).__init__(**kwargs) + super(QueryDataset, self).__init__(**kwargs) self.granularity = granularity self.configuration = configuration self.aggregation = aggregation diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_definition.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_definition.py similarity index 58% rename from azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_definition.py rename to azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_definition.py index ab46d7172b0d..2893fb7ba3fc 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_definition.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_definition.py @@ -12,28 +12,25 @@ from msrest.serialization import Model -class ReportConfigDefinition(Model): - """The definition of a report config. +class QueryDefinition(Model): + """The definition of a query. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :ivar type: Required. The type of the report. Usage represents actual - usage, forecast represents forecasted data and UsageAndForecast represents - both usage and forecasted data. Actual usage and forecasted data can be - differentiated based on dates. Default value: "Usage" . + :ivar type: Required. The type of the query. Default value: "Usage" . :vartype type: str - :param timeframe: Required. The time frame for pulling data for the - report. If custom, then a specific time period must be provided. Possible - values include: 'WeekToDate', 'MonthToDate', 'YearToDate', 'Custom' + :param timeframe: Required. The time frame for pulling data for the query. + If custom, then a specific time period must be provided. Possible values + include: 'WeekToDate', 'MonthToDate', 'YearToDate', 'TheLastWeek', + 'TheLastMonth', 'TheLastYear', 'Custom' :type timeframe: str or ~azure.mgmt.costmanagement.models.TimeframeType - :param time_period: Has time period for pulling data for the report. - :type time_period: - ~azure.mgmt.costmanagement.models.ReportConfigTimePeriod - :param dataset: Has definition for data in this report config. - :type dataset: ~azure.mgmt.costmanagement.models.ReportConfigDataset + :param time_period: Has time period for pulling data for the query. + :type time_period: ~azure.mgmt.costmanagement.models.QueryTimePeriod + :param dataset: Has definition for data in this query. + :type dataset: ~azure.mgmt.costmanagement.models.QueryDataset """ _validation = { @@ -44,14 +41,14 @@ class ReportConfigDefinition(Model): _attribute_map = { 'type': {'key': 'type', 'type': 'str'}, 'timeframe': {'key': 'timeframe', 'type': 'str'}, - 'time_period': {'key': 'timePeriod', 'type': 'ReportConfigTimePeriod'}, - 'dataset': {'key': 'dataset', 'type': 'ReportConfigDataset'}, + 'time_period': {'key': 'timePeriod', 'type': 'QueryTimePeriod'}, + 'dataset': {'key': 'dataset', 'type': 'QueryDataset'}, } type = "Usage" def __init__(self, **kwargs): - super(ReportConfigDefinition, self).__init__(**kwargs) + super(QueryDefinition, self).__init__(**kwargs) self.timeframe = kwargs.get('timeframe', None) self.time_period = kwargs.get('time_period', None) self.dataset = kwargs.get('dataset', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_definition_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_definition_py3.py similarity index 58% rename from azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_definition_py3.py rename to azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_definition_py3.py index 4a03fa138934..bf088e52b50a 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_definition_py3.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_definition_py3.py @@ -12,28 +12,25 @@ from msrest.serialization import Model -class ReportConfigDefinition(Model): - """The definition of a report config. +class QueryDefinition(Model): + """The definition of a query. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :ivar type: Required. The type of the report. Usage represents actual - usage, forecast represents forecasted data and UsageAndForecast represents - both usage and forecasted data. Actual usage and forecasted data can be - differentiated based on dates. Default value: "Usage" . + :ivar type: Required. The type of the query. Default value: "Usage" . :vartype type: str - :param timeframe: Required. The time frame for pulling data for the - report. If custom, then a specific time period must be provided. Possible - values include: 'WeekToDate', 'MonthToDate', 'YearToDate', 'Custom' + :param timeframe: Required. The time frame for pulling data for the query. + If custom, then a specific time period must be provided. Possible values + include: 'WeekToDate', 'MonthToDate', 'YearToDate', 'TheLastWeek', + 'TheLastMonth', 'TheLastYear', 'Custom' :type timeframe: str or ~azure.mgmt.costmanagement.models.TimeframeType - :param time_period: Has time period for pulling data for the report. - :type time_period: - ~azure.mgmt.costmanagement.models.ReportConfigTimePeriod - :param dataset: Has definition for data in this report config. - :type dataset: ~azure.mgmt.costmanagement.models.ReportConfigDataset + :param time_period: Has time period for pulling data for the query. + :type time_period: ~azure.mgmt.costmanagement.models.QueryTimePeriod + :param dataset: Has definition for data in this query. + :type dataset: ~azure.mgmt.costmanagement.models.QueryDataset """ _validation = { @@ -44,14 +41,14 @@ class ReportConfigDefinition(Model): _attribute_map = { 'type': {'key': 'type', 'type': 'str'}, 'timeframe': {'key': 'timeframe', 'type': 'str'}, - 'time_period': {'key': 'timePeriod', 'type': 'ReportConfigTimePeriod'}, - 'dataset': {'key': 'dataset', 'type': 'ReportConfigDataset'}, + 'time_period': {'key': 'timePeriod', 'type': 'QueryTimePeriod'}, + 'dataset': {'key': 'dataset', 'type': 'QueryDataset'}, } type = "Usage" def __init__(self, *, timeframe, time_period=None, dataset=None, **kwargs) -> None: - super(ReportConfigDefinition, self).__init__(**kwargs) + super(QueryDefinition, self).__init__(**kwargs) self.timeframe = timeframe self.time_period = time_period self.dataset = dataset diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_filter.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_filter.py similarity index 59% rename from azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_filter.py rename to azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_filter.py index 9802f5634ccc..0242d37de76d 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_filter.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_filter.py @@ -12,25 +12,22 @@ from msrest.serialization import Model -class ReportConfigFilter(Model): - """The filter expression to be used in the report. +class QueryFilter(Model): + """The filter expression to be used in the export. :param and_property: The logical "AND" expression. Must have at least 2 items. - :type and_property: - list[~azure.mgmt.costmanagement.models.ReportConfigFilter] + :type and_property: list[~azure.mgmt.costmanagement.models.QueryFilter] :param or_property: The logical "OR" expression. Must have at least 2 items. - :type or_property: - list[~azure.mgmt.costmanagement.models.ReportConfigFilter] + :type or_property: list[~azure.mgmt.costmanagement.models.QueryFilter] :param not_property: The logical "NOT" expression. - :type not_property: ~azure.mgmt.costmanagement.models.ReportConfigFilter + :type not_property: ~azure.mgmt.costmanagement.models.QueryFilter :param dimension: Has comparison expression for a dimension :type dimension: - ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression + ~azure.mgmt.costmanagement.models.QueryComparisonExpression :param tag: Has comparison expression for a tag - :type tag: - ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression + :type tag: ~azure.mgmt.costmanagement.models.QueryComparisonExpression """ _validation = { @@ -39,15 +36,15 @@ class ReportConfigFilter(Model): } _attribute_map = { - 'and_property': {'key': 'and', 'type': '[ReportConfigFilter]'}, - 'or_property': {'key': 'or', 'type': '[ReportConfigFilter]'}, - 'not_property': {'key': 'not', 'type': 'ReportConfigFilter'}, - 'dimension': {'key': 'dimension', 'type': 'ReportConfigComparisonExpression'}, - 'tag': {'key': 'tag', 'type': 'ReportConfigComparisonExpression'}, + 'and_property': {'key': 'and', 'type': '[QueryFilter]'}, + 'or_property': {'key': 'or', 'type': '[QueryFilter]'}, + 'not_property': {'key': 'not', 'type': 'QueryFilter'}, + 'dimension': {'key': 'dimension', 'type': 'QueryComparisonExpression'}, + 'tag': {'key': 'tag', 'type': 'QueryComparisonExpression'}, } def __init__(self, **kwargs): - super(ReportConfigFilter, self).__init__(**kwargs) + super(QueryFilter, self).__init__(**kwargs) self.and_property = kwargs.get('and_property', None) self.or_property = kwargs.get('or_property', None) self.not_property = kwargs.get('not_property', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_filter_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_filter_py3.py similarity index 58% rename from azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_filter_py3.py rename to azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_filter_py3.py index 43521afa34eb..f6e4f0ee5976 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_filter_py3.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_filter_py3.py @@ -12,25 +12,22 @@ from msrest.serialization import Model -class ReportConfigFilter(Model): - """The filter expression to be used in the report. +class QueryFilter(Model): + """The filter expression to be used in the export. :param and_property: The logical "AND" expression. Must have at least 2 items. - :type and_property: - list[~azure.mgmt.costmanagement.models.ReportConfigFilter] + :type and_property: list[~azure.mgmt.costmanagement.models.QueryFilter] :param or_property: The logical "OR" expression. Must have at least 2 items. - :type or_property: - list[~azure.mgmt.costmanagement.models.ReportConfigFilter] + :type or_property: list[~azure.mgmt.costmanagement.models.QueryFilter] :param not_property: The logical "NOT" expression. - :type not_property: ~azure.mgmt.costmanagement.models.ReportConfigFilter + :type not_property: ~azure.mgmt.costmanagement.models.QueryFilter :param dimension: Has comparison expression for a dimension :type dimension: - ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression + ~azure.mgmt.costmanagement.models.QueryComparisonExpression :param tag: Has comparison expression for a tag - :type tag: - ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression + :type tag: ~azure.mgmt.costmanagement.models.QueryComparisonExpression """ _validation = { @@ -39,15 +36,15 @@ class ReportConfigFilter(Model): } _attribute_map = { - 'and_property': {'key': 'and', 'type': '[ReportConfigFilter]'}, - 'or_property': {'key': 'or', 'type': '[ReportConfigFilter]'}, - 'not_property': {'key': 'not', 'type': 'ReportConfigFilter'}, - 'dimension': {'key': 'dimension', 'type': 'ReportConfigComparisonExpression'}, - 'tag': {'key': 'tag', 'type': 'ReportConfigComparisonExpression'}, + 'and_property': {'key': 'and', 'type': '[QueryFilter]'}, + 'or_property': {'key': 'or', 'type': '[QueryFilter]'}, + 'not_property': {'key': 'not', 'type': 'QueryFilter'}, + 'dimension': {'key': 'dimension', 'type': 'QueryComparisonExpression'}, + 'tag': {'key': 'tag', 'type': 'QueryComparisonExpression'}, } def __init__(self, *, and_property=None, or_property=None, not_property=None, dimension=None, tag=None, **kwargs) -> None: - super(ReportConfigFilter, self).__init__(**kwargs) + super(QueryFilter, self).__init__(**kwargs) self.and_property = and_property self.or_property = or_property self.not_property = not_property diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_grouping.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_grouping.py similarity index 74% rename from azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_grouping.py rename to azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_grouping.py index 09ca40f3cda5..ee61a9990685 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_grouping.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_grouping.py @@ -12,17 +12,15 @@ from msrest.serialization import Model -class ReportConfigGrouping(Model): - """The group by expression to be used in the report. +class QueryGrouping(Model): + """The group by expression to be used in the query. All required parameters must be populated in order to send to Azure. :param type: Required. Has type of the column to group. Possible values include: 'Tag', 'Dimension' - :type type: str or - ~azure.mgmt.costmanagement.models.ReportConfigColumnType - :param name: Required. The name of the column to group. This version - supports subscription lowest possible grain. + :type type: str or ~azure.mgmt.costmanagement.models.QueryColumnType + :param name: Required. The name of the column to group. :type name: str """ @@ -37,6 +35,6 @@ class ReportConfigGrouping(Model): } def __init__(self, **kwargs): - super(ReportConfigGrouping, self).__init__(**kwargs) + super(QueryGrouping, self).__init__(**kwargs) self.type = kwargs.get('type', None) self.name = kwargs.get('name', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_grouping_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_grouping_py3.py similarity index 74% rename from azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_grouping_py3.py rename to azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_grouping_py3.py index 317bcf8f3d24..65f4b79f255f 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_grouping_py3.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_grouping_py3.py @@ -12,17 +12,15 @@ from msrest.serialization import Model -class ReportConfigGrouping(Model): - """The group by expression to be used in the report. +class QueryGrouping(Model): + """The group by expression to be used in the query. All required parameters must be populated in order to send to Azure. :param type: Required. Has type of the column to group. Possible values include: 'Tag', 'Dimension' - :type type: str or - ~azure.mgmt.costmanagement.models.ReportConfigColumnType - :param name: Required. The name of the column to group. This version - supports subscription lowest possible grain. + :type type: str or ~azure.mgmt.costmanagement.models.QueryColumnType + :param name: Required. The name of the column to group. :type name: str """ @@ -37,6 +35,6 @@ class ReportConfigGrouping(Model): } def __init__(self, *, type, name: str, **kwargs) -> None: - super(ReportConfigGrouping, self).__init__(**kwargs) + super(QueryGrouping, self).__init__(**kwargs) self.type = type self.name = name diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_sorting.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_sorting_configuration.py similarity index 52% rename from azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_sorting.py rename to azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_sorting_configuration.py index 897bdde4cee5..ea1704928e03 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_sorting.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_sorting_configuration.py @@ -12,28 +12,23 @@ from msrest.serialization import Model -class ReportConfigSorting(Model): - """The order by expression to be used in the report. - - All required parameters must be populated in order to send to Azure. - - :param direction: Direction of sort. Possible values include: 'Ascending', - 'Descending' - :type direction: str or ~azure.mgmt.costmanagement.models.enum - :param name: Required. The name of the column to sort. +class QuerySortingConfiguration(Model): + """The configuration for sorting in the query. + + :param query_sorting_direction: The sorting direction. Possible values + include: 'Ascending', 'Descending' + :type query_sorting_direction: str or + ~azure.mgmt.costmanagement.models.SortDirection + :param name: The name of the column to use in sorting. :type name: str """ - _validation = { - 'name': {'required': True}, - } - _attribute_map = { - 'direction': {'key': 'direction', 'type': 'str'}, + 'query_sorting_direction': {'key': 'querySortingDirection', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, } def __init__(self, **kwargs): - super(ReportConfigSorting, self).__init__(**kwargs) - self.direction = kwargs.get('direction', None) + super(QuerySortingConfiguration, self).__init__(**kwargs) + self.query_sorting_direction = kwargs.get('query_sorting_direction', None) self.name = kwargs.get('name', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_sorting_configuration_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_sorting_configuration_py3.py new file mode 100644 index 000000000000..fc7524c322d3 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_sorting_configuration_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class QuerySortingConfiguration(Model): + """The configuration for sorting in the query. + + :param query_sorting_direction: The sorting direction. Possible values + include: 'Ascending', 'Descending' + :type query_sorting_direction: str or + ~azure.mgmt.costmanagement.models.SortDirection + :param name: The name of the column to use in sorting. + :type name: str + """ + + _attribute_map = { + 'query_sorting_direction': {'key': 'querySortingDirection', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, query_sorting_direction=None, name: str=None, **kwargs) -> None: + super(QuerySortingConfiguration, self).__init__(**kwargs) + self.query_sorting_direction = query_sorting_direction + self.name = name diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_time_period.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_time_period.py similarity index 87% rename from azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_time_period.py rename to azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_time_period.py index bc09d4547bb3..3c0dc37b8619 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_time_period.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_time_period.py @@ -12,8 +12,8 @@ from msrest.serialization import Model -class ReportConfigTimePeriod(Model): - """The start and end date for pulling data for the report. +class QueryTimePeriod(Model): + """The start and end date for pulling data for the query. All required parameters must be populated in order to send to Azure. @@ -34,6 +34,6 @@ class ReportConfigTimePeriod(Model): } def __init__(self, **kwargs): - super(ReportConfigTimePeriod, self).__init__(**kwargs) + super(QueryTimePeriod, self).__init__(**kwargs) self.from_property = kwargs.get('from_property', None) self.to = kwargs.get('to', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_time_period_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_time_period_py3.py similarity index 87% rename from azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_time_period_py3.py rename to azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_time_period_py3.py index c98826663a11..63a1d7d6e08c 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_time_period_py3.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/query_time_period_py3.py @@ -12,8 +12,8 @@ from msrest.serialization import Model -class ReportConfigTimePeriod(Model): - """The start and end date for pulling data for the report. +class QueryTimePeriod(Model): + """The start and end date for pulling data for the query. All required parameters must be populated in order to send to Azure. @@ -34,6 +34,6 @@ class ReportConfigTimePeriod(Model): } def __init__(self, *, from_property, to, **kwargs) -> None: - super(ReportConfigTimePeriod, self).__init__(**kwargs) + super(QueryTimePeriod, self).__init__(**kwargs) self.from_property = from_property self.to = to diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_sorting_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_sorting_py3.py deleted file mode 100644 index 910397d8d51b..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_sorting_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ReportConfigSorting(Model): - """The order by expression to be used in the report. - - All required parameters must be populated in order to send to Azure. - - :param direction: Direction of sort. Possible values include: 'Ascending', - 'Descending' - :type direction: str or ~azure.mgmt.costmanagement.models.enum - :param name: Required. The name of the column to sort. - :type name: str - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'direction': {'key': 'direction', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, name: str, direction=None, **kwargs) -> None: - super(ReportConfigSorting, self).__init__(**kwargs) - self.direction = direction - self.name = name diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py index a255b445f443..fbf3fa761115 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py @@ -11,20 +11,12 @@ from .dimensions_operations import DimensionsOperations from .query_operations import QueryOperations -from .forecast_operations import ForecastOperations -from .cloud_connector_operations import CloudConnectorOperations -from .external_billing_account_operations import ExternalBillingAccountOperations -from .external_subscription_operations import ExternalSubscriptionOperations -from .entities_operations import EntitiesOperations +from .exports_operations import ExportsOperations from .operations import Operations __all__ = [ 'DimensionsOperations', 'QueryOperations', - 'ForecastOperations', - 'CloudConnectorOperations', - 'ExternalBillingAccountOperations', - 'ExternalSubscriptionOperations', - 'EntitiesOperations', + 'ExportsOperations', 'Operations', ] diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/cloud_connector_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/cloud_connector_operations.py deleted file mode 100644 index 1359df81699f..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/cloud_connector_operations.py +++ /dev/null @@ -1,334 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse - -from .. import models - - -class CloudConnectorOperations(object): - """CloudConnectorOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2019-03-01-preview. Constant value: "2019-03-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-03-01-preview" - - self.config = config - - def list( - self, custom_headers=None, raw=False, **operation_config): - """List all cloud connector definitions. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ConnectorDefinition - :rtype: - ~azure.mgmt.costmanagement.models.ConnectorDefinitionPaged[~azure.mgmt.costmanagement.models.ConnectorDefinition] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list.metadata['url'] - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.ConnectorDefinitionPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.ConnectorDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/providers/Microsoft.CostManagement/cloudConnectors'} - - def get( - self, connector_name, expand=None, custom_headers=None, raw=False, **operation_config): - """Get a cloud connector definition. - - :param connector_name: Connector Name. - :type connector_name: str - :param expand: May be used to expand the collectionInfo property. By - default, collectionInfo is not included. - :type expand: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ConnectorDefinition or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.costmanagement.models.ConnectorDefinition or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'connectorName': self._serialize.url("connector_name", connector_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('ConnectorDefinition', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/providers/Microsoft.CostManagement/cloudConnectors/{connectorName}'} - - def create_or_update( - self, connector_name, connector, custom_headers=None, raw=False, **operation_config): - """Create or update a cloud connector definition. - - :param connector_name: Connector Name. - :type connector_name: str - :param connector: Connector details - :type connector: ~azure.mgmt.costmanagement.models.ConnectorDefinition - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ConnectorDefinition or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.costmanagement.models.ConnectorDefinition or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.create_or_update.metadata['url'] - path_format_arguments = { - 'connectorName': self._serialize.url("connector_name", connector_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(connector, 'ConnectorDefinition') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('ConnectorDefinition', response) - if response.status_code == 201: - deserialized = self._deserialize('ConnectorDefinition', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create_or_update.metadata = {'url': '/providers/Microsoft.CostManagement/cloudConnectors/{connectorName}'} - - def delete( - self, connector_name, custom_headers=None, raw=False, **operation_config): - """Delete a cloud connector definition. - - :param connector_name: Connector Name. - :type connector_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'connectorName': self._serialize.url("connector_name", connector_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - delete.metadata = {'url': '/providers/Microsoft.CostManagement/cloudConnectors/{connectorName}'} - - def update( - self, connector_name, connector, custom_headers=None, raw=False, **operation_config): - """Update a cloud connector definition. - - :param connector_name: Connector Name. - :type connector_name: str - :param connector: Connector details - :type connector: ~azure.mgmt.costmanagement.models.ConnectorDefinition - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ConnectorDefinition or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.costmanagement.models.ConnectorDefinition or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'connectorName': self._serialize.url("connector_name", connector_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(connector, 'ConnectorDefinition') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('ConnectorDefinition', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update.metadata = {'url': '/providers/Microsoft.CostManagement/cloudConnectors/{connectorName}'} diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/dimensions_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/dimensions_operations.py index 7c79563f7ab1..5bdad8c6f173 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/dimensions_operations.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/dimensions_operations.py @@ -22,7 +22,7 @@ class DimensionsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2019-03-01-preview. Constant value: "2019-03-01-preview". + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-05-31. Constant value: "2019-01-01". """ models = models @@ -32,376 +32,27 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-03-01-preview" + self.api_version = "2019-01-01" self.config = config - def list_by_billing_account( - self, billing_account_id, filter=None, expand=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config): - """Lists the dimensions by billingAccount Id. - - :param billing_account_id: BillingAccount ID - :type billing_account_id: str - :param filter: May be used to filter dimensions by - properties/category, properties/usageStart, properties/usageEnd. - Supported operators are 'eq','lt', 'gt', 'le', 'ge'. - :type filter: str - :param expand: May be used to expand the properties/data within a - dimension category. By default, data is not included when listing - dimensions. - :type expand: str - :param skiptoken: Skiptoken is only used if a previous operation - returned a partial result. If a previous response contains a nextLink - element, the value of the nextLink element will include a skiptoken - parameter that specifies a starting point to use for subsequent calls. - :type skiptoken: str - :param top: May be used to limit the number of results to the most - recent N dimension data. - :type top: int - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Dimension - :rtype: - ~azure.mgmt.costmanagement.models.DimensionPaged[~azure.mgmt.costmanagement.models.Dimension] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_billing_account.metadata['url'] - path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - if skiptoken is not None: - query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.DimensionPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.DimensionPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/dimensions'} - - def list_by_enrollment_account( - self, billing_account_id, enrollment_account_id, filter=None, expand=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config): - """Lists the dimensions by Enrollment Account Id. - - :param billing_account_id: BillingAccount ID - :type billing_account_id: str - :param enrollment_account_id: Enrollment Account ID - :type enrollment_account_id: str - :param filter: May be used to filter dimensions by - properties/category, properties/usageStart, properties/usageEnd. - Supported operators are 'eq','lt', 'gt', 'le', 'ge'. - :type filter: str - :param expand: May be used to expand the properties/data within a - dimension category. By default, data is not included when listing - dimensions. - :type expand: str - :param skiptoken: Skiptoken is only used if a previous operation - returned a partial result. If a previous response contains a nextLink - element, the value of the nextLink element will include a skiptoken - parameter that specifies a starting point to use for subsequent calls. - :type skiptoken: str - :param top: May be used to limit the number of results to the most - recent N dimension data. - :type top: int - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Dimension - :rtype: - ~azure.mgmt.costmanagement.models.DimensionPaged[~azure.mgmt.costmanagement.models.Dimension] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_enrollment_account.metadata['url'] - path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), - 'enrollmentAccountId': self._serialize.url("enrollment_account_id", enrollment_account_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - if skiptoken is not None: - query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.DimensionPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.DimensionPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_enrollment_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}/providers/Microsoft.CostManagement/dimensions'} - - def list_by_department( - self, billing_account_id, department_id, filter=None, expand=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config): - """Lists the dimensions by Department Id. - - :param billing_account_id: BillingAccount ID - :type billing_account_id: str - :param department_id: Department ID - :type department_id: str - :param filter: May be used to filter dimensions by - properties/category, properties/usageStart, properties/usageEnd. - Supported operators are 'eq','lt', 'gt', 'le', 'ge'. - :type filter: str - :param expand: May be used to expand the properties/data within a - dimension category. By default, data is not included when listing - dimensions. - :type expand: str - :param skiptoken: Skiptoken is only used if a previous operation - returned a partial result. If a previous response contains a nextLink - element, the value of the nextLink element will include a skiptoken - parameter that specifies a starting point to use for subsequent calls. - :type skiptoken: str - :param top: May be used to limit the number of results to the most - recent N dimension data. - :type top: int - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Dimension - :rtype: - ~azure.mgmt.costmanagement.models.DimensionPaged[~azure.mgmt.costmanagement.models.Dimension] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_department.metadata['url'] - path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), - 'departmentId': self._serialize.url("department_id", department_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - if skiptoken is not None: - query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.DimensionPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.DimensionPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_department.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}/providers/Microsoft.CostManagement/dimensions'} - - def list_by_management_group( - self, management_group_id, filter=None, expand=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config): - """Lists the dimensions by managementGroup Id. - - :param management_group_id: ManagementGroup ID - :type management_group_id: str - :param filter: May be used to filter dimensions by - properties/category, properties/usageStart, properties/usageEnd. - Supported operators are 'eq','lt', 'gt', 'le', 'ge'. - :type filter: str - :param expand: May be used to expand the properties/data within a - dimension category. By default, data is not included when listing - dimensions. - :type expand: str - :param skiptoken: Skiptoken is only used if a previous operation - returned a partial result. If a previous response contains a nextLink - element, the value of the nextLink element will include a skiptoken - parameter that specifies a starting point to use for subsequent calls. - :type skiptoken: str - :param top: May be used to limit the number of results to the most - recent N dimension data. - :type top: int - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Dimension - :rtype: - ~azure.mgmt.costmanagement.models.DimensionPaged[~azure.mgmt.costmanagement.models.Dimension] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_management_group.metadata['url'] - path_format_arguments = { - 'managementGroupId': self._serialize.url("management_group_id", management_group_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - if skiptoken is not None: - query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.DimensionPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.DimensionPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_management_group.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.CostManagement/dimensions'} - def list_by_subscription( - self, filter=None, expand=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config): - """Lists the dimensions by subscription Id. - + self, scope, filter=None, expand=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config): + """Lists the dimensions by the defined scope. + + :param scope: The scope associated with dimension operations. This + includes '/subscriptions/{subscriptionId}/' for subscription scope, + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' + for resourceGroup scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for + Billing Account scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' + for Department scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + for EnrollmentAccount scope and + '/providers/Microsoft.Management/managementGroups/{managementGroupId}' + for Management Group scope.. + :type scope: str :param filter: May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'. @@ -435,97 +86,7 @@ def internal_paging(next_link=None, raw=False): # Construct URL url = self.list_by_subscription.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - if skiptoken is not None: - query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.DimensionPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.DimensionPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CostManagement/dimensions'} - - def list_by_resource_group( - self, resource_group_name, filter=None, expand=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config): - """Lists the dimensions by resource group Id. - - :param resource_group_name: Azure Resource Group Name. - :type resource_group_name: str - :param filter: May be used to filter dimensions by - properties/category, properties/usageStart, properties/usageEnd. - Supported operators are 'eq','lt', 'gt', 'le', 'ge'. - :type filter: str - :param expand: May be used to expand the properties/data within a - dimension category. By default, data is not included when listing - dimensions. - :type expand: str - :param skiptoken: Skiptoken is only used if a previous operation - returned a partial result. If a previous response contains a nextLink - element, the value of the nextLink element will include a skiptoken - parameter that specifies a starting point to use for subsequent calls. - :type skiptoken: str - :param top: May be used to limit the number of results to the most - recent N dimension data. - :type top: int - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Dimension - :rtype: - ~azure.mgmt.costmanagement.models.DimensionPaged[~azure.mgmt.costmanagement.models.Dimension] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) } url = self._client.format_url(url, **path_format_arguments) @@ -573,4 +134,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CostManagement/dimensions'} + list_by_subscription.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/dimensions'} diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/entities_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/entities_operations.py deleted file mode 100644 index 59721f2014ac..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/entities_operations.py +++ /dev/null @@ -1,111 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse - -from .. import models - - -class EntitiesOperations(object): - """EntitiesOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2019-03-01-preview. Constant value: "2019-03-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-03-01-preview" - - self.config = config - - def list_by_management_group( - self, management_group_id, view=None, custom_headers=None, raw=False, **operation_config): - """List all entities (Management Groups, Subscriptions, - ExternalSubscriptions, etc.) focusing on a particular group for the - authenticated user. - - :param management_group_id: ManagementGroup ID - :type management_group_id: str - :param view: The view parameter allows clients to filter the type of - data that is returned by the getEntities call. Possible values - include: 'FullHierarchy', 'GroupsOnly', 'SubscriptionsOnly', - 'ExternalSubscriptionsOnly', 'Audit' - :type view: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of EntityInfo - :rtype: - ~azure.mgmt.costmanagement.models.EntityInfoPaged[~azure.mgmt.costmanagement.models.EntityInfo] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_management_group.metadata['url'] - path_format_arguments = { - 'managementGroupId': self._serialize.url("management_group_id", management_group_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if view is not None: - query_parameters['$view'] = self._serialize.query("view", view, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.EntityInfoPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.EntityInfoPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_management_group.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.CostManagement/getEntities'} diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/exports_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/exports_operations.py new file mode 100644 index 000000000000..28c016399294 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/exports_operations.py @@ -0,0 +1,460 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ExportsOperations(object): + """ExportsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-05-31. Constant value: "2019-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-01-01" + + self.config = config + + def list( + self, scope, custom_headers=None, raw=False, **operation_config): + """Lists all exports at the given scope. + + :param scope: The scope associated with query and export operations. + This includes '/subscriptions/{subscriptionId}/' for subscription + scope, + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' + for resourceGroup scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for + Billing Account scope and + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' + for Department scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + for EnrollmentAccount scope and + '/providers/Microsoft.Management/managementGroups/{managementGroupId} + for Management Group scope.. + :type scope: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ExportListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.costmanagement.models.ExportListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ExportListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports'} + + def get( + self, scope, export_name, custom_headers=None, raw=False, **operation_config): + """Gets the export for the defined scope by export name. + + :param scope: The scope associated with query and export operations. + This includes '/subscriptions/{subscriptionId}/' for subscription + scope, + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' + for resourceGroup scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for + Billing Account scope and + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' + for Department scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + for EnrollmentAccount scope and + '/providers/Microsoft.Management/managementGroups/{managementGroupId} + for Management Group scope.. + :type scope: str + :param export_name: Export Name. + :type export_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Export or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.costmanagement.models.Export or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'exportName': self._serialize.url("export_name", export_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Export', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}'} + + def create_or_update( + self, scope, export_name, parameters, custom_headers=None, raw=False, **operation_config): + """The operation to create or update a export. Update operation requires + latest eTag to be set in the request. You may obtain the latest eTag by + performing a get operation. Create operation does not require eTag. + + :param scope: The scope associated with query and export operations. + This includes '/subscriptions/{subscriptionId}/' for subscription + scope, + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' + for resourceGroup scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for + Billing Account scope and + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' + for Department scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + for EnrollmentAccount scope and + '/providers/Microsoft.Management/managementGroups/{managementGroupId} + for Management Group scope.. + :type scope: str + :param export_name: Export Name. + :type export_name: str + :param parameters: Parameters supplied to the CreateOrUpdate Export + operation. + :type parameters: ~azure.mgmt.costmanagement.models.Export + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Export or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.costmanagement.models.Export or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'exportName': self._serialize.url("export_name", export_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'Export') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Export', response) + if response.status_code == 201: + deserialized = self._deserialize('Export', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}'} + + def delete( + self, scope, export_name, custom_headers=None, raw=False, **operation_config): + """The operation to delete a export. + + :param scope: The scope associated with query and export operations. + This includes '/subscriptions/{subscriptionId}/' for subscription + scope, + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' + for resourceGroup scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for + Billing Account scope and + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' + for Department scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + for EnrollmentAccount scope and + '/providers/Microsoft.Management/managementGroups/{managementGroupId} + for Management Group scope.. + :type scope: str + :param export_name: Export Name. + :type export_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'exportName': self._serialize.url("export_name", export_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}'} + + def execute( + self, scope, export_name, custom_headers=None, raw=False, **operation_config): + """The operation to execute a export. + + :param scope: The scope associated with query and export operations. + This includes '/subscriptions/{subscriptionId}/' for subscription + scope, + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' + for resourceGroup scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for + Billing Account scope and + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' + for Department scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + for EnrollmentAccount scope and + '/providers/Microsoft.Management/managementGroups/{managementGroupId} + for Management Group scope.. + :type scope: str + :param export_name: Export Name. + :type export_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.execute.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'exportName': self._serialize.url("export_name", export_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + execute.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/run'} + + def get_execution_history( + self, scope, export_name, custom_headers=None, raw=False, **operation_config): + """Gets the execution history of a export for the defined scope by export + name. + + :param scope: The scope associated with query and export operations. + This includes '/subscriptions/{subscriptionId}/' for subscription + scope, + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' + for resourceGroup scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for + Billing Account scope and + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' + for Department scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + for EnrollmentAccount scope and + '/providers/Microsoft.Management/managementGroups/{managementGroupId} + for Management Group scope.. + :type scope: str + :param export_name: Export Name. + :type export_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ExportExecutionListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.costmanagement.models.ExportExecutionListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_execution_history.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'exportName': self._serialize.url("export_name", export_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ExportExecutionListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_execution_history.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/runHistory'} diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/external_billing_account_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/external_billing_account_operations.py deleted file mode 100644 index da2049233695..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/external_billing_account_operations.py +++ /dev/null @@ -1,156 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse - -from .. import models - - -class ExternalBillingAccountOperations(object): - """ExternalBillingAccountOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2019-03-01-preview. Constant value: "2019-03-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-03-01-preview" - - self.config = config - - def list( - self, custom_headers=None, raw=False, **operation_config): - """List all ExternalBillingAccount definitions. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ExternalBillingAccountDefinition - :rtype: - ~azure.mgmt.costmanagement.models.ExternalBillingAccountDefinitionPaged[~azure.mgmt.costmanagement.models.ExternalBillingAccountDefinition] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list.metadata['url'] - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.ExternalBillingAccountDefinitionPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.ExternalBillingAccountDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/providers/Microsoft.CostManagement/externalBillingAccounts'} - - def get( - self, external_billing_account_name, custom_headers=None, raw=False, **operation_config): - """Get a ExternalBillingAccount definition. - - :param external_billing_account_name: External Billing Account Name. - (eg 'aws-{PayerAccountId}') - :type external_billing_account_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ExternalBillingAccountDefinition or ClientRawResponse if - raw=true - :rtype: - ~azure.mgmt.costmanagement.models.ExternalBillingAccountDefinition or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'externalBillingAccountName': self._serialize.url("external_billing_account_name", external_billing_account_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('ExternalBillingAccountDefinition', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}'} diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/external_subscription_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/external_subscription_operations.py deleted file mode 100644 index 6059b0c05e1d..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/external_subscription_operations.py +++ /dev/null @@ -1,339 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse - -from .. import models - - -class ExternalSubscriptionOperations(object): - """ExternalSubscriptionOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2019-03-01-preview. Constant value: "2019-03-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-03-01-preview" - - self.config = config - - def list_by_external_billing_account( - self, external_billing_account_name, custom_headers=None, raw=False, **operation_config): - """List all ExternalSubscriptions by ExternalBillingAccount definitions. - - :param external_billing_account_name: External Billing Account Name. - (eg 'aws-{PayerAccountId}') - :type external_billing_account_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ExternalSubscriptionDefinition - :rtype: - ~azure.mgmt.costmanagement.models.ExternalSubscriptionDefinitionPaged[~azure.mgmt.costmanagement.models.ExternalSubscriptionDefinition] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_external_billing_account.metadata['url'] - path_format_arguments = { - 'externalBillingAccountName': self._serialize.url("external_billing_account_name", external_billing_account_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.ExternalSubscriptionDefinitionPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.ExternalSubscriptionDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_external_billing_account.metadata = {'url': '/providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}/externalSubscriptions'} - - def list( - self, custom_headers=None, raw=False, **operation_config): - """List all ExternalSubscription definitions. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ExternalSubscriptionDefinition - :rtype: - ~azure.mgmt.costmanagement.models.ExternalSubscriptionDefinitionPaged[~azure.mgmt.costmanagement.models.ExternalSubscriptionDefinition] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list.metadata['url'] - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.ExternalSubscriptionDefinitionPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.ExternalSubscriptionDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/providers/Microsoft.CostManagement/externalSubscriptions'} - - def get( - self, external_subscription_name, custom_headers=None, raw=False, **operation_config): - """Get an ExternalSubscription definition. - - :param external_subscription_name: External Subscription Name. (eg - 'aws-{UsageAccountId}') - :type external_subscription_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ExternalSubscriptionDefinition or ClientRawResponse if - raw=true - :rtype: - ~azure.mgmt.costmanagement.models.ExternalSubscriptionDefinition or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'externalSubscriptionName': self._serialize.url("external_subscription_name", external_subscription_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('ExternalSubscriptionDefinition', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}'} - - def list_by_management_group( - self, management_group_id, custom_headers=None, raw=False, **operation_config): - """List all ExternalSubscription definitions for Management Group. - - :param management_group_id: ManagementGroup ID - :type management_group_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ExternalSubscriptionDefinition - :rtype: - ~azure.mgmt.costmanagement.models.ExternalSubscriptionDefinitionPaged[~azure.mgmt.costmanagement.models.ExternalSubscriptionDefinition] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_management_group.metadata['url'] - path_format_arguments = { - 'managementGroupId': self._serialize.url("management_group_id", management_group_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.ExternalSubscriptionDefinitionPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.ExternalSubscriptionDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_management_group.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.CostManagement/externalSubscriptions'} - - def update_by_management_group( - self, management_group_id, external_subscription_name, custom_headers=None, raw=False, **operation_config): - """Associates ExternalSubscription with the management group. - - :param management_group_id: ManagementGroup ID - :type management_group_id: str - :param external_subscription_name: External Subscription Name. (eg - 'aws-{UsageAccountId}') - :type external_subscription_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.update_by_management_group.metadata['url'] - path_format_arguments = { - 'managementGroupId': self._serialize.url("management_group_id", management_group_id, 'str'), - 'externalSubscriptionName': self._serialize.url("external_subscription_name", external_subscription_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [204]: - raise models.ErrorResponseException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - update_by_management_group.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}'} diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/forecast_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/forecast_operations.py deleted file mode 100644 index 1020f3179d4d..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/forecast_operations.py +++ /dev/null @@ -1,480 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse - -from .. import models - - -class ForecastOperations(object): - """ForecastOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2019-03-01-preview. Constant value: "2019-03-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-03-01-preview" - - self.config = config - - def usage_by_subscription( - self, parameters, custom_headers=None, raw=False, **operation_config): - """Forecast the usage data for subscriptionId. - - :param parameters: Parameters supplied to the CreateOrUpdate Report - Config operation. - :type parameters: - ~azure.mgmt.costmanagement.models.ReportConfigDefinition - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Query - :rtype: - ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.usage_by_subscription.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ReportConfigDefinition') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - usage_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CostManagement/Forecast'} - - def usage_by_resource_group( - self, resource_group_name, parameters, custom_headers=None, raw=False, **operation_config): - """Forecast the usage data for subscriptionId and resource group. - - :param resource_group_name: Azure Resource Group Name. - :type resource_group_name: str - :param parameters: Parameters supplied to the CreateOrUpdate Report - Config operation. - :type parameters: - ~azure.mgmt.costmanagement.models.ReportConfigDefinition - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Query - :rtype: - ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.usage_by_resource_group.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ReportConfigDefinition') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - usage_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.CostManagement/Forecast'} - - def usage_by_billing_account( - self, billing_account_id, parameters, custom_headers=None, raw=False, **operation_config): - """Forecast the usage data for billing account. - - :param billing_account_id: BillingAccount ID - :type billing_account_id: str - :param parameters: Parameters supplied to the CreateOrUpdate Report - Config operation. - :type parameters: - ~azure.mgmt.costmanagement.models.ReportConfigDefinition - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Query - :rtype: - ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.usage_by_billing_account.metadata['url'] - path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ReportConfigDefinition') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - usage_by_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/Forecast'} - - def usage_by_enrollment_account( - self, billing_account_id, enrollment_account_id, parameters, custom_headers=None, raw=False, **operation_config): - """Forecast the usage data for an enrollment account. - - :param billing_account_id: BillingAccount ID - :type billing_account_id: str - :param enrollment_account_id: Enrollment Account ID - :type enrollment_account_id: str - :param parameters: Parameters supplied to the CreateOrUpdate Report - Config operation. - :type parameters: - ~azure.mgmt.costmanagement.models.ReportConfigDefinition - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Query - :rtype: - ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.usage_by_enrollment_account.metadata['url'] - path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), - 'enrollmentAccountId': self._serialize.url("enrollment_account_id", enrollment_account_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ReportConfigDefinition') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - usage_by_enrollment_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}/providers/Microsoft.CostManagement/Forecast'} - - def usage_by_department( - self, billing_account_id, department_id, parameters, custom_headers=None, raw=False, **operation_config): - """Forecast the usage data for department. - - :param billing_account_id: BillingAccount ID - :type billing_account_id: str - :param department_id: Department ID - :type department_id: str - :param parameters: Parameters supplied to the CreateOrUpdate Report - Config operation. - :type parameters: - ~azure.mgmt.costmanagement.models.ReportConfigDefinition - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Query - :rtype: - ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.usage_by_department.metadata['url'] - path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), - 'departmentId': self._serialize.url("department_id", department_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ReportConfigDefinition') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - usage_by_department.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}/providers/Microsoft.CostManagement/Forecast'} - - def usage_by_managment_group( - self, management_group_id, parameters, custom_headers=None, raw=False, **operation_config): - """Lists the usage data for management group. - - :param management_group_id: ManagementGroup ID - :type management_group_id: str - :param parameters: Parameters supplied to the CreateOrUpdate Report - Config operation. - :type parameters: - ~azure.mgmt.costmanagement.models.ReportConfigDefinition - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Query - :rtype: - ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.usage_by_managment_group.metadata['url'] - path_format_arguments = { - 'managementGroupId': self._serialize.url("management_group_id", management_group_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ReportConfigDefinition') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - usage_by_managment_group.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.CostManagement/Forecast'} diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/operations.py index 13ec9cafe5f1..ab1bdbe26fc0 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/operations.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/operations.py @@ -22,7 +22,7 @@ class Operations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2019-03-01-preview. Constant value: "2019-03-01-preview". + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-05-31. Constant value: "2019-01-01". """ models = models @@ -32,13 +32,13 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-03-01-preview" + self.api_version = "2019-01-01" self.config = config def list( self, custom_headers=None, raw=False, **operation_config): - """Lists all of the available consumption REST API operations. + """Lists all of the available cost management REST API operations. :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/query_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/query_operations.py index 1591a2381db5..e08c773557ab 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/query_operations.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/query_operations.py @@ -22,7 +22,7 @@ class QueryOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2019-03-01-preview. Constant value: "2019-03-01-preview". + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-05-31. Constant value: "2019-01-01". """ models = models @@ -32,390 +32,31 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-03-01-preview" + self.api_version = "2019-01-01" self.config = config - def usage_by_subscription( - self, parameters, custom_headers=None, raw=False, **operation_config): - """Query the usage data for subscriptionId. - - :param parameters: Parameters supplied to the CreateOrUpdate Report - Config operation. - :type parameters: - ~azure.mgmt.costmanagement.models.ReportConfigDefinition - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Query - :rtype: - ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.usage_by_subscription.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ReportConfigDefinition') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - usage_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CostManagement/Query'} - - def usage_by_resource_group( - self, resource_group_name, parameters, custom_headers=None, raw=False, **operation_config): - """Query the usage data for subscriptionId and resource group. - - :param resource_group_name: Azure Resource Group Name. - :type resource_group_name: str - :param parameters: Parameters supplied to the CreateOrUpdate Report - Config operation. - :type parameters: - ~azure.mgmt.costmanagement.models.ReportConfigDefinition - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Query - :rtype: - ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.usage_by_resource_group.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ReportConfigDefinition') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - usage_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.CostManagement/Query'} - - def usage_by_billing_account( - self, billing_account_id, parameters, custom_headers=None, raw=False, **operation_config): - """Query the usage data for billing account. - - :param billing_account_id: BillingAccount ID - :type billing_account_id: str - :param parameters: Parameters supplied to the CreateOrUpdate Report - Config operation. - :type parameters: - ~azure.mgmt.costmanagement.models.ReportConfigDefinition - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Query - :rtype: - ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.usage_by_billing_account.metadata['url'] - path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ReportConfigDefinition') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - usage_by_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/Query'} - - def usage_by_enrollment_account( - self, billing_account_id, enrollment_account_id, parameters, custom_headers=None, raw=False, **operation_config): - """Query the usage data for an enrollment account. - - :param billing_account_id: BillingAccount ID - :type billing_account_id: str - :param enrollment_account_id: Enrollment Account ID - :type enrollment_account_id: str - :param parameters: Parameters supplied to the CreateOrUpdate Report - Config operation. - :type parameters: - ~azure.mgmt.costmanagement.models.ReportConfigDefinition - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Query - :rtype: - ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.usage_by_enrollment_account.metadata['url'] - path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), - 'enrollmentAccountId': self._serialize.url("enrollment_account_id", enrollment_account_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ReportConfigDefinition') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - usage_by_enrollment_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}/providers/Microsoft.CostManagement/Query'} - - def usage_by_department( - self, billing_account_id, department_id, parameters, custom_headers=None, raw=False, **operation_config): - """Query the usage data for department. - - :param billing_account_id: BillingAccount ID - :type billing_account_id: str - :param department_id: Department ID - :type department_id: str - :param parameters: Parameters supplied to the CreateOrUpdate Report - Config operation. - :type parameters: - ~azure.mgmt.costmanagement.models.ReportConfigDefinition - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Query - :rtype: - ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.usage_by_department.metadata['url'] - path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), - 'departmentId': self._serialize.url("department_id", department_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ReportConfigDefinition') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - usage_by_department.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}/providers/Microsoft.CostManagement/Query'} - - def usage_by_managment_group( - self, management_group_id, parameters, custom_headers=None, raw=False, **operation_config): - """Lists the usage data for management group. - - :param management_group_id: ManagementGroup ID - :type management_group_id: str - :param parameters: Parameters supplied to the CreateOrUpdate Report + def usage_by_scope( + self, scope, parameters, custom_headers=None, raw=False, **operation_config): + """Query the usage data for scope defined. + + :param scope: The scope associated with query and export operations. + This includes '/subscriptions/{subscriptionId}/' for subscription + scope, + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' + for resourceGroup scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for + Billing Account scope and + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' + for Department scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + for EnrollmentAccount scope and + '/providers/Microsoft.Management/managementGroups/{managementGroupId} + for Management Group scope.. + :type scope: str + :param parameters: Parameters supplied to the CreateOrUpdate Query Config operation. - :type parameters: - ~azure.mgmt.costmanagement.models.ReportConfigDefinition + :type parameters: ~azure.mgmt.costmanagement.models.QueryDefinition :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -431,9 +72,9 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = self.usage_by_managment_group.metadata['url'] + url = self.usage_by_scope.metadata['url'] path_format_arguments = { - 'managementGroupId': self._serialize.url("management_group_id", management_group_id, 'str') + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) } url = self._client.format_url(url, **path_format_arguments) @@ -457,7 +98,7 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(parameters, 'ReportConfigDefinition') + body_content = self._serialize.body(parameters, 'QueryDefinition') # Construct and send request request = self._client.post(url, query_parameters, header_parameters, body_content) @@ -477,4 +118,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized - usage_by_managment_group.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.CostManagement/Query'} + usage_by_scope.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/query'}