diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/cost_management_client.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/cost_management_client.py index 1ac9432eb07e..7c6ed75c6e33 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/cost_management_client.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/cost_management_client.py @@ -13,12 +13,13 @@ from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION -from msrest.pipeline import ClientRawResponse -import uuid -from .operations.report_config_operations import ReportConfigOperations -from .operations.billing_account_dimensions_operations import BillingAccountDimensionsOperations -from .operations.subscription_dimensions_operations import SubscriptionDimensionsOperations -from .operations.resource_group_dimensions_operations import ResourceGroupDimensionsOperations +from .operations.dimensions_operations import DimensionsOperations +from .operations.query_operations import QueryOperations +from .operations.forecast_operations import ForecastOperations +from .operations.cloud_connector_operations import CloudConnectorOperations +from .operations.external_billing_account_operations import ExternalBillingAccountOperations +from .operations.external_subscription_operations import ExternalSubscriptionOperations +from .operations.entities_operations import EntitiesOperations from .operations.operations import Operations from . import models @@ -61,14 +62,20 @@ class CostManagementClient(SDKClient): :ivar config: Configuration for client. :vartype config: CostManagementClientConfiguration - :ivar report_config: ReportConfig operations - :vartype report_config: azure.mgmt.costmanagement.operations.ReportConfigOperations - :ivar billing_account_dimensions: BillingAccountDimensions operations - :vartype billing_account_dimensions: azure.mgmt.costmanagement.operations.BillingAccountDimensionsOperations - :ivar subscription_dimensions: SubscriptionDimensions operations - :vartype subscription_dimensions: azure.mgmt.costmanagement.operations.SubscriptionDimensionsOperations - :ivar resource_group_dimensions: ResourceGroupDimensions operations - :vartype resource_group_dimensions: azure.mgmt.costmanagement.operations.ResourceGroupDimensionsOperations + :ivar dimensions: Dimensions operations + :vartype dimensions: azure.mgmt.costmanagement.operations.DimensionsOperations + :ivar query: Query operations + :vartype query: azure.mgmt.costmanagement.operations.QueryOperations + :ivar forecast: Forecast operations + :vartype forecast: azure.mgmt.costmanagement.operations.ForecastOperations + :ivar cloud_connector: CloudConnector operations + :vartype cloud_connector: azure.mgmt.costmanagement.operations.CloudConnectorOperations + :ivar external_billing_account: ExternalBillingAccount operations + :vartype external_billing_account: azure.mgmt.costmanagement.operations.ExternalBillingAccountOperations + :ivar external_subscription: ExternalSubscription operations + :vartype external_subscription: azure.mgmt.costmanagement.operations.ExternalSubscriptionOperations + :ivar entities: Entities operations + :vartype entities: azure.mgmt.costmanagement.operations.EntitiesOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.costmanagement.operations.Operations @@ -87,235 +94,23 @@ def __init__( super(CostManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2018-05-31' + self.api_version = '2019-03-01-preview' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) - self.report_config = ReportConfigOperations( + self.dimensions = DimensionsOperations( self._client, self.config, self._serialize, self._deserialize) - self.billing_account_dimensions = BillingAccountDimensionsOperations( + self.query = QueryOperations( self._client, self.config, self._serialize, self._deserialize) - self.subscription_dimensions = SubscriptionDimensionsOperations( + self.forecast = ForecastOperations( self._client, self.config, self._serialize, self._deserialize) - self.resource_group_dimensions = ResourceGroupDimensionsOperations( + self.cloud_connector = CloudConnectorOperations( + self._client, self.config, self._serialize, self._deserialize) + self.external_billing_account = ExternalBillingAccountOperations( + self._client, self.config, self._serialize, self._deserialize) + self.external_subscription = ExternalSubscriptionOperations( + self._client, self.config, self._serialize, self._deserialize) + self.entities = EntitiesOperations( self._client, self.config, self._serialize, self._deserialize) self.operations = Operations( self._client, self.config, self._serialize, self._deserialize) - - def query_subscription( - self, parameters, custom_headers=None, raw=False, **operation_config): - """Lists the usage data for subscriptionId. - - :param parameters: Parameters supplied to the CreateOrUpdate Report - Config operation. - :type parameters: - ~azure.mgmt.costmanagement.models.ReportConfigDefinition - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Query - :rtype: - ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.query_subscription.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ReportConfigDefinition') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - query_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CostManagement/Query'} - - def query_resource_group( - self, resource_group_name, parameters, custom_headers=None, raw=False, **operation_config): - """Lists the usage data for subscriptionId and resource group. - - :param resource_group_name: Azure Resource Group Name. - :type resource_group_name: str - :param parameters: Parameters supplied to the CreateOrUpdate Report - Config operation. - :type parameters: - ~azure.mgmt.costmanagement.models.ReportConfigDefinition - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Query - :rtype: - ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.query_resource_group.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ReportConfigDefinition') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - query_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.CostManagement/Query'} - - def query_billing_account( - self, billing_account_id, parameters, custom_headers=None, raw=False, **operation_config): - """Lists the usage data for billing account. - - :param billing_account_id: BillingAccount ID - :type billing_account_id: str - :param parameters: Parameters supplied to the CreateOrUpdate Report - Config operation. - :type parameters: - ~azure.mgmt.costmanagement.models.ReportConfigDefinition - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Query - :rtype: - ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.query_billing_account.metadata['url'] - path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ReportConfigDefinition') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - query_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/Query'} diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py index 71b14053e1a6..7e3edca4af5e 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py @@ -10,93 +10,110 @@ # -------------------------------------------------------------------------- try: + from .error_base_py3 import ErrorBase from .error_details_py3 import ErrorDetails from .error_response_py3 import ErrorResponse, ErrorResponseException from .resource_py3 import Resource - from .report_config_recurrence_period_py3 import ReportConfigRecurrencePeriod - from .report_config_schedule_py3 import ReportConfigSchedule - from .report_config_delivery_destination_py3 import ReportConfigDeliveryDestination - from .report_config_delivery_info_py3 import ReportConfigDeliveryInfo from .report_config_time_period_py3 import ReportConfigTimePeriod from .report_config_dataset_configuration_py3 import ReportConfigDatasetConfiguration from .report_config_aggregation_py3 import ReportConfigAggregation from .report_config_grouping_py3 import ReportConfigGrouping + from .report_config_sorting_py3 import ReportConfigSorting from .report_config_comparison_expression_py3 import ReportConfigComparisonExpression from .report_config_filter_py3 import ReportConfigFilter from .report_config_dataset_py3 import ReportConfigDataset from .report_config_definition_py3 import ReportConfigDefinition - from .report_config_py3 import ReportConfig - from .report_config_list_result_py3 import ReportConfigListResult from .dimension_py3 import Dimension from .query_column_py3 import QueryColumn from .query_py3 import Query + from .connector_collection_error_info_py3 import ConnectorCollectionErrorInfo + from .connector_collection_info_py3 import ConnectorCollectionInfo + from .connector_definition_py3 import ConnectorDefinition + from .external_billing_account_definition_py3 import ExternalBillingAccountDefinition + from .external_subscription_definition_py3 import ExternalSubscriptionDefinition + from .entity_parent_group_info_py3 import EntityParentGroupInfo + from .entity_info_py3 import EntityInfo from .operation_display_py3 import OperationDisplay from .operation_py3 import Operation except (SyntaxError, ImportError): + from .error_base import ErrorBase from .error_details import ErrorDetails from .error_response import ErrorResponse, ErrorResponseException from .resource import Resource - from .report_config_recurrence_period import ReportConfigRecurrencePeriod - from .report_config_schedule import ReportConfigSchedule - from .report_config_delivery_destination import ReportConfigDeliveryDestination - from .report_config_delivery_info import ReportConfigDeliveryInfo from .report_config_time_period import ReportConfigTimePeriod from .report_config_dataset_configuration import ReportConfigDatasetConfiguration from .report_config_aggregation import ReportConfigAggregation from .report_config_grouping import ReportConfigGrouping + from .report_config_sorting import ReportConfigSorting from .report_config_comparison_expression import ReportConfigComparisonExpression from .report_config_filter import ReportConfigFilter from .report_config_dataset import ReportConfigDataset from .report_config_definition import ReportConfigDefinition - from .report_config import ReportConfig - from .report_config_list_result import ReportConfigListResult from .dimension import Dimension from .query_column import QueryColumn from .query import Query + from .connector_collection_error_info import ConnectorCollectionErrorInfo + from .connector_collection_info import ConnectorCollectionInfo + from .connector_definition import ConnectorDefinition + from .external_billing_account_definition import ExternalBillingAccountDefinition + from .external_subscription_definition import ExternalSubscriptionDefinition + from .entity_parent_group_info import EntityParentGroupInfo + from .entity_info import EntityInfo from .operation_display import OperationDisplay from .operation import Operation from .dimension_paged import DimensionPaged from .query_paged import QueryPaged +from .connector_definition_paged import ConnectorDefinitionPaged +from .external_billing_account_definition_paged import ExternalBillingAccountDefinitionPaged +from .external_subscription_definition_paged import ExternalSubscriptionDefinitionPaged +from .entity_info_paged import EntityInfoPaged from .operation_paged import OperationPaged from .cost_management_client_enums import ( - StatusType, - RecurrenceType, - FormatType, TimeframeType, GranularityType, ReportConfigColumnType, + OperatorType, + ConnectorStatus, + ConnectorBillingModel, ) __all__ = [ + 'ErrorBase', 'ErrorDetails', 'ErrorResponse', 'ErrorResponseException', 'Resource', - 'ReportConfigRecurrencePeriod', - 'ReportConfigSchedule', - 'ReportConfigDeliveryDestination', - 'ReportConfigDeliveryInfo', 'ReportConfigTimePeriod', 'ReportConfigDatasetConfiguration', 'ReportConfigAggregation', 'ReportConfigGrouping', + 'ReportConfigSorting', 'ReportConfigComparisonExpression', 'ReportConfigFilter', 'ReportConfigDataset', 'ReportConfigDefinition', - 'ReportConfig', - 'ReportConfigListResult', 'Dimension', 'QueryColumn', 'Query', + 'ConnectorCollectionErrorInfo', + 'ConnectorCollectionInfo', + 'ConnectorDefinition', + 'ExternalBillingAccountDefinition', + 'ExternalSubscriptionDefinition', + 'EntityParentGroupInfo', + 'EntityInfo', 'OperationDisplay', 'Operation', 'DimensionPaged', 'QueryPaged', + 'ConnectorDefinitionPaged', + 'ExternalBillingAccountDefinitionPaged', + 'ExternalSubscriptionDefinitionPaged', + 'EntityInfoPaged', 'OperationPaged', - 'StatusType', - 'RecurrenceType', - 'FormatType', 'TimeframeType', 'GranularityType', 'ReportConfigColumnType', + 'OperatorType', + 'ConnectorStatus', + 'ConnectorBillingModel', ] diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_error_info.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_error_info.py new file mode 100644 index 000000000000..74d4eb5288f1 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_error_info.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectorCollectionErrorInfo(Model): + """Details of any error encountered on last collection attempt. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar error_message: Detailed error message + :vartype error_message: str + :ivar error_inner_message: External Provider error message + :vartype error_inner_message: str + :ivar error_code: Short error code + :vartype error_code: str + :ivar error_start_time: Time the error started occurring (Last time error + occurred in lastChecked) + :vartype error_start_time: datetime + """ + + _validation = { + 'error_message': {'readonly': True}, + 'error_inner_message': {'readonly': True}, + 'error_code': {'readonly': True}, + 'error_start_time': {'readonly': True}, + } + + _attribute_map = { + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + 'error_inner_message': {'key': 'errorInnerMessage', 'type': 'str'}, + 'error_code': {'key': 'errorCode', 'type': 'str'}, + 'error_start_time': {'key': 'errorStartTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(ConnectorCollectionErrorInfo, self).__init__(**kwargs) + self.error_message = None + self.error_inner_message = None + self.error_code = None + self.error_start_time = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_error_info_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_error_info_py3.py new file mode 100644 index 000000000000..8d26ae24a8ca --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_error_info_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectorCollectionErrorInfo(Model): + """Details of any error encountered on last collection attempt. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar error_message: Detailed error message + :vartype error_message: str + :ivar error_inner_message: External Provider error message + :vartype error_inner_message: str + :ivar error_code: Short error code + :vartype error_code: str + :ivar error_start_time: Time the error started occurring (Last time error + occurred in lastChecked) + :vartype error_start_time: datetime + """ + + _validation = { + 'error_message': {'readonly': True}, + 'error_inner_message': {'readonly': True}, + 'error_code': {'readonly': True}, + 'error_start_time': {'readonly': True}, + } + + _attribute_map = { + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + 'error_inner_message': {'key': 'errorInnerMessage', 'type': 'str'}, + 'error_code': {'key': 'errorCode', 'type': 'str'}, + 'error_start_time': {'key': 'errorStartTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs) -> None: + super(ConnectorCollectionErrorInfo, self).__init__(**kwargs) + self.error_message = None + self.error_inner_message = None + self.error_code = None + self.error_start_time = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_info.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_info.py new file mode 100644 index 000000000000..ad4397017060 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_info.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectorCollectionInfo(Model): + """Collection and ingestion information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar last_checked: Last time the data acquisition process initiated + connecting to the external provider + :vartype last_checked: datetime + :ivar source_last_updated: Source timestamp of external data currently + available in Azure (eg AWS last processed CUR file timestamp) + :vartype source_last_updated: datetime + :ivar last_updated: Last time the external data was updated into Azure + :vartype last_updated: datetime + :param error: Error information of last collection + :type error: + ~azure.mgmt.costmanagement.models.ConnectorCollectionErrorInfo + """ + + _validation = { + 'last_checked': {'readonly': True}, + 'source_last_updated': {'readonly': True}, + 'last_updated': {'readonly': True}, + } + + _attribute_map = { + 'last_checked': {'key': 'lastChecked', 'type': 'iso-8601'}, + 'source_last_updated': {'key': 'sourceLastUpdated', 'type': 'iso-8601'}, + 'last_updated': {'key': 'lastUpdated', 'type': 'iso-8601'}, + 'error': {'key': 'error', 'type': 'ConnectorCollectionErrorInfo'}, + } + + def __init__(self, **kwargs): + super(ConnectorCollectionInfo, self).__init__(**kwargs) + self.last_checked = None + self.source_last_updated = None + self.last_updated = None + self.error = kwargs.get('error', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_info_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_info_py3.py new file mode 100644 index 000000000000..ce4cfe464f52 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_collection_info_py3.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectorCollectionInfo(Model): + """Collection and ingestion information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar last_checked: Last time the data acquisition process initiated + connecting to the external provider + :vartype last_checked: datetime + :ivar source_last_updated: Source timestamp of external data currently + available in Azure (eg AWS last processed CUR file timestamp) + :vartype source_last_updated: datetime + :ivar last_updated: Last time the external data was updated into Azure + :vartype last_updated: datetime + :param error: Error information of last collection + :type error: + ~azure.mgmt.costmanagement.models.ConnectorCollectionErrorInfo + """ + + _validation = { + 'last_checked': {'readonly': True}, + 'source_last_updated': {'readonly': True}, + 'last_updated': {'readonly': True}, + } + + _attribute_map = { + 'last_checked': {'key': 'lastChecked', 'type': 'iso-8601'}, + 'source_last_updated': {'key': 'sourceLastUpdated', 'type': 'iso-8601'}, + 'last_updated': {'key': 'lastUpdated', 'type': 'iso-8601'}, + 'error': {'key': 'error', 'type': 'ConnectorCollectionErrorInfo'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(ConnectorCollectionInfo, self).__init__(**kwargs) + self.last_checked = None + self.source_last_updated = None + self.last_updated = None + self.error = error diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_definition.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_definition.py new file mode 100644 index 000000000000..1c52fbbed1a0 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_definition.py @@ -0,0 +1,112 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectorDefinition(Model): + """The Connector model definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param kind: Connector kind (eg aws) + :type kind: str + :ivar id: Connector id + :vartype id: str + :ivar name: Connector name + :vartype name: str + :ivar type: Connector type + :vartype type: str + :param display_name: Connector DisplayName + :type display_name: str + :ivar provider_account_id: Connector providerAccountId (determined from + credentials) + :vartype provider_account_id: str + :param credentials_key: Credentials authentication key (eg AWS ARN) + :type credentials_key: str + :param credentials_secret: Credentials secret (eg AWS ExternalId) + :type credentials_secret: str + :param report_id: Identifying source report. (For AWS this is a CUR report + name, defined with Daily and with Resources) + :type report_id: str + :ivar created_on: Connector definition creation datetime + :vartype created_on: datetime + :ivar modified_on: Connector last modified datetime + :vartype modified_on: datetime + :param status: Connector status. Possible values include: 'active', + 'error', 'suspended' + :type status: str or ~azure.mgmt.costmanagement.models.ConnectorStatus + :param default_management_group_id: Default ManagementGroupId + :type default_management_group_id: str + :param subscription_id: Billing SubscriptionId + :type subscription_id: str + :param billing_model: Connector billing model. Possible values include: + 'trial', 'autoUpgrade', 'premium', 'expired' + :type billing_model: str or + ~azure.mgmt.costmanagement.models.ConnectorBillingModel + :ivar days_trial_remaining: Number of days remaining of trial + :vartype days_trial_remaining: int + :ivar collection_info: Collection information + :vartype collection_info: + ~azure.mgmt.costmanagement.models.ConnectorCollectionInfo + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provider_account_id': {'readonly': True}, + 'created_on': {'readonly': True}, + 'modified_on': {'readonly': True}, + 'days_trial_remaining': {'readonly': True}, + 'collection_info': {'readonly': True}, + } + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'provider_account_id': {'key': 'properties.providerAccountId', 'type': 'str'}, + 'credentials_key': {'key': 'properties.credentialsKey', 'type': 'str'}, + 'credentials_secret': {'key': 'properties.credentialsSecret', 'type': 'str'}, + 'report_id': {'key': 'properties.reportId', 'type': 'str'}, + 'created_on': {'key': 'properties.createdOn', 'type': 'iso-8601'}, + 'modified_on': {'key': 'properties.modifiedOn', 'type': 'iso-8601'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'default_management_group_id': {'key': 'properties.defaultManagementGroupId', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + 'billing_model': {'key': 'properties.billingModel', 'type': 'str'}, + 'days_trial_remaining': {'key': 'properties.daysTrialRemaining', 'type': 'int'}, + 'collection_info': {'key': 'properties.collectionInfo', 'type': 'ConnectorCollectionInfo'}, + } + + def __init__(self, **kwargs): + super(ConnectorDefinition, self).__init__(**kwargs) + self.kind = kwargs.get('kind', None) + self.id = None + self.name = None + self.type = None + self.display_name = kwargs.get('display_name', None) + self.provider_account_id = None + self.credentials_key = kwargs.get('credentials_key', None) + self.credentials_secret = kwargs.get('credentials_secret', None) + self.report_id = kwargs.get('report_id', None) + self.created_on = None + self.modified_on = None + self.status = kwargs.get('status', None) + self.default_management_group_id = kwargs.get('default_management_group_id', None) + self.subscription_id = kwargs.get('subscription_id', None) + self.billing_model = kwargs.get('billing_model', None) + self.days_trial_remaining = None + self.collection_info = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_definition_paged.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_definition_paged.py new file mode 100644 index 000000000000..23e223c92208 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_definition_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class ConnectorDefinitionPaged(Paged): + """ + A paging container for iterating over a list of :class:`ConnectorDefinition ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ConnectorDefinition]'} + } + + def __init__(self, *args, **kwargs): + + super(ConnectorDefinitionPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_definition_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_definition_py3.py new file mode 100644 index 000000000000..39c96d302e55 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/connector_definition_py3.py @@ -0,0 +1,112 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectorDefinition(Model): + """The Connector model definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param kind: Connector kind (eg aws) + :type kind: str + :ivar id: Connector id + :vartype id: str + :ivar name: Connector name + :vartype name: str + :ivar type: Connector type + :vartype type: str + :param display_name: Connector DisplayName + :type display_name: str + :ivar provider_account_id: Connector providerAccountId (determined from + credentials) + :vartype provider_account_id: str + :param credentials_key: Credentials authentication key (eg AWS ARN) + :type credentials_key: str + :param credentials_secret: Credentials secret (eg AWS ExternalId) + :type credentials_secret: str + :param report_id: Identifying source report. (For AWS this is a CUR report + name, defined with Daily and with Resources) + :type report_id: str + :ivar created_on: Connector definition creation datetime + :vartype created_on: datetime + :ivar modified_on: Connector last modified datetime + :vartype modified_on: datetime + :param status: Connector status. Possible values include: 'active', + 'error', 'suspended' + :type status: str or ~azure.mgmt.costmanagement.models.ConnectorStatus + :param default_management_group_id: Default ManagementGroupId + :type default_management_group_id: str + :param subscription_id: Billing SubscriptionId + :type subscription_id: str + :param billing_model: Connector billing model. Possible values include: + 'trial', 'autoUpgrade', 'premium', 'expired' + :type billing_model: str or + ~azure.mgmt.costmanagement.models.ConnectorBillingModel + :ivar days_trial_remaining: Number of days remaining of trial + :vartype days_trial_remaining: int + :ivar collection_info: Collection information + :vartype collection_info: + ~azure.mgmt.costmanagement.models.ConnectorCollectionInfo + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provider_account_id': {'readonly': True}, + 'created_on': {'readonly': True}, + 'modified_on': {'readonly': True}, + 'days_trial_remaining': {'readonly': True}, + 'collection_info': {'readonly': True}, + } + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'provider_account_id': {'key': 'properties.providerAccountId', 'type': 'str'}, + 'credentials_key': {'key': 'properties.credentialsKey', 'type': 'str'}, + 'credentials_secret': {'key': 'properties.credentialsSecret', 'type': 'str'}, + 'report_id': {'key': 'properties.reportId', 'type': 'str'}, + 'created_on': {'key': 'properties.createdOn', 'type': 'iso-8601'}, + 'modified_on': {'key': 'properties.modifiedOn', 'type': 'iso-8601'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'default_management_group_id': {'key': 'properties.defaultManagementGroupId', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + 'billing_model': {'key': 'properties.billingModel', 'type': 'str'}, + 'days_trial_remaining': {'key': 'properties.daysTrialRemaining', 'type': 'int'}, + 'collection_info': {'key': 'properties.collectionInfo', 'type': 'ConnectorCollectionInfo'}, + } + + def __init__(self, *, kind: str=None, display_name: str=None, credentials_key: str=None, credentials_secret: str=None, report_id: str=None, status=None, default_management_group_id: str=None, subscription_id: str=None, billing_model=None, **kwargs) -> None: + super(ConnectorDefinition, self).__init__(**kwargs) + self.kind = kind + self.id = None + self.name = None + self.type = None + self.display_name = display_name + self.provider_account_id = None + self.credentials_key = credentials_key + self.credentials_secret = credentials_secret + self.report_id = report_id + self.created_on = None + self.modified_on = None + self.status = status + self.default_management_group_id = default_management_group_id + self.subscription_id = subscription_id + self.billing_model = billing_model + self.days_trial_remaining = None + self.collection_info = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/cost_management_client_enums.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/cost_management_client_enums.py index 2cbcb89895ef..24088511f298 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/cost_management_client_enums.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/cost_management_client_enums.py @@ -12,39 +12,42 @@ from enum import Enum -class StatusType(str, Enum): +class TimeframeType(str, Enum): - active = "Active" - inactive = "Inactive" + week_to_date = "WeekToDate" + month_to_date = "MonthToDate" + year_to_date = "YearToDate" + custom = "Custom" -class RecurrenceType(str, Enum): +class GranularityType(str, Enum): daily = "Daily" - weekly = "Weekly" monthly = "Monthly" - annually = "Annually" -class FormatType(str, Enum): +class ReportConfigColumnType(str, Enum): - csv = "Csv" + tag = "Tag" + dimension = "Dimension" -class TimeframeType(str, Enum): +class OperatorType(str, Enum): - week_to_date = "WeekToDate" - month_to_date = "MonthToDate" - year_to_date = "YearToDate" - custom = "Custom" + in_enum = "In" + contains = "Contains" -class GranularityType(str, Enum): +class ConnectorStatus(str, Enum): - daily = "Daily" + active = "active" + error = "error" + suspended = "suspended" -class ReportConfigColumnType(str, Enum): +class ConnectorBillingModel(str, Enum): - tag = "Tag" - dimension = "Dimension" + trial = "trial" + auto_upgrade = "autoUpgrade" + premium = "premium" + expired = "expired" diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/dimension.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/dimension.py index 78b3834a8f90..8a54c783616d 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/dimension.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/dimension.py @@ -26,6 +26,12 @@ class Dimension(Resource): :vartype type: str :ivar tags: Resource tags. :vartype tags: dict[str, str] + :param description: + :type description: str + :param filter_enabled: + :type filter_enabled: bool + :param grouping_enabled: + :type grouping_enabled: bool :param data: :type data: list[str] :param total: @@ -52,6 +58,9 @@ class Dimension(Resource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'filter_enabled': {'key': 'properties.filterEnabled', 'type': 'bool'}, + 'grouping_enabled': {'key': 'properties.groupingEnabled', 'type': 'bool'}, 'data': {'key': 'properties.data', 'type': '[str]'}, 'total': {'key': 'properties.total', 'type': 'int'}, 'category': {'key': 'properties.category', 'type': 'str'}, @@ -62,6 +71,9 @@ class Dimension(Resource): def __init__(self, **kwargs): super(Dimension, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.filter_enabled = kwargs.get('filter_enabled', None) + self.grouping_enabled = kwargs.get('grouping_enabled', None) self.data = kwargs.get('data', None) self.total = kwargs.get('total', None) self.category = kwargs.get('category', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/dimension_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/dimension_py3.py index b1c8674f0194..ae7f8d7ca51f 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/dimension_py3.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/dimension_py3.py @@ -26,6 +26,12 @@ class Dimension(Resource): :vartype type: str :ivar tags: Resource tags. :vartype tags: dict[str, str] + :param description: + :type description: str + :param filter_enabled: + :type filter_enabled: bool + :param grouping_enabled: + :type grouping_enabled: bool :param data: :type data: list[str] :param total: @@ -52,6 +58,9 @@ class Dimension(Resource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'filter_enabled': {'key': 'properties.filterEnabled', 'type': 'bool'}, + 'grouping_enabled': {'key': 'properties.groupingEnabled', 'type': 'bool'}, 'data': {'key': 'properties.data', 'type': '[str]'}, 'total': {'key': 'properties.total', 'type': 'int'}, 'category': {'key': 'properties.category', 'type': 'str'}, @@ -60,8 +69,11 @@ class Dimension(Resource): 'next_link': {'key': 'properties.nextLink', 'type': 'str'}, } - def __init__(self, *, data=None, total: int=None, category: str=None, usage_start=None, usage_end=None, next_link: str=None, **kwargs) -> None: + def __init__(self, *, description: str=None, filter_enabled: bool=None, grouping_enabled: bool=None, data=None, total: int=None, category: str=None, usage_start=None, usage_end=None, next_link: str=None, **kwargs) -> None: super(Dimension, self).__init__(**kwargs) + self.description = description + self.filter_enabled = filter_enabled + self.grouping_enabled = grouping_enabled self.data = data self.total = total self.category = category diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_info.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_info.py new file mode 100644 index 000000000000..996a86f4e81d --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_info.py @@ -0,0 +1,102 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EntityInfo(Model): + """The entity. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The fully qualified ID for the entity. For example, + /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + :vartype id: str + :ivar type: The type of the resource. For example, + /providers/Microsoft.Management/managementGroups + :vartype type: str + :ivar name: The name of the entity. For example, + 00000000-0000-0000-0000-000000000000 + :vartype name: str + :ivar kind: The kind of the resource + :vartype kind: str + :param tenant_id: The AAD Tenant ID associated with the entity. For + example, 00000000-0000-0000-0000-000000000000 + :type tenant_id: str + :param display_name: The friendly name of the management group. + :type display_name: str + :param parent: Parent. + :type parent: ~azure.mgmt.costmanagement.models.EntityParentGroupInfo + :param permissions: Permissions. Possible values include: 'noaccess', + 'view', 'edit', 'delete' + :type permissions: str or ~azure.mgmt.costmanagement.models.enum + :param inherited_permissions: Inherited Permissions. Possible values + include: 'noaccess', 'view', 'edit', 'delete' + :type inherited_permissions: str or ~azure.mgmt.costmanagement.models.enum + :param number_of_descendants: Number of Descendants. + :type number_of_descendants: int + :param number_of_children: Number of Children. Number of children is the + number of Groups and Subscriptions that are exactly one level underneath + the current Group. + :type number_of_children: int + :param number_of_child_groups: Number of Child Groups. Number of child + groups is the number of Groups that are exactly one level underneath the + current Group. + :type number_of_child_groups: int + :param parent_display_name_chain: The parent display name chain from the + root group to the immediate parent + :type parent_display_name_chain: list[str] + :param parent_name_chain: The parent name chain from the root group to the + immediate parent + :type parent_name_chain: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'parent': {'key': 'properties.parent', 'type': 'EntityParentGroupInfo'}, + 'permissions': {'key': 'properties.permissions', 'type': 'str'}, + 'inherited_permissions': {'key': 'properties.inheritedPermissions', 'type': 'str'}, + 'number_of_descendants': {'key': 'properties.numberOfDescendants', 'type': 'int'}, + 'number_of_children': {'key': 'properties.numberOfChildren', 'type': 'int'}, + 'number_of_child_groups': {'key': 'properties.numberOfChildGroups', 'type': 'int'}, + 'parent_display_name_chain': {'key': 'properties.parentDisplayNameChain', 'type': '[str]'}, + 'parent_name_chain': {'key': 'properties.parentNameChain', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(EntityInfo, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.kind = None + self.tenant_id = kwargs.get('tenant_id', None) + self.display_name = kwargs.get('display_name', None) + self.parent = kwargs.get('parent', None) + self.permissions = kwargs.get('permissions', None) + self.inherited_permissions = kwargs.get('inherited_permissions', None) + self.number_of_descendants = kwargs.get('number_of_descendants', None) + self.number_of_children = kwargs.get('number_of_children', None) + self.number_of_child_groups = kwargs.get('number_of_child_groups', None) + self.parent_display_name_chain = kwargs.get('parent_display_name_chain', None) + self.parent_name_chain = kwargs.get('parent_name_chain', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_info_paged.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_info_paged.py new file mode 100644 index 000000000000..d7a741cef532 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_info_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class EntityInfoPaged(Paged): + """ + A paging container for iterating over a list of :class:`EntityInfo ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[EntityInfo]'} + } + + def __init__(self, *args, **kwargs): + + super(EntityInfoPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_info_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_info_py3.py new file mode 100644 index 000000000000..7f44120d0fd9 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_info_py3.py @@ -0,0 +1,102 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EntityInfo(Model): + """The entity. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The fully qualified ID for the entity. For example, + /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + :vartype id: str + :ivar type: The type of the resource. For example, + /providers/Microsoft.Management/managementGroups + :vartype type: str + :ivar name: The name of the entity. For example, + 00000000-0000-0000-0000-000000000000 + :vartype name: str + :ivar kind: The kind of the resource + :vartype kind: str + :param tenant_id: The AAD Tenant ID associated with the entity. For + example, 00000000-0000-0000-0000-000000000000 + :type tenant_id: str + :param display_name: The friendly name of the management group. + :type display_name: str + :param parent: Parent. + :type parent: ~azure.mgmt.costmanagement.models.EntityParentGroupInfo + :param permissions: Permissions. Possible values include: 'noaccess', + 'view', 'edit', 'delete' + :type permissions: str or ~azure.mgmt.costmanagement.models.enum + :param inherited_permissions: Inherited Permissions. Possible values + include: 'noaccess', 'view', 'edit', 'delete' + :type inherited_permissions: str or ~azure.mgmt.costmanagement.models.enum + :param number_of_descendants: Number of Descendants. + :type number_of_descendants: int + :param number_of_children: Number of Children. Number of children is the + number of Groups and Subscriptions that are exactly one level underneath + the current Group. + :type number_of_children: int + :param number_of_child_groups: Number of Child Groups. Number of child + groups is the number of Groups that are exactly one level underneath the + current Group. + :type number_of_child_groups: int + :param parent_display_name_chain: The parent display name chain from the + root group to the immediate parent + :type parent_display_name_chain: list[str] + :param parent_name_chain: The parent name chain from the root group to the + immediate parent + :type parent_name_chain: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'parent': {'key': 'properties.parent', 'type': 'EntityParentGroupInfo'}, + 'permissions': {'key': 'properties.permissions', 'type': 'str'}, + 'inherited_permissions': {'key': 'properties.inheritedPermissions', 'type': 'str'}, + 'number_of_descendants': {'key': 'properties.numberOfDescendants', 'type': 'int'}, + 'number_of_children': {'key': 'properties.numberOfChildren', 'type': 'int'}, + 'number_of_child_groups': {'key': 'properties.numberOfChildGroups', 'type': 'int'}, + 'parent_display_name_chain': {'key': 'properties.parentDisplayNameChain', 'type': '[str]'}, + 'parent_name_chain': {'key': 'properties.parentNameChain', 'type': '[str]'}, + } + + def __init__(self, *, tenant_id: str=None, display_name: str=None, parent=None, permissions=None, inherited_permissions=None, number_of_descendants: int=None, number_of_children: int=None, number_of_child_groups: int=None, parent_display_name_chain=None, parent_name_chain=None, **kwargs) -> None: + super(EntityInfo, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.kind = None + self.tenant_id = tenant_id + self.display_name = display_name + self.parent = parent + self.permissions = permissions + self.inherited_permissions = inherited_permissions + self.number_of_descendants = number_of_descendants + self.number_of_children = number_of_children + self.number_of_child_groups = number_of_child_groups + self.parent_display_name_chain = parent_display_name_chain + self.parent_name_chain = parent_name_chain diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_list_result.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_parent_group_info.py similarity index 50% rename from azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_list_result.py rename to azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_parent_group_info.py index 9299cb815d0f..7e26dca6f12c 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_list_result.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_parent_group_info.py @@ -12,25 +12,19 @@ from msrest.serialization import Model -class ReportConfigListResult(Model): - """Result of listing report configs. It contains a list of available report - configurations in the scope provided. +class EntityParentGroupInfo(Model): + """(Optional) The ID of the parent management group. - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar value: The list of report configs. - :vartype value: list[~azure.mgmt.costmanagement.models.ReportConfig] + :param id: The fully qualified ID for the parent management group. For + example, + /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + :type id: str """ - _validation = { - 'value': {'readonly': True}, - } - _attribute_map = { - 'value': {'key': 'value', 'type': '[ReportConfig]'}, + 'id': {'key': 'id', 'type': 'str'}, } def __init__(self, **kwargs): - super(ReportConfigListResult, self).__init__(**kwargs) - self.value = None + super(EntityParentGroupInfo, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_parent_group_info_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_parent_group_info_py3.py new file mode 100644 index 000000000000..b0275df6a41f --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/entity_parent_group_info_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EntityParentGroupInfo(Model): + """(Optional) The ID of the parent management group. + + :param id: The fully qualified ID for the parent management group. For + example, + /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(EntityParentGroupInfo, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_base.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_base.py new file mode 100644 index 000000000000..06850f19f08c --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_base.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ErrorBase(Model): + """The details of the error. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: A machine readable error code. + :vartype code: str + :ivar message: A human readable error message. + :vartype message: str + :ivar target: Indicates which property in the request is responsible for + the error. + :vartype target: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ErrorBase, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_list_result_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_base_py3.py similarity index 50% rename from azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_list_result_py3.py rename to azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_base_py3.py index f8811e6328d5..ce93c67b953b 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_list_result_py3.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_base_py3.py @@ -12,25 +12,35 @@ from msrest.serialization import Model -class ReportConfigListResult(Model): - """Result of listing report configs. It contains a list of available report - configurations in the scope provided. +class ErrorBase(Model): + """The details of the error. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: The list of report configs. - :vartype value: list[~azure.mgmt.costmanagement.models.ReportConfig] + :ivar code: A machine readable error code. + :vartype code: str + :ivar message: A human readable error message. + :vartype message: str + :ivar target: Indicates which property in the request is responsible for + the error. + :vartype target: str """ _validation = { - 'value': {'readonly': True}, + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[ReportConfig]'}, + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, } def __init__(self, **kwargs) -> None: - super(ReportConfigListResult, self).__init__(**kwargs) - self.value = None + super(ErrorBase, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details.py index 03f3e23d2153..0c5831e7ee91 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details.py @@ -18,10 +18,15 @@ class ErrorDetails(Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar code: Error code. + :ivar code: A machine readable error code. :vartype code: str - :ivar message: Error message indicating why the operation failed. + :ivar message: A human readable error message. :vartype message: str + :param target: Indicates which property in the request is responsible for + the error. + :type target: str + :param details: error details. + :type details: list[~azure.mgmt.costmanagement.models.ErrorBase] """ _validation = { @@ -32,9 +37,13 @@ class ErrorDetails(Model): _attribute_map = { 'code': {'key': 'code', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorBase]'}, } def __init__(self, **kwargs): super(ErrorDetails, self).__init__(**kwargs) self.code = None self.message = None + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details_py3.py index f9e1adeac9fe..3d4a63c6ab50 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details_py3.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/error_details_py3.py @@ -18,10 +18,15 @@ class ErrorDetails(Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar code: Error code. + :ivar code: A machine readable error code. :vartype code: str - :ivar message: Error message indicating why the operation failed. + :ivar message: A human readable error message. :vartype message: str + :param target: Indicates which property in the request is responsible for + the error. + :type target: str + :param details: error details. + :type details: list[~azure.mgmt.costmanagement.models.ErrorBase] """ _validation = { @@ -32,9 +37,13 @@ class ErrorDetails(Model): _attribute_map = { 'code': {'key': 'code', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorBase]'}, } - def __init__(self, **kwargs) -> None: + def __init__(self, *, target: str=None, details=None, **kwargs) -> None: super(ErrorDetails, self).__init__(**kwargs) self.code = None self.message = None + self.target = target + self.details = details diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_billing_account_definition.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_billing_account_definition.py new file mode 100644 index 000000000000..5d18ffc55489 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_billing_account_definition.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExternalBillingAccountDefinition(Model): + """The ExternalBillingAccount model definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: ExternalBillingAccount id + :vartype id: str + :ivar name: ExternalBillingAccount name + :vartype name: str + :ivar type: ExternalBillingAccount type + :vartype type: str + :ivar kind: ExternalBillingAccount kind (eg aws) + :vartype kind: str + :ivar display_name: ExternalBillingAccount DisplayName + :vartype display_name: str + :ivar connector_id: Underlying ConnectorId + :vartype connector_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'readonly': True}, + 'display_name': {'readonly': True}, + 'connector_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'connector_id': {'key': 'properties.connectorId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ExternalBillingAccountDefinition, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.kind = None + self.display_name = None + self.connector_id = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_billing_account_definition_paged.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_billing_account_definition_paged.py new file mode 100644 index 000000000000..ecb1d48256b3 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_billing_account_definition_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class ExternalBillingAccountDefinitionPaged(Paged): + """ + A paging container for iterating over a list of :class:`ExternalBillingAccountDefinition ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ExternalBillingAccountDefinition]'} + } + + def __init__(self, *args, **kwargs): + + super(ExternalBillingAccountDefinitionPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_billing_account_definition_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_billing_account_definition_py3.py new file mode 100644 index 000000000000..7d1a93a5b22b --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_billing_account_definition_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExternalBillingAccountDefinition(Model): + """The ExternalBillingAccount model definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: ExternalBillingAccount id + :vartype id: str + :ivar name: ExternalBillingAccount name + :vartype name: str + :ivar type: ExternalBillingAccount type + :vartype type: str + :ivar kind: ExternalBillingAccount kind (eg aws) + :vartype kind: str + :ivar display_name: ExternalBillingAccount DisplayName + :vartype display_name: str + :ivar connector_id: Underlying ConnectorId + :vartype connector_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'readonly': True}, + 'display_name': {'readonly': True}, + 'connector_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'connector_id': {'key': 'properties.connectorId', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ExternalBillingAccountDefinition, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.kind = None + self.display_name = None + self.connector_id = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_subscription_definition.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_subscription_definition.py new file mode 100644 index 000000000000..b76ef94e4e4c --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_subscription_definition.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExternalSubscriptionDefinition(Model): + """The ExternalSubscription model definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: ExternalSubscription id + :vartype id: str + :ivar name: ExternalSubscription name + :vartype name: str + :ivar type: ExternalSubscription type + :vartype type: str + :ivar kind: ExternalSubscription kind (eg aws) + :vartype kind: str + :ivar display_name: ExternalSubscription DisplayName + :vartype display_name: str + :ivar management_group_id: Assigned ManagementGroupId + :vartype management_group_id: str + :ivar external_billing_account_id: Parent ExternalBillingAccountId + :vartype external_billing_account_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'readonly': True}, + 'display_name': {'readonly': True}, + 'management_group_id': {'readonly': True}, + 'external_billing_account_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'management_group_id': {'key': 'properties.managementGroupId', 'type': 'str'}, + 'external_billing_account_id': {'key': 'properties.externalBillingAccountId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ExternalSubscriptionDefinition, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.kind = None + self.display_name = None + self.management_group_id = None + self.external_billing_account_id = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_subscription_definition_paged.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_subscription_definition_paged.py new file mode 100644 index 000000000000..f137ed1927ec --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_subscription_definition_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class ExternalSubscriptionDefinitionPaged(Paged): + """ + A paging container for iterating over a list of :class:`ExternalSubscriptionDefinition ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ExternalSubscriptionDefinition]'} + } + + def __init__(self, *args, **kwargs): + + super(ExternalSubscriptionDefinitionPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_subscription_definition_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_subscription_definition_py3.py new file mode 100644 index 000000000000..5fa8fc479604 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/external_subscription_definition_py3.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExternalSubscriptionDefinition(Model): + """The ExternalSubscription model definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: ExternalSubscription id + :vartype id: str + :ivar name: ExternalSubscription name + :vartype name: str + :ivar type: ExternalSubscription type + :vartype type: str + :ivar kind: ExternalSubscription kind (eg aws) + :vartype kind: str + :ivar display_name: ExternalSubscription DisplayName + :vartype display_name: str + :ivar management_group_id: Assigned ManagementGroupId + :vartype management_group_id: str + :ivar external_billing_account_id: Parent ExternalBillingAccountId + :vartype external_billing_account_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'readonly': True}, + 'display_name': {'readonly': True}, + 'management_group_id': {'readonly': True}, + 'external_billing_account_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'management_group_id': {'key': 'properties.managementGroupId', 'type': 'str'}, + 'external_billing_account_id': {'key': 'properties.externalBillingAccountId', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ExternalSubscriptionDefinition, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.kind = None + self.display_name = None + self.management_group_id = None + self.external_billing_account_id = None diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config.py deleted file mode 100644 index 44e2cdde8778..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config.py +++ /dev/null @@ -1,69 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource import Resource - - -class ReportConfig(Resource): - """A report config resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :param schedule: Has schedule information for the report config. - :type schedule: ~azure.mgmt.costmanagement.models.ReportConfigSchedule - :param format: The format of the report being delivered. Possible values - include: 'Csv' - :type format: str or ~azure.mgmt.costmanagement.models.FormatType - :param delivery_info: Required. Has delivery information for the report - config. - :type delivery_info: - ~azure.mgmt.costmanagement.models.ReportConfigDeliveryInfo - :param definition: Required. Has definition for the report config. - :type definition: ~azure.mgmt.costmanagement.models.ReportConfigDefinition - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'tags': {'readonly': True}, - 'delivery_info': {'required': True}, - 'definition': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'schedule': {'key': 'properties.schedule', 'type': 'ReportConfigSchedule'}, - 'format': {'key': 'properties.format', 'type': 'str'}, - 'delivery_info': {'key': 'properties.deliveryInfo', 'type': 'ReportConfigDeliveryInfo'}, - 'definition': {'key': 'properties.definition', 'type': 'ReportConfigDefinition'}, - } - - def __init__(self, **kwargs): - super(ReportConfig, self).__init__(**kwargs) - self.schedule = kwargs.get('schedule', None) - self.format = kwargs.get('format', None) - self.delivery_info = kwargs.get('delivery_info', None) - self.definition = kwargs.get('definition', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_comparison_expression.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_comparison_expression.py index f83b560bfdb6..1969db241c17 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_comparison_expression.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_comparison_expression.py @@ -15,23 +15,20 @@ class ReportConfigComparisonExpression(Model): """The comparison expression to be used in the report. - Variables are only populated by the server, and will be ignored when - sending a request. - All required parameters must be populated in order to send to Azure. :param name: Required. The name of the column to use in comparison. :type name: str - :ivar operator: Required. The operator to use for comparison. Default - value: "In" . - :vartype operator: str + :param operator: Required. The operator to use for comparison. Possible + values include: 'In', 'Contains' + :type operator: str or ~azure.mgmt.costmanagement.models.OperatorType :param values: Required. Array of values to use for comparison :type values: list[str] """ _validation = { 'name': {'required': True}, - 'operator': {'required': True, 'constant': True}, + 'operator': {'required': True}, 'values': {'required': True, 'min_items': 1}, } @@ -41,9 +38,8 @@ class ReportConfigComparisonExpression(Model): 'values': {'key': 'values', 'type': '[str]'}, } - operator = "In" - def __init__(self, **kwargs): super(ReportConfigComparisonExpression, self).__init__(**kwargs) self.name = kwargs.get('name', None) + self.operator = kwargs.get('operator', None) self.values = kwargs.get('values', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_comparison_expression_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_comparison_expression_py3.py index efdeb11ba56d..27dc0cdc1ea7 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_comparison_expression_py3.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_comparison_expression_py3.py @@ -15,23 +15,20 @@ class ReportConfigComparisonExpression(Model): """The comparison expression to be used in the report. - Variables are only populated by the server, and will be ignored when - sending a request. - All required parameters must be populated in order to send to Azure. :param name: Required. The name of the column to use in comparison. :type name: str - :ivar operator: Required. The operator to use for comparison. Default - value: "In" . - :vartype operator: str + :param operator: Required. The operator to use for comparison. Possible + values include: 'In', 'Contains' + :type operator: str or ~azure.mgmt.costmanagement.models.OperatorType :param values: Required. Array of values to use for comparison :type values: list[str] """ _validation = { 'name': {'required': True}, - 'operator': {'required': True, 'constant': True}, + 'operator': {'required': True}, 'values': {'required': True, 'min_items': 1}, } @@ -41,9 +38,8 @@ class ReportConfigComparisonExpression(Model): 'values': {'key': 'values', 'type': '[str]'}, } - operator = "In" - - def __init__(self, *, name: str, values, **kwargs) -> None: + def __init__(self, *, name: str, operator, values, **kwargs) -> None: super(ReportConfigComparisonExpression, self).__init__(**kwargs) self.name = name + self.operator = operator self.values = values diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset.py index 379de034502a..c65641a3008c 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset.py @@ -16,7 +16,7 @@ class ReportConfigDataset(Model): """The definition of data present in the report. :param granularity: The granularity of rows in the report. Possible values - include: 'Daily' + include: 'Daily', 'Monthly' :type granularity: str or ~azure.mgmt.costmanagement.models.GranularityType :param configuration: Has configuration information for the data in the @@ -33,6 +33,8 @@ class ReportConfigDataset(Model): can have up to 2 group by clauses. :type grouping: list[~azure.mgmt.costmanagement.models.ReportConfigGrouping] + :param sorting: Array of order by expression to use in the report. + :type sorting: list[~azure.mgmt.costmanagement.models.ReportConfigSorting] :param filter: Has filter expression to use in the report. :type filter: ~azure.mgmt.costmanagement.models.ReportConfigFilter """ @@ -46,6 +48,7 @@ class ReportConfigDataset(Model): 'configuration': {'key': 'configuration', 'type': 'ReportConfigDatasetConfiguration'}, 'aggregation': {'key': 'aggregation', 'type': '{ReportConfigAggregation}'}, 'grouping': {'key': 'grouping', 'type': '[ReportConfigGrouping]'}, + 'sorting': {'key': 'sorting', 'type': '[ReportConfigSorting]'}, 'filter': {'key': 'filter', 'type': 'ReportConfigFilter'}, } @@ -55,4 +58,5 @@ def __init__(self, **kwargs): self.configuration = kwargs.get('configuration', None) self.aggregation = kwargs.get('aggregation', None) self.grouping = kwargs.get('grouping', None) + self.sorting = kwargs.get('sorting', None) self.filter = kwargs.get('filter', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset_py3.py index 7ccb79537f8b..1f263ac3f3b4 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset_py3.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_dataset_py3.py @@ -16,7 +16,7 @@ class ReportConfigDataset(Model): """The definition of data present in the report. :param granularity: The granularity of rows in the report. Possible values - include: 'Daily' + include: 'Daily', 'Monthly' :type granularity: str or ~azure.mgmt.costmanagement.models.GranularityType :param configuration: Has configuration information for the data in the @@ -33,6 +33,8 @@ class ReportConfigDataset(Model): can have up to 2 group by clauses. :type grouping: list[~azure.mgmt.costmanagement.models.ReportConfigGrouping] + :param sorting: Array of order by expression to use in the report. + :type sorting: list[~azure.mgmt.costmanagement.models.ReportConfigSorting] :param filter: Has filter expression to use in the report. :type filter: ~azure.mgmt.costmanagement.models.ReportConfigFilter """ @@ -46,13 +48,15 @@ class ReportConfigDataset(Model): 'configuration': {'key': 'configuration', 'type': 'ReportConfigDatasetConfiguration'}, 'aggregation': {'key': 'aggregation', 'type': '{ReportConfigAggregation}'}, 'grouping': {'key': 'grouping', 'type': '[ReportConfigGrouping]'}, + 'sorting': {'key': 'sorting', 'type': '[ReportConfigSorting]'}, 'filter': {'key': 'filter', 'type': 'ReportConfigFilter'}, } - def __init__(self, *, granularity=None, configuration=None, aggregation=None, grouping=None, filter=None, **kwargs) -> None: + def __init__(self, *, granularity=None, configuration=None, aggregation=None, grouping=None, sorting=None, filter=None, **kwargs) -> None: super(ReportConfigDataset, self).__init__(**kwargs) self.granularity = granularity self.configuration = configuration self.aggregation = aggregation self.grouping = grouping + self.sorting = sorting self.filter = filter diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_definition.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_definition.py index bd45fb4bbf5b..ab46d7172b0d 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_definition.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_definition.py @@ -20,7 +20,10 @@ class ReportConfigDefinition(Model): All required parameters must be populated in order to send to Azure. - :ivar type: Required. The type of the report. Default value: "Usage" . + :ivar type: Required. The type of the report. Usage represents actual + usage, forecast represents forecasted data and UsageAndForecast represents + both usage and forecasted data. Actual usage and forecasted data can be + differentiated based on dates. Default value: "Usage" . :vartype type: str :param timeframe: Required. The time frame for pulling data for the report. If custom, then a specific time period must be provided. Possible diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_definition_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_definition_py3.py index 74f4a5df6e0d..4a03fa138934 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_definition_py3.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_definition_py3.py @@ -20,7 +20,10 @@ class ReportConfigDefinition(Model): All required parameters must be populated in order to send to Azure. - :ivar type: Required. The type of the report. Default value: "Usage" . + :ivar type: Required. The type of the report. Usage represents actual + usage, forecast represents forecasted data and UsageAndForecast represents + both usage and forecasted data. Actual usage and forecasted data can be + differentiated based on dates. Default value: "Usage" . :vartype type: str :param timeframe: Required. The time frame for pulling data for the report. If custom, then a specific time period must be provided. Possible diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_delivery_destination.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_delivery_destination.py deleted file mode 100644 index e4fc2853a093..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_delivery_destination.py +++ /dev/null @@ -1,46 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ReportConfigDeliveryDestination(Model): - """The destination information for the delivery of the report. - - All required parameters must be populated in order to send to Azure. - - :param resource_id: Required. The resource id of the storage account where - reports will be delivered. - :type resource_id: str - :param container: Required. The name of the container where reports will - be uploaded. - :type container: str - :param root_folder_path: The name of the directory where reports will be - uploaded. - :type root_folder_path: str - """ - - _validation = { - 'resource_id': {'required': True}, - 'container': {'required': True}, - } - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'container': {'key': 'container', 'type': 'str'}, - 'root_folder_path': {'key': 'rootFolderPath', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ReportConfigDeliveryDestination, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.container = kwargs.get('container', None) - self.root_folder_path = kwargs.get('root_folder_path', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_delivery_destination_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_delivery_destination_py3.py deleted file mode 100644 index 1e9bf4499672..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_delivery_destination_py3.py +++ /dev/null @@ -1,46 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ReportConfigDeliveryDestination(Model): - """The destination information for the delivery of the report. - - All required parameters must be populated in order to send to Azure. - - :param resource_id: Required. The resource id of the storage account where - reports will be delivered. - :type resource_id: str - :param container: Required. The name of the container where reports will - be uploaded. - :type container: str - :param root_folder_path: The name of the directory where reports will be - uploaded. - :type root_folder_path: str - """ - - _validation = { - 'resource_id': {'required': True}, - 'container': {'required': True}, - } - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'container': {'key': 'container', 'type': 'str'}, - 'root_folder_path': {'key': 'rootFolderPath', 'type': 'str'}, - } - - def __init__(self, *, resource_id: str, container: str, root_folder_path: str=None, **kwargs) -> None: - super(ReportConfigDeliveryDestination, self).__init__(**kwargs) - self.resource_id = resource_id - self.container = container - self.root_folder_path = root_folder_path diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_delivery_info_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_delivery_info_py3.py deleted file mode 100644 index 22b90721c3f0..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_delivery_info_py3.py +++ /dev/null @@ -1,36 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ReportConfigDeliveryInfo(Model): - """The delivery information associated with a report config. - - All required parameters must be populated in order to send to Azure. - - :param destination: Required. Has destination for the report being - delivered. - :type destination: - ~azure.mgmt.costmanagement.models.ReportConfigDeliveryDestination - """ - - _validation = { - 'destination': {'required': True}, - } - - _attribute_map = { - 'destination': {'key': 'destination', 'type': 'ReportConfigDeliveryDestination'}, - } - - def __init__(self, *, destination, **kwargs) -> None: - super(ReportConfigDeliveryInfo, self).__init__(**kwargs) - self.destination = destination diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_grouping.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_grouping.py index 1396ac74d1c0..09ca40f3cda5 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_grouping.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_grouping.py @@ -17,25 +17,26 @@ class ReportConfigGrouping(Model): All required parameters must be populated in order to send to Azure. - :param column_type: Required. Has type of the column to group. Possible - values include: 'Tag', 'Dimension' - :type column_type: str or + :param type: Required. Has type of the column to group. Possible values + include: 'Tag', 'Dimension' + :type type: str or ~azure.mgmt.costmanagement.models.ReportConfigColumnType - :param name: Required. The name of the column to group. + :param name: Required. The name of the column to group. This version + supports subscription lowest possible grain. :type name: str """ _validation = { - 'column_type': {'required': True}, + 'type': {'required': True}, 'name': {'required': True}, } _attribute_map = { - 'column_type': {'key': 'columnType', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, } def __init__(self, **kwargs): super(ReportConfigGrouping, self).__init__(**kwargs) - self.column_type = kwargs.get('column_type', None) + self.type = kwargs.get('type', None) self.name = kwargs.get('name', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_grouping_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_grouping_py3.py index e40f57c8e869..317bcf8f3d24 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_grouping_py3.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_grouping_py3.py @@ -17,25 +17,26 @@ class ReportConfigGrouping(Model): All required parameters must be populated in order to send to Azure. - :param column_type: Required. Has type of the column to group. Possible - values include: 'Tag', 'Dimension' - :type column_type: str or + :param type: Required. Has type of the column to group. Possible values + include: 'Tag', 'Dimension' + :type type: str or ~azure.mgmt.costmanagement.models.ReportConfigColumnType - :param name: Required. The name of the column to group. + :param name: Required. The name of the column to group. This version + supports subscription lowest possible grain. :type name: str """ _validation = { - 'column_type': {'required': True}, + 'type': {'required': True}, 'name': {'required': True}, } _attribute_map = { - 'column_type': {'key': 'columnType', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, *, column_type, name: str, **kwargs) -> None: + def __init__(self, *, type, name: str, **kwargs) -> None: super(ReportConfigGrouping, self).__init__(**kwargs) - self.column_type = column_type + self.type = type self.name = name diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_py3.py deleted file mode 100644 index c505d604b545..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_py3.py +++ /dev/null @@ -1,69 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource_py3 import Resource - - -class ReportConfig(Resource): - """A report config resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :param schedule: Has schedule information for the report config. - :type schedule: ~azure.mgmt.costmanagement.models.ReportConfigSchedule - :param format: The format of the report being delivered. Possible values - include: 'Csv' - :type format: str or ~azure.mgmt.costmanagement.models.FormatType - :param delivery_info: Required. Has delivery information for the report - config. - :type delivery_info: - ~azure.mgmt.costmanagement.models.ReportConfigDeliveryInfo - :param definition: Required. Has definition for the report config. - :type definition: ~azure.mgmt.costmanagement.models.ReportConfigDefinition - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'tags': {'readonly': True}, - 'delivery_info': {'required': True}, - 'definition': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'schedule': {'key': 'properties.schedule', 'type': 'ReportConfigSchedule'}, - 'format': {'key': 'properties.format', 'type': 'str'}, - 'delivery_info': {'key': 'properties.deliveryInfo', 'type': 'ReportConfigDeliveryInfo'}, - 'definition': {'key': 'properties.definition', 'type': 'ReportConfigDefinition'}, - } - - def __init__(self, *, delivery_info, definition, schedule=None, format=None, **kwargs) -> None: - super(ReportConfig, self).__init__(**kwargs) - self.schedule = schedule - self.format = format - self.delivery_info = delivery_info - self.definition = definition diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_recurrence_period.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_recurrence_period.py deleted file mode 100644 index 43ec79a04d79..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_recurrence_period.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ReportConfigRecurrencePeriod(Model): - """The start and end date for recurrence schedule. - - All required parameters must be populated in order to send to Azure. - - :param from_property: Required. The start date of recurrence. - :type from_property: datetime - :param to: The end date of recurrence. If not provided, we default this to - 10 years from the start date. - :type to: datetime - """ - - _validation = { - 'from_property': {'required': True}, - } - - _attribute_map = { - 'from_property': {'key': 'from', 'type': 'iso-8601'}, - 'to': {'key': 'to', 'type': 'iso-8601'}, - } - - def __init__(self, **kwargs): - super(ReportConfigRecurrencePeriod, self).__init__(**kwargs) - self.from_property = kwargs.get('from_property', None) - self.to = kwargs.get('to', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_recurrence_period_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_recurrence_period_py3.py deleted file mode 100644 index fc6495614479..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_recurrence_period_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ReportConfigRecurrencePeriod(Model): - """The start and end date for recurrence schedule. - - All required parameters must be populated in order to send to Azure. - - :param from_property: Required. The start date of recurrence. - :type from_property: datetime - :param to: The end date of recurrence. If not provided, we default this to - 10 years from the start date. - :type to: datetime - """ - - _validation = { - 'from_property': {'required': True}, - } - - _attribute_map = { - 'from_property': {'key': 'from', 'type': 'iso-8601'}, - 'to': {'key': 'to', 'type': 'iso-8601'}, - } - - def __init__(self, *, from_property, to=None, **kwargs) -> None: - super(ReportConfigRecurrencePeriod, self).__init__(**kwargs) - self.from_property = from_property - self.to = to diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_schedule.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_schedule.py deleted file mode 100644 index 58ffe987a834..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_schedule.py +++ /dev/null @@ -1,49 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ReportConfigSchedule(Model): - """The schedule associated with a report config. - - All required parameters must be populated in order to send to Azure. - - :param status: The status of the schedule. Whether active or not. If - inactive, the report's scheduled execution is paused. Possible values - include: 'Active', 'Inactive' - :type status: str or ~azure.mgmt.costmanagement.models.StatusType - :param recurrence: Required. The schedule recurrence. Possible values - include: 'Daily', 'Weekly', 'Monthly', 'Annually' - :type recurrence: str or ~azure.mgmt.costmanagement.models.RecurrenceType - :param recurrence_period: Required. Has start and end date of the - recurrence. The start date must be in future. If present, the end date - must be greater than start date. - :type recurrence_period: - ~azure.mgmt.costmanagement.models.ReportConfigRecurrencePeriod - """ - - _validation = { - 'recurrence': {'required': True}, - 'recurrence_period': {'required': True}, - } - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'recurrence': {'key': 'recurrence', 'type': 'str'}, - 'recurrence_period': {'key': 'recurrencePeriod', 'type': 'ReportConfigRecurrencePeriod'}, - } - - def __init__(self, **kwargs): - super(ReportConfigSchedule, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.recurrence = kwargs.get('recurrence', None) - self.recurrence_period = kwargs.get('recurrence_period', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_schedule_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_schedule_py3.py deleted file mode 100644 index b951b0adcdc3..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_schedule_py3.py +++ /dev/null @@ -1,49 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ReportConfigSchedule(Model): - """The schedule associated with a report config. - - All required parameters must be populated in order to send to Azure. - - :param status: The status of the schedule. Whether active or not. If - inactive, the report's scheduled execution is paused. Possible values - include: 'Active', 'Inactive' - :type status: str or ~azure.mgmt.costmanagement.models.StatusType - :param recurrence: Required. The schedule recurrence. Possible values - include: 'Daily', 'Weekly', 'Monthly', 'Annually' - :type recurrence: str or ~azure.mgmt.costmanagement.models.RecurrenceType - :param recurrence_period: Required. Has start and end date of the - recurrence. The start date must be in future. If present, the end date - must be greater than start date. - :type recurrence_period: - ~azure.mgmt.costmanagement.models.ReportConfigRecurrencePeriod - """ - - _validation = { - 'recurrence': {'required': True}, - 'recurrence_period': {'required': True}, - } - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'recurrence': {'key': 'recurrence', 'type': 'str'}, - 'recurrence_period': {'key': 'recurrencePeriod', 'type': 'ReportConfigRecurrencePeriod'}, - } - - def __init__(self, *, recurrence, recurrence_period, status=None, **kwargs) -> None: - super(ReportConfigSchedule, self).__init__(**kwargs) - self.status = status - self.recurrence = recurrence - self.recurrence_period = recurrence_period diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_delivery_info.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_sorting.py similarity index 52% rename from azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_delivery_info.py rename to azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_sorting.py index a3caa7e883d8..897bdde4cee5 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_delivery_info.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_sorting.py @@ -12,25 +12,28 @@ from msrest.serialization import Model -class ReportConfigDeliveryInfo(Model): - """The delivery information associated with a report config. +class ReportConfigSorting(Model): + """The order by expression to be used in the report. All required parameters must be populated in order to send to Azure. - :param destination: Required. Has destination for the report being - delivered. - :type destination: - ~azure.mgmt.costmanagement.models.ReportConfigDeliveryDestination + :param direction: Direction of sort. Possible values include: 'Ascending', + 'Descending' + :type direction: str or ~azure.mgmt.costmanagement.models.enum + :param name: Required. The name of the column to sort. + :type name: str """ _validation = { - 'destination': {'required': True}, + 'name': {'required': True}, } _attribute_map = { - 'destination': {'key': 'destination', 'type': 'ReportConfigDeliveryDestination'}, + 'direction': {'key': 'direction', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, } def __init__(self, **kwargs): - super(ReportConfigDeliveryInfo, self).__init__(**kwargs) - self.destination = kwargs.get('destination', None) + super(ReportConfigSorting, self).__init__(**kwargs) + self.direction = kwargs.get('direction', None) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_sorting_py3.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_sorting_py3.py new file mode 100644 index 000000000000..910397d8d51b --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/report_config_sorting_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ReportConfigSorting(Model): + """The order by expression to be used in the report. + + All required parameters must be populated in order to send to Azure. + + :param direction: Direction of sort. Possible values include: 'Ascending', + 'Descending' + :type direction: str or ~azure.mgmt.costmanagement.models.enum + :param name: Required. The name of the column to sort. + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'direction': {'key': 'direction', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str, direction=None, **kwargs) -> None: + super(ReportConfigSorting, self).__init__(**kwargs) + self.direction = direction + self.name = name diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py index 93ee3e3ea6df..a255b445f443 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py @@ -9,16 +9,22 @@ # regenerated. # -------------------------------------------------------------------------- -from .report_config_operations import ReportConfigOperations -from .billing_account_dimensions_operations import BillingAccountDimensionsOperations -from .subscription_dimensions_operations import SubscriptionDimensionsOperations -from .resource_group_dimensions_operations import ResourceGroupDimensionsOperations +from .dimensions_operations import DimensionsOperations +from .query_operations import QueryOperations +from .forecast_operations import ForecastOperations +from .cloud_connector_operations import CloudConnectorOperations +from .external_billing_account_operations import ExternalBillingAccountOperations +from .external_subscription_operations import ExternalSubscriptionOperations +from .entities_operations import EntitiesOperations from .operations import Operations __all__ = [ - 'ReportConfigOperations', - 'BillingAccountDimensionsOperations', - 'SubscriptionDimensionsOperations', - 'ResourceGroupDimensionsOperations', + 'DimensionsOperations', + 'QueryOperations', + 'ForecastOperations', + 'CloudConnectorOperations', + 'ExternalBillingAccountOperations', + 'ExternalSubscriptionOperations', + 'EntitiesOperations', 'Operations', ] diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/billing_account_dimensions_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/billing_account_dimensions_operations.py deleted file mode 100644 index 4ef732e976ed..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/billing_account_dimensions_operations.py +++ /dev/null @@ -1,126 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse - -from .. import models - - -class BillingAccountDimensionsOperations(object): - """BillingAccountDimensionsOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2018-05-31. Constant value: "2018-05-31". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-05-31" - - self.config = config - - def list( - self, billing_account_id, filter=None, expand=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config): - """Lists the dimensions by billingAccount Id. - - :param billing_account_id: BillingAccount ID - :type billing_account_id: str - :param filter: May be used to filter dimensions by - properties/category, properties/usageStart, properties/usageEnd. - Supported operators are 'eq','lt', 'gt', 'le', 'ge'. - :type filter: str - :param expand: May be used to expand the properties/data within a - dimension category. By default, data is not included when listing - dimensions. - :type expand: str - :param skiptoken: Skiptoken is only used if a previous operation - returned a partial result. If a previous response contains a nextLink - element, the value of the nextLink element will include a skiptoken - parameter that specifies a starting point to use for subsequent calls. - :type skiptoken: str - :param top: May be used to limit the number of results to the most - recent N dimension data. - :type top: int - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Dimension - :rtype: - ~azure.mgmt.costmanagement.models.DimensionPaged[~azure.mgmt.costmanagement.models.Dimension] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - if skiptoken is not None: - query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.DimensionPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.DimensionPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/dimensions'} diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/cloud_connector_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/cloud_connector_operations.py new file mode 100644 index 000000000000..1359df81699f --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/cloud_connector_operations.py @@ -0,0 +1,334 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class CloudConnectorOperations(object): + """CloudConnectorOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-03-01-preview. Constant value: "2019-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-03-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """List all cloud connector definitions. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ConnectorDefinition + :rtype: + ~azure.mgmt.costmanagement.models.ConnectorDefinitionPaged[~azure.mgmt.costmanagement.models.ConnectorDefinition] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ConnectorDefinitionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ConnectorDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.CostManagement/cloudConnectors'} + + def get( + self, connector_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Get a cloud connector definition. + + :param connector_name: Connector Name. + :type connector_name: str + :param expand: May be used to expand the collectionInfo property. By + default, collectionInfo is not included. + :type expand: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ConnectorDefinition or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.costmanagement.models.ConnectorDefinition or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'connectorName': self._serialize.url("connector_name", connector_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ConnectorDefinition', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.CostManagement/cloudConnectors/{connectorName}'} + + def create_or_update( + self, connector_name, connector, custom_headers=None, raw=False, **operation_config): + """Create or update a cloud connector definition. + + :param connector_name: Connector Name. + :type connector_name: str + :param connector: Connector details + :type connector: ~azure.mgmt.costmanagement.models.ConnectorDefinition + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ConnectorDefinition or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.costmanagement.models.ConnectorDefinition or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'connectorName': self._serialize.url("connector_name", connector_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(connector, 'ConnectorDefinition') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ConnectorDefinition', response) + if response.status_code == 201: + deserialized = self._deserialize('ConnectorDefinition', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/providers/Microsoft.CostManagement/cloudConnectors/{connectorName}'} + + def delete( + self, connector_name, custom_headers=None, raw=False, **operation_config): + """Delete a cloud connector definition. + + :param connector_name: Connector Name. + :type connector_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'connectorName': self._serialize.url("connector_name", connector_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/providers/Microsoft.CostManagement/cloudConnectors/{connectorName}'} + + def update( + self, connector_name, connector, custom_headers=None, raw=False, **operation_config): + """Update a cloud connector definition. + + :param connector_name: Connector Name. + :type connector_name: str + :param connector: Connector details + :type connector: ~azure.mgmt.costmanagement.models.ConnectorDefinition + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ConnectorDefinition or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.costmanagement.models.ConnectorDefinition or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'connectorName': self._serialize.url("connector_name", connector_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(connector, 'ConnectorDefinition') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ConnectorDefinition', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/providers/Microsoft.CostManagement/cloudConnectors/{connectorName}'} diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/dimensions_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/dimensions_operations.py new file mode 100644 index 000000000000..7c79563f7ab1 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/dimensions_operations.py @@ -0,0 +1,576 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class DimensionsOperations(object): + """DimensionsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-03-01-preview. Constant value: "2019-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-03-01-preview" + + self.config = config + + def list_by_billing_account( + self, billing_account_id, filter=None, expand=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config): + """Lists the dimensions by billingAccount Id. + + :param billing_account_id: BillingAccount ID + :type billing_account_id: str + :param filter: May be used to filter dimensions by + properties/category, properties/usageStart, properties/usageEnd. + Supported operators are 'eq','lt', 'gt', 'le', 'ge'. + :type filter: str + :param expand: May be used to expand the properties/data within a + dimension category. By default, data is not included when listing + dimensions. + :type expand: str + :param skiptoken: Skiptoken is only used if a previous operation + returned a partial result. If a previous response contains a nextLink + element, the value of the nextLink element will include a skiptoken + parameter that specifies a starting point to use for subsequent calls. + :type skiptoken: str + :param top: May be used to limit the number of results to the most + recent N dimension data. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Dimension + :rtype: + ~azure.mgmt.costmanagement.models.DimensionPaged[~azure.mgmt.costmanagement.models.Dimension] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_billing_account.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.DimensionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DimensionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/dimensions'} + + def list_by_enrollment_account( + self, billing_account_id, enrollment_account_id, filter=None, expand=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config): + """Lists the dimensions by Enrollment Account Id. + + :param billing_account_id: BillingAccount ID + :type billing_account_id: str + :param enrollment_account_id: Enrollment Account ID + :type enrollment_account_id: str + :param filter: May be used to filter dimensions by + properties/category, properties/usageStart, properties/usageEnd. + Supported operators are 'eq','lt', 'gt', 'le', 'ge'. + :type filter: str + :param expand: May be used to expand the properties/data within a + dimension category. By default, data is not included when listing + dimensions. + :type expand: str + :param skiptoken: Skiptoken is only used if a previous operation + returned a partial result. If a previous response contains a nextLink + element, the value of the nextLink element will include a skiptoken + parameter that specifies a starting point to use for subsequent calls. + :type skiptoken: str + :param top: May be used to limit the number of results to the most + recent N dimension data. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Dimension + :rtype: + ~azure.mgmt.costmanagement.models.DimensionPaged[~azure.mgmt.costmanagement.models.Dimension] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_enrollment_account.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), + 'enrollmentAccountId': self._serialize.url("enrollment_account_id", enrollment_account_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.DimensionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DimensionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_enrollment_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}/providers/Microsoft.CostManagement/dimensions'} + + def list_by_department( + self, billing_account_id, department_id, filter=None, expand=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config): + """Lists the dimensions by Department Id. + + :param billing_account_id: BillingAccount ID + :type billing_account_id: str + :param department_id: Department ID + :type department_id: str + :param filter: May be used to filter dimensions by + properties/category, properties/usageStart, properties/usageEnd. + Supported operators are 'eq','lt', 'gt', 'le', 'ge'. + :type filter: str + :param expand: May be used to expand the properties/data within a + dimension category. By default, data is not included when listing + dimensions. + :type expand: str + :param skiptoken: Skiptoken is only used if a previous operation + returned a partial result. If a previous response contains a nextLink + element, the value of the nextLink element will include a skiptoken + parameter that specifies a starting point to use for subsequent calls. + :type skiptoken: str + :param top: May be used to limit the number of results to the most + recent N dimension data. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Dimension + :rtype: + ~azure.mgmt.costmanagement.models.DimensionPaged[~azure.mgmt.costmanagement.models.Dimension] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_department.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), + 'departmentId': self._serialize.url("department_id", department_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.DimensionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DimensionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_department.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}/providers/Microsoft.CostManagement/dimensions'} + + def list_by_management_group( + self, management_group_id, filter=None, expand=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config): + """Lists the dimensions by managementGroup Id. + + :param management_group_id: ManagementGroup ID + :type management_group_id: str + :param filter: May be used to filter dimensions by + properties/category, properties/usageStart, properties/usageEnd. + Supported operators are 'eq','lt', 'gt', 'le', 'ge'. + :type filter: str + :param expand: May be used to expand the properties/data within a + dimension category. By default, data is not included when listing + dimensions. + :type expand: str + :param skiptoken: Skiptoken is only used if a previous operation + returned a partial result. If a previous response contains a nextLink + element, the value of the nextLink element will include a skiptoken + parameter that specifies a starting point to use for subsequent calls. + :type skiptoken: str + :param top: May be used to limit the number of results to the most + recent N dimension data. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Dimension + :rtype: + ~azure.mgmt.costmanagement.models.DimensionPaged[~azure.mgmt.costmanagement.models.Dimension] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_management_group.metadata['url'] + path_format_arguments = { + 'managementGroupId': self._serialize.url("management_group_id", management_group_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.DimensionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DimensionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_management_group.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.CostManagement/dimensions'} + + def list_by_subscription( + self, filter=None, expand=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config): + """Lists the dimensions by subscription Id. + + :param filter: May be used to filter dimensions by + properties/category, properties/usageStart, properties/usageEnd. + Supported operators are 'eq','lt', 'gt', 'le', 'ge'. + :type filter: str + :param expand: May be used to expand the properties/data within a + dimension category. By default, data is not included when listing + dimensions. + :type expand: str + :param skiptoken: Skiptoken is only used if a previous operation + returned a partial result. If a previous response contains a nextLink + element, the value of the nextLink element will include a skiptoken + parameter that specifies a starting point to use for subsequent calls. + :type skiptoken: str + :param top: May be used to limit the number of results to the most + recent N dimension data. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Dimension + :rtype: + ~azure.mgmt.costmanagement.models.DimensionPaged[~azure.mgmt.costmanagement.models.Dimension] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.DimensionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DimensionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CostManagement/dimensions'} + + def list_by_resource_group( + self, resource_group_name, filter=None, expand=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config): + """Lists the dimensions by resource group Id. + + :param resource_group_name: Azure Resource Group Name. + :type resource_group_name: str + :param filter: May be used to filter dimensions by + properties/category, properties/usageStart, properties/usageEnd. + Supported operators are 'eq','lt', 'gt', 'le', 'ge'. + :type filter: str + :param expand: May be used to expand the properties/data within a + dimension category. By default, data is not included when listing + dimensions. + :type expand: str + :param skiptoken: Skiptoken is only used if a previous operation + returned a partial result. If a previous response contains a nextLink + element, the value of the nextLink element will include a skiptoken + parameter that specifies a starting point to use for subsequent calls. + :type skiptoken: str + :param top: May be used to limit the number of results to the most + recent N dimension data. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Dimension + :rtype: + ~azure.mgmt.costmanagement.models.DimensionPaged[~azure.mgmt.costmanagement.models.Dimension] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.DimensionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DimensionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CostManagement/dimensions'} diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/subscription_dimensions_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/entities_operations.py similarity index 53% rename from azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/subscription_dimensions_operations.py rename to azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/entities_operations.py index 6bdbde4f71ed..59721f2014ac 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/subscription_dimensions_operations.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/entities_operations.py @@ -15,14 +15,14 @@ from .. import models -class SubscriptionDimensionsOperations(object): - """SubscriptionDimensionsOperations operations. +class EntitiesOperations(object): + """EntitiesOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2018-05-31. Constant value: "2018-05-31". + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-03-01-preview. Constant value: "2019-03-01-preview". """ models = models @@ -32,38 +32,31 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-05-31" + self.api_version = "2019-03-01-preview" self.config = config - def list( - self, filter=None, expand=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config): - """Lists the dimensions by subscription Id. - - :param filter: May be used to filter dimensions by - properties/category, properties/usageStart, properties/usageEnd. - Supported operators are 'eq','lt', 'gt', 'le', 'ge'. - :type filter: str - :param expand: May be used to expand the properties/data within a - dimension category. By default, data is not included when listing - dimensions. - :type expand: str - :param skiptoken: Skiptoken is only used if a previous operation - returned a partial result. If a previous response contains a nextLink - element, the value of the nextLink element will include a skiptoken - parameter that specifies a starting point to use for subsequent calls. - :type skiptoken: str - :param top: May be used to limit the number of results to the most - recent N dimension data. - :type top: int + def list_by_management_group( + self, management_group_id, view=None, custom_headers=None, raw=False, **operation_config): + """List all entities (Management Groups, Subscriptions, + ExternalSubscriptions, etc.) focusing on a particular group for the + authenticated user. + + :param management_group_id: ManagementGroup ID + :type management_group_id: str + :param view: The view parameter allows clients to filter the type of + data that is returned by the getEntities call. Possible values + include: 'FullHierarchy', 'GroupsOnly', 'SubscriptionsOnly', + 'ExternalSubscriptionsOnly', 'Audit' + :type view: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of Dimension + :return: An iterator like instance of EntityInfo :rtype: - ~azure.mgmt.costmanagement.models.DimensionPaged[~azure.mgmt.costmanagement.models.Dimension] + ~azure.mgmt.costmanagement.models.EntityInfoPaged[~azure.mgmt.costmanagement.models.EntityInfo] :raises: :class:`ErrorResponseException` """ @@ -71,23 +64,17 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = self.list.metadata['url'] + url = self.list_by_management_group.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'managementGroupId': self._serialize.url("management_group_id", management_group_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - if skiptoken is not None: - query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) + if view is not None: + query_parameters['$view'] = self._serialize.query("view", view, 'str') else: url = next_link @@ -104,7 +91,7 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.post(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: @@ -113,12 +100,12 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.DimensionPaged(internal_paging, self._deserialize.dependencies) + deserialized = models.EntityInfoPaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} - client_raw_response = models.DimensionPaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = models.EntityInfoPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CostManagement/dimensions'} + list_by_management_group.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.CostManagement/getEntities'} diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/external_billing_account_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/external_billing_account_operations.py new file mode 100644 index 000000000000..da2049233695 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/external_billing_account_operations.py @@ -0,0 +1,156 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ExternalBillingAccountOperations(object): + """ExternalBillingAccountOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-03-01-preview. Constant value: "2019-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-03-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """List all ExternalBillingAccount definitions. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ExternalBillingAccountDefinition + :rtype: + ~azure.mgmt.costmanagement.models.ExternalBillingAccountDefinitionPaged[~azure.mgmt.costmanagement.models.ExternalBillingAccountDefinition] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ExternalBillingAccountDefinitionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ExternalBillingAccountDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.CostManagement/externalBillingAccounts'} + + def get( + self, external_billing_account_name, custom_headers=None, raw=False, **operation_config): + """Get a ExternalBillingAccount definition. + + :param external_billing_account_name: External Billing Account Name. + (eg 'aws-{PayerAccountId}') + :type external_billing_account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ExternalBillingAccountDefinition or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.costmanagement.models.ExternalBillingAccountDefinition or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'externalBillingAccountName': self._serialize.url("external_billing_account_name", external_billing_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ExternalBillingAccountDefinition', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}'} diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/external_subscription_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/external_subscription_operations.py new file mode 100644 index 000000000000..6059b0c05e1d --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/external_subscription_operations.py @@ -0,0 +1,339 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ExternalSubscriptionOperations(object): + """ExternalSubscriptionOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-03-01-preview. Constant value: "2019-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-03-01-preview" + + self.config = config + + def list_by_external_billing_account( + self, external_billing_account_name, custom_headers=None, raw=False, **operation_config): + """List all ExternalSubscriptions by ExternalBillingAccount definitions. + + :param external_billing_account_name: External Billing Account Name. + (eg 'aws-{PayerAccountId}') + :type external_billing_account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ExternalSubscriptionDefinition + :rtype: + ~azure.mgmt.costmanagement.models.ExternalSubscriptionDefinitionPaged[~azure.mgmt.costmanagement.models.ExternalSubscriptionDefinition] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_external_billing_account.metadata['url'] + path_format_arguments = { + 'externalBillingAccountName': self._serialize.url("external_billing_account_name", external_billing_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ExternalSubscriptionDefinitionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ExternalSubscriptionDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_external_billing_account.metadata = {'url': '/providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}/externalSubscriptions'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """List all ExternalSubscription definitions. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ExternalSubscriptionDefinition + :rtype: + ~azure.mgmt.costmanagement.models.ExternalSubscriptionDefinitionPaged[~azure.mgmt.costmanagement.models.ExternalSubscriptionDefinition] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ExternalSubscriptionDefinitionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ExternalSubscriptionDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.CostManagement/externalSubscriptions'} + + def get( + self, external_subscription_name, custom_headers=None, raw=False, **operation_config): + """Get an ExternalSubscription definition. + + :param external_subscription_name: External Subscription Name. (eg + 'aws-{UsageAccountId}') + :type external_subscription_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ExternalSubscriptionDefinition or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.costmanagement.models.ExternalSubscriptionDefinition or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'externalSubscriptionName': self._serialize.url("external_subscription_name", external_subscription_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ExternalSubscriptionDefinition', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}'} + + def list_by_management_group( + self, management_group_id, custom_headers=None, raw=False, **operation_config): + """List all ExternalSubscription definitions for Management Group. + + :param management_group_id: ManagementGroup ID + :type management_group_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ExternalSubscriptionDefinition + :rtype: + ~azure.mgmt.costmanagement.models.ExternalSubscriptionDefinitionPaged[~azure.mgmt.costmanagement.models.ExternalSubscriptionDefinition] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_management_group.metadata['url'] + path_format_arguments = { + 'managementGroupId': self._serialize.url("management_group_id", management_group_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ExternalSubscriptionDefinitionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ExternalSubscriptionDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_management_group.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.CostManagement/externalSubscriptions'} + + def update_by_management_group( + self, management_group_id, external_subscription_name, custom_headers=None, raw=False, **operation_config): + """Associates ExternalSubscription with the management group. + + :param management_group_id: ManagementGroup ID + :type management_group_id: str + :param external_subscription_name: External Subscription Name. (eg + 'aws-{UsageAccountId}') + :type external_subscription_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update_by_management_group.metadata['url'] + path_format_arguments = { + 'managementGroupId': self._serialize.url("management_group_id", management_group_id, 'str'), + 'externalSubscriptionName': self._serialize.url("external_subscription_name", external_subscription_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + update_by_management_group.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}'} diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/forecast_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/forecast_operations.py new file mode 100644 index 000000000000..1020f3179d4d --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/forecast_operations.py @@ -0,0 +1,480 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ForecastOperations(object): + """ForecastOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-03-01-preview. Constant value: "2019-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-03-01-preview" + + self.config = config + + def usage_by_subscription( + self, parameters, custom_headers=None, raw=False, **operation_config): + """Forecast the usage data for subscriptionId. + + :param parameters: Parameters supplied to the CreateOrUpdate Report + Config operation. + :type parameters: + ~azure.mgmt.costmanagement.models.ReportConfigDefinition + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Query + :rtype: + ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.usage_by_subscription.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ReportConfigDefinition') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + usage_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CostManagement/Forecast'} + + def usage_by_resource_group( + self, resource_group_name, parameters, custom_headers=None, raw=False, **operation_config): + """Forecast the usage data for subscriptionId and resource group. + + :param resource_group_name: Azure Resource Group Name. + :type resource_group_name: str + :param parameters: Parameters supplied to the CreateOrUpdate Report + Config operation. + :type parameters: + ~azure.mgmt.costmanagement.models.ReportConfigDefinition + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Query + :rtype: + ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.usage_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ReportConfigDefinition') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + usage_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.CostManagement/Forecast'} + + def usage_by_billing_account( + self, billing_account_id, parameters, custom_headers=None, raw=False, **operation_config): + """Forecast the usage data for billing account. + + :param billing_account_id: BillingAccount ID + :type billing_account_id: str + :param parameters: Parameters supplied to the CreateOrUpdate Report + Config operation. + :type parameters: + ~azure.mgmt.costmanagement.models.ReportConfigDefinition + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Query + :rtype: + ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.usage_by_billing_account.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ReportConfigDefinition') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + usage_by_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/Forecast'} + + def usage_by_enrollment_account( + self, billing_account_id, enrollment_account_id, parameters, custom_headers=None, raw=False, **operation_config): + """Forecast the usage data for an enrollment account. + + :param billing_account_id: BillingAccount ID + :type billing_account_id: str + :param enrollment_account_id: Enrollment Account ID + :type enrollment_account_id: str + :param parameters: Parameters supplied to the CreateOrUpdate Report + Config operation. + :type parameters: + ~azure.mgmt.costmanagement.models.ReportConfigDefinition + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Query + :rtype: + ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.usage_by_enrollment_account.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), + 'enrollmentAccountId': self._serialize.url("enrollment_account_id", enrollment_account_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ReportConfigDefinition') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + usage_by_enrollment_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}/providers/Microsoft.CostManagement/Forecast'} + + def usage_by_department( + self, billing_account_id, department_id, parameters, custom_headers=None, raw=False, **operation_config): + """Forecast the usage data for department. + + :param billing_account_id: BillingAccount ID + :type billing_account_id: str + :param department_id: Department ID + :type department_id: str + :param parameters: Parameters supplied to the CreateOrUpdate Report + Config operation. + :type parameters: + ~azure.mgmt.costmanagement.models.ReportConfigDefinition + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Query + :rtype: + ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.usage_by_department.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), + 'departmentId': self._serialize.url("department_id", department_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ReportConfigDefinition') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + usage_by_department.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}/providers/Microsoft.CostManagement/Forecast'} + + def usage_by_managment_group( + self, management_group_id, parameters, custom_headers=None, raw=False, **operation_config): + """Lists the usage data for management group. + + :param management_group_id: ManagementGroup ID + :type management_group_id: str + :param parameters: Parameters supplied to the CreateOrUpdate Report + Config operation. + :type parameters: + ~azure.mgmt.costmanagement.models.ReportConfigDefinition + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Query + :rtype: + ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.usage_by_managment_group.metadata['url'] + path_format_arguments = { + 'managementGroupId': self._serialize.url("management_group_id", management_group_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ReportConfigDefinition') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + usage_by_managment_group.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.CostManagement/Forecast'} diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/operations.py index aa2c9606c7ee..13ec9cafe5f1 100644 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/operations.py +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/operations.py @@ -22,7 +22,7 @@ class Operations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2018-05-31. Constant value: "2018-05-31". + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-03-01-preview. Constant value: "2019-03-01-preview". """ models = models @@ -32,7 +32,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-05-31" + self.api_version = "2019-03-01-preview" self.config = config diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/query_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/query_operations.py new file mode 100644 index 000000000000..1591a2381db5 --- /dev/null +++ b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/query_operations.py @@ -0,0 +1,480 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class QueryOperations(object): + """QueryOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-03-01-preview. Constant value: "2019-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-03-01-preview" + + self.config = config + + def usage_by_subscription( + self, parameters, custom_headers=None, raw=False, **operation_config): + """Query the usage data for subscriptionId. + + :param parameters: Parameters supplied to the CreateOrUpdate Report + Config operation. + :type parameters: + ~azure.mgmt.costmanagement.models.ReportConfigDefinition + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Query + :rtype: + ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.usage_by_subscription.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ReportConfigDefinition') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + usage_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CostManagement/Query'} + + def usage_by_resource_group( + self, resource_group_name, parameters, custom_headers=None, raw=False, **operation_config): + """Query the usage data for subscriptionId and resource group. + + :param resource_group_name: Azure Resource Group Name. + :type resource_group_name: str + :param parameters: Parameters supplied to the CreateOrUpdate Report + Config operation. + :type parameters: + ~azure.mgmt.costmanagement.models.ReportConfigDefinition + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Query + :rtype: + ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.usage_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ReportConfigDefinition') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + usage_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.CostManagement/Query'} + + def usage_by_billing_account( + self, billing_account_id, parameters, custom_headers=None, raw=False, **operation_config): + """Query the usage data for billing account. + + :param billing_account_id: BillingAccount ID + :type billing_account_id: str + :param parameters: Parameters supplied to the CreateOrUpdate Report + Config operation. + :type parameters: + ~azure.mgmt.costmanagement.models.ReportConfigDefinition + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Query + :rtype: + ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.usage_by_billing_account.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ReportConfigDefinition') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + usage_by_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/Query'} + + def usage_by_enrollment_account( + self, billing_account_id, enrollment_account_id, parameters, custom_headers=None, raw=False, **operation_config): + """Query the usage data for an enrollment account. + + :param billing_account_id: BillingAccount ID + :type billing_account_id: str + :param enrollment_account_id: Enrollment Account ID + :type enrollment_account_id: str + :param parameters: Parameters supplied to the CreateOrUpdate Report + Config operation. + :type parameters: + ~azure.mgmt.costmanagement.models.ReportConfigDefinition + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Query + :rtype: + ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.usage_by_enrollment_account.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), + 'enrollmentAccountId': self._serialize.url("enrollment_account_id", enrollment_account_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ReportConfigDefinition') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + usage_by_enrollment_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}/providers/Microsoft.CostManagement/Query'} + + def usage_by_department( + self, billing_account_id, department_id, parameters, custom_headers=None, raw=False, **operation_config): + """Query the usage data for department. + + :param billing_account_id: BillingAccount ID + :type billing_account_id: str + :param department_id: Department ID + :type department_id: str + :param parameters: Parameters supplied to the CreateOrUpdate Report + Config operation. + :type parameters: + ~azure.mgmt.costmanagement.models.ReportConfigDefinition + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Query + :rtype: + ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.usage_by_department.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), + 'departmentId': self._serialize.url("department_id", department_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ReportConfigDefinition') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + usage_by_department.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}/providers/Microsoft.CostManagement/Query'} + + def usage_by_managment_group( + self, management_group_id, parameters, custom_headers=None, raw=False, **operation_config): + """Lists the usage data for management group. + + :param management_group_id: ManagementGroup ID + :type management_group_id: str + :param parameters: Parameters supplied to the CreateOrUpdate Report + Config operation. + :type parameters: + ~azure.mgmt.costmanagement.models.ReportConfigDefinition + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Query + :rtype: + ~azure.mgmt.costmanagement.models.QueryPaged[~azure.mgmt.costmanagement.models.Query] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.usage_by_managment_group.metadata['url'] + path_format_arguments = { + 'managementGroupId': self._serialize.url("management_group_id", management_group_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ReportConfigDefinition') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.QueryPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.QueryPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + usage_by_managment_group.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.CostManagement/Query'} diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/report_config_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/report_config_operations.py deleted file mode 100644 index 255dc64a915e..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/report_config_operations.py +++ /dev/null @@ -1,514 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse - -from .. import models - - -class ReportConfigOperations(object): - """ReportConfigOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2018-05-31. Constant value: "2018-05-31". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-05-31" - - self.config = config - - def list( - self, custom_headers=None, raw=False, **operation_config): - """Lists all report configs for a subscription. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ReportConfigListResult or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.costmanagement.models.ReportConfigListResult or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('ReportConfigListResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CostManagement/reportconfigs'} - - def list_by_resource_group_name( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): - """Lists all report configs for a resource group under a subscription. - - :param resource_group_name: Azure Resource Group Name. - :type resource_group_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ReportConfigListResult or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.costmanagement.models.ReportConfigListResult or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list_by_resource_group_name.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('ReportConfigListResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_by_resource_group_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CostManagement/reportconfigs'} - - def get( - self, report_config_name, custom_headers=None, raw=False, **operation_config): - """Gets the report config for a subscription by report config name. - - :param report_config_name: Report Config Name. - :type report_config_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ReportConfig or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.costmanagement.models.ReportConfig or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'reportConfigName': self._serialize.url("report_config_name", report_config_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('ReportConfig', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CostManagement/reportconfigs/{reportConfigName}'} - - def create_or_update( - self, report_config_name, parameters, custom_headers=None, raw=False, **operation_config): - """The operation to create or update a report config. Update operation - requires latest eTag to be set in the request mandatorily. You may - obtain the latest eTag by performing a get operation. Create operation - does not require eTag. - - :param report_config_name: Report Config Name. - :type report_config_name: str - :param parameters: Parameters supplied to the CreateOrUpdate Report - Config operation. - :type parameters: ~azure.mgmt.costmanagement.models.ReportConfig - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ReportConfig or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.costmanagement.models.ReportConfig or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.create_or_update.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'reportConfigName': self._serialize.url("report_config_name", report_config_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ReportConfig') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('ReportConfig', response) - if response.status_code == 201: - deserialized = self._deserialize('ReportConfig', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CostManagement/reportconfigs/{reportConfigName}'} - - def delete( - self, report_config_name, custom_headers=None, raw=False, **operation_config): - """The operation to delete a report. - - :param report_config_name: Report Config Name. - :type report_config_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'reportConfigName': self._serialize.url("report_config_name", report_config_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - delete.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CostManagement/reportconfigs/{reportConfigName}'} - - def get_by_resource_group_name( - self, resource_group_name, report_config_name, custom_headers=None, raw=False, **operation_config): - """Gets the report config for a resource group under a subscription by - report config name. - - :param resource_group_name: Azure Resource Group Name. - :type resource_group_name: str - :param report_config_name: Report Config Name. - :type report_config_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ReportConfig or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.costmanagement.models.ReportConfig or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get_by_resource_group_name.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'reportConfigName': self._serialize.url("report_config_name", report_config_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('ReportConfig', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_by_resource_group_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CostManagement/reportconfigs/{reportConfigName}'} - - def create_or_update_by_resource_group_name( - self, resource_group_name, report_config_name, parameters, custom_headers=None, raw=False, **operation_config): - """The operation to create or update a report config. Update operation - requires latest eTag to be set in the request mandatorily. You may - obtain the latest eTag by performing a get operation. Create operation - does not require eTag. - - :param resource_group_name: Azure Resource Group Name. - :type resource_group_name: str - :param report_config_name: Report Config Name. - :type report_config_name: str - :param parameters: Parameters supplied to the CreateOrUpdate Report - Config operation. - :type parameters: ~azure.mgmt.costmanagement.models.ReportConfig - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ReportConfig or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.costmanagement.models.ReportConfig or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.create_or_update_by_resource_group_name.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'reportConfigName': self._serialize.url("report_config_name", report_config_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ReportConfig') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('ReportConfig', response) - if response.status_code == 201: - deserialized = self._deserialize('ReportConfig', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create_or_update_by_resource_group_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CostManagement/reportconfigs/{reportConfigName}'} - - def delete_by_resource_group_name( - self, resource_group_name, report_config_name, custom_headers=None, raw=False, **operation_config): - """The operation to delete a report config. - - :param resource_group_name: Azure Resource Group Name. - :type resource_group_name: str - :param report_config_name: Report Config Name. - :type report_config_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.delete_by_resource_group_name.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'reportConfigName': self._serialize.url("report_config_name", report_config_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - delete_by_resource_group_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CostManagement/reportconfigs/{reportConfigName}'} diff --git a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/resource_group_dimensions_operations.py b/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/resource_group_dimensions_operations.py deleted file mode 100644 index ed03023fd3bd..000000000000 --- a/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/resource_group_dimensions_operations.py +++ /dev/null @@ -1,127 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse - -from .. import models - - -class ResourceGroupDimensionsOperations(object): - """ResourceGroupDimensionsOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2018-05-31. Constant value: "2018-05-31". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-05-31" - - self.config = config - - def list( - self, resource_group_name, filter=None, expand=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config): - """Lists the dimensions by resource group Id. - - :param resource_group_name: Azure Resource Group Name. - :type resource_group_name: str - :param filter: May be used to filter dimensions by - properties/category, properties/usageStart, properties/usageEnd. - Supported operators are 'eq','lt', 'gt', 'le', 'ge'. - :type filter: str - :param expand: May be used to expand the properties/data within a - dimension category. By default, data is not included when listing - dimensions. - :type expand: str - :param skiptoken: Skiptoken is only used if a previous operation - returned a partial result. If a previous response contains a nextLink - element, the value of the nextLink element will include a skiptoken - parameter that specifies a starting point to use for subsequent calls. - :type skiptoken: str - :param top: May be used to limit the number of results to the most - recent N dimension data. - :type top: int - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Dimension - :rtype: - ~azure.mgmt.costmanagement.models.DimensionPaged[~azure.mgmt.costmanagement.models.Dimension] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - if skiptoken is not None: - query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.DimensionPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.DimensionPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CostManagement/dimensions'}