diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/_meta.json b/sdk/costmanagement/azure-mgmt-costmanagement/_meta.json index 03051a9b4540..6d74c054bbab 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/_meta.json +++ b/sdk/costmanagement/azure-mgmt-costmanagement/_meta.json @@ -1,11 +1,11 @@ { - "autorest": "3.4.2", + "autorest": "3.4.5", "use": [ - "@autorest/python@5.8.0", + "@autorest/python@5.8.4", "@autorest/modelerfour@4.19.2" ], - "commit": "67528b3e539b96ccaaf82c360f5715184e467e21", + "commit": "17ebcee3c21d0c1fb14a197c05f41856f1951269", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest_command": "autorest specification/cost-management/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.0 --use=@autorest/modelerfour@4.19.2 --version=3.4.2", + "autorest_command": "autorest specification/cost-management/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.4 --use=@autorest/modelerfour@4.19.2 --version=3.4.5", "readme": "specification/cost-management/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_configuration.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_configuration.py index 0cd20f8ef97a..de6672ba6aea 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_configuration.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_configuration.py @@ -42,7 +42,7 @@ def __init__( super(CostManagementClientConfiguration, self).__init__(**kwargs) self.credential = credential - self.api_version = "2019-11-01" + self.api_version = "2020-06-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-costmanagement/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_cost_management_client.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_cost_management_client.py index 521cb5222a88..d280ac3ea5b3 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_cost_management_client.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_cost_management_client.py @@ -19,13 +19,11 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from ._configuration import CostManagementClientConfiguration -from .operations import SettingsOperations from .operations import ViewsOperations from .operations import AlertsOperations from .operations import ForecastOperations from .operations import DimensionsOperations from .operations import QueryOperations -from .operations import GenerateReservationDetailsReportOperations from .operations import Operations from .operations import ExportsOperations from . import models @@ -34,8 +32,6 @@ class CostManagementClient(object): """CostManagementClient. - :ivar settings: SettingsOperations operations - :vartype settings: azure.mgmt.costmanagement.operations.SettingsOperations :ivar views: ViewsOperations operations :vartype views: azure.mgmt.costmanagement.operations.ViewsOperations :ivar alerts: AlertsOperations operations @@ -46,8 +42,6 @@ class CostManagementClient(object): :vartype dimensions: azure.mgmt.costmanagement.operations.DimensionsOperations :ivar query: QueryOperations operations :vartype query: azure.mgmt.costmanagement.operations.QueryOperations - :ivar generate_reservation_details_report: GenerateReservationDetailsReportOperations operations - :vartype generate_reservation_details_report: azure.mgmt.costmanagement.operations.GenerateReservationDetailsReportOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.costmanagement.operations.Operations :ivar exports: ExportsOperations operations @@ -55,7 +49,6 @@ class CostManagementClient(object): :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -75,8 +68,6 @@ def __init__( self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) - self.settings = SettingsOperations( - self._client, self._config, self._serialize, self._deserialize) self.views = ViewsOperations( self._client, self._config, self._serialize, self._deserialize) self.alerts = AlertsOperations( @@ -87,8 +78,6 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.query = QueryOperations( self._client, self._config, self._serialize, self._deserialize) - self.generate_reservation_details_report = GenerateReservationDetailsReportOperations( - self._client, self._config, self._serialize, self._deserialize) self.operations = Operations( self._client, self._config, self._serialize, self._deserialize) self.exports = ExportsOperations( diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_metadata.json b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_metadata.json index 1e323f28f6ac..9c8e0d061798 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_metadata.json +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_metadata.json @@ -1,6 +1,6 @@ { - "chosen_version": "2019-11-01", - "total_api_version_list": ["2019-11-01"], + "chosen_version": "2020-06-01", + "total_api_version_list": ["2020-06-01"], "client": { "name": "CostManagementClient", "filename": "_cost_management_client", @@ -8,7 +8,7 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true, + "has_lro_operations": false, "client_side_validation": false, "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"CostManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"CostManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" @@ -86,13 +86,11 @@ "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { - "settings": "SettingsOperations", "views": "ViewsOperations", "alerts": "AlertsOperations", "forecast": "ForecastOperations", "dimensions": "DimensionsOperations", "query": "QueryOperations", - "generate_reservation_details_report": "GenerateReservationDetailsReportOperations", "operations": "Operations", "exports": "ExportsOperations" } diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_version.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_version.py index 48944bf3938a..e5754a47ce68 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_version.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "2.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/_configuration.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/_configuration.py index 22c0705a007a..c87b423ec0ec 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/_configuration.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/_configuration.py @@ -39,7 +39,7 @@ def __init__( super(CostManagementClientConfiguration, self).__init__(**kwargs) self.credential = credential - self.api_version = "2019-11-01" + self.api_version = "2020-06-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-costmanagement/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/_cost_management_client.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/_cost_management_client.py index ab4f0f5bdab7..04552a3fde94 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/_cost_management_client.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/_cost_management_client.py @@ -17,13 +17,11 @@ from azure.core.credentials_async import AsyncTokenCredential from ._configuration import CostManagementClientConfiguration -from .operations import SettingsOperations from .operations import ViewsOperations from .operations import AlertsOperations from .operations import ForecastOperations from .operations import DimensionsOperations from .operations import QueryOperations -from .operations import GenerateReservationDetailsReportOperations from .operations import Operations from .operations import ExportsOperations from .. import models @@ -32,8 +30,6 @@ class CostManagementClient(object): """CostManagementClient. - :ivar settings: SettingsOperations operations - :vartype settings: azure.mgmt.costmanagement.aio.operations.SettingsOperations :ivar views: ViewsOperations operations :vartype views: azure.mgmt.costmanagement.aio.operations.ViewsOperations :ivar alerts: AlertsOperations operations @@ -44,8 +40,6 @@ class CostManagementClient(object): :vartype dimensions: azure.mgmt.costmanagement.aio.operations.DimensionsOperations :ivar query: QueryOperations operations :vartype query: azure.mgmt.costmanagement.aio.operations.QueryOperations - :ivar generate_reservation_details_report: GenerateReservationDetailsReportOperations operations - :vartype generate_reservation_details_report: azure.mgmt.costmanagement.aio.operations.GenerateReservationDetailsReportOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.costmanagement.aio.operations.Operations :ivar exports: ExportsOperations operations @@ -53,7 +47,6 @@ class CostManagementClient(object): :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -72,8 +65,6 @@ def __init__( self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) - self.settings = SettingsOperations( - self._client, self._config, self._serialize, self._deserialize) self.views = ViewsOperations( self._client, self._config, self._serialize, self._deserialize) self.alerts = AlertsOperations( @@ -84,8 +75,6 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.query = QueryOperations( self._client, self._config, self._serialize, self._deserialize) - self.generate_reservation_details_report = GenerateReservationDetailsReportOperations( - self._client, self._config, self._serialize, self._deserialize) self.operations = Operations( self._client, self._config, self._serialize, self._deserialize) self.exports = ExportsOperations( diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/__init__.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/__init__.py index c70a4cb564cb..6065b201f9cc 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/__init__.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/__init__.py @@ -6,24 +6,20 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._settings_operations import SettingsOperations from ._views_operations import ViewsOperations from ._alerts_operations import AlertsOperations from ._forecast_operations import ForecastOperations from ._dimensions_operations import DimensionsOperations from ._query_operations import QueryOperations -from ._generate_reservation_details_report_operations import GenerateReservationDetailsReportOperations from ._operations import Operations from ._exports_operations import ExportsOperations __all__ = [ - 'SettingsOperations', 'ViewsOperations', 'AlertsOperations', 'ForecastOperations', 'DimensionsOperations', 'QueryOperations', - 'GenerateReservationDetailsReportOperations', 'Operations', 'ExportsOperations', ] diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_alerts_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_alerts_operations.py index 216d5ebc7b21..dc97b38b0319 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_alerts_operations.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_alerts_operations.py @@ -74,7 +74,7 @@ async def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" accept = "application/json" # Construct URL @@ -146,7 +146,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" accept = "application/json" # Construct URL @@ -222,7 +222,7 @@ async def dismiss( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -288,7 +288,7 @@ async def list_external( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" accept = "application/json" # Construct URL diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_dimensions_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_dimensions_operations.py index 090f2e992e2d..59de2b38e2e3 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_dimensions_operations.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_dimensions_operations.py @@ -83,7 +83,7 @@ def list( :type top: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DimensionsListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.costmanagement.models.DimensionsListResultor None] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.costmanagement.models.DimensionsListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DimensionsListResult"] @@ -91,7 +91,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" accept = "application/json" def prepare_request(next_link=None): @@ -138,7 +138,7 @@ async def get_next(next_link=None): pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 204]: + if response.status_code not in [200]: error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -191,7 +191,7 @@ def by_external_cloud_provider_type( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_exports_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_exports_operations.py index 2f3497eee08b..fd691d95f7c5 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_exports_operations.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_exports_operations.py @@ -43,11 +43,12 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def list( self, scope: str, + expand: Optional[str] = None, **kwargs: Any ) -> "_models.ExportListResult": """The operation to list all exports at the given scope. - :param scope: The scope associated with query and export operations. This includes + :param scope: The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and @@ -64,6 +65,9 @@ async def list( '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. :type scope: str + :param expand: May be used to expand the properties within an export. Currently only + 'runHistory' is supported and will return information for the last execution of each export. + :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ExportListResult, or the result of cls(response) :rtype: ~azure.mgmt.costmanagement.models.ExportListResult @@ -74,7 +78,7 @@ async def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" accept = "application/json" # Construct URL @@ -87,6 +91,8 @@ async def list( # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') # Construct headers header_parameters = {} # type: Dict[str, Any] @@ -113,11 +119,12 @@ async def get( self, scope: str, export_name: str, + expand: Optional[str] = None, **kwargs: Any ) -> "_models.Export": """The operation to get the export for the defined scope by export name. - :param scope: The scope associated with query and export operations. This includes + :param scope: The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and @@ -136,6 +143,9 @@ async def get( :type scope: str :param export_name: Export Name. :type export_name: str + :param expand: May be used to expand the properties within an export. Currently only + 'runHistory' is supported and will return information for the last 10 executions of the export. + :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Export, or the result of cls(response) :rtype: ~azure.mgmt.costmanagement.models.Export @@ -146,7 +156,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" accept = "application/json" # Construct URL @@ -160,6 +170,8 @@ async def get( # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') # Construct headers header_parameters = {} # type: Dict[str, Any] @@ -193,7 +205,7 @@ async def create_or_update( the request. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag. - :param scope: The scope associated with query and export operations. This includes + :param scope: The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and @@ -224,7 +236,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -277,7 +289,7 @@ async def delete( ) -> None: """The operation to delete a export. - :param scope: The scope associated with query and export operations. This includes + :param scope: The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and @@ -306,7 +318,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" accept = "application/json" # Construct URL @@ -345,9 +357,9 @@ async def execute( export_name: str, **kwargs: Any ) -> None: - """The operation to execute a export. + """The operation to execute an export. - :param scope: The scope associated with query and export operations. This includes + :param scope: The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and @@ -376,7 +388,7 @@ async def execute( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" accept = "application/json" # Construct URL @@ -415,9 +427,9 @@ async def get_execution_history( export_name: str, **kwargs: Any ) -> "_models.ExportExecutionListResult": - """The operation to get the execution history of an export for the defined scope by export name. + """The operation to get the execution history of an export for the defined scope and export name. - :param scope: The scope associated with query and export operations. This includes + :param scope: The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and @@ -446,7 +458,7 @@ async def get_execution_history( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" accept = "application/json" # Construct URL diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_forecast_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_forecast_operations.py index 8524f06621a5..24c5b487edb4 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_forecast_operations.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_forecast_operations.py @@ -46,7 +46,7 @@ async def usage( parameters: "_models.ForecastDefinition", filter: Optional[str] = None, **kwargs: Any - ) -> Optional["_models.QueryResult"]: + ) -> "_models.QueryResult": """Lists the forecast charges for scope defined. :param scope: The scope associated with forecast operations. This includes @@ -74,15 +74,15 @@ async def usage( :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response :return: QueryResult, or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.QueryResult or None + :rtype: ~azure.mgmt.costmanagement.models.QueryResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.QueryResult"]] + cls = kwargs.pop('cls', None) # type: ClsType["_models.QueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -111,14 +111,12 @@ async def usage( pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 204]: + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('QueryResult', pipeline_response) + deserialized = self._deserialize('QueryResult', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) @@ -159,7 +157,7 @@ async def external_cloud_provider_usage( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_reservation_details_report_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_reservation_details_report_operations.py deleted file mode 100644 index 04654269eb88..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_reservation_details_report_operations.py +++ /dev/null @@ -1,302 +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 typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class GenerateReservationDetailsReportOperations: - """GenerateReservationDetailsReportOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.costmanagement.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _by_billing_account_id_initial( - self, - billing_account_id: str, - start_date: str, - end_date: str, - **kwargs: Any - ) -> Optional["_models.OperationStatus"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatus"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self._by_billing_account_id_initial.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['startDate'] = self._serialize.query("start_date", start_date, 'str') - query_parameters['endDate'] = self._serialize.query("end_date", end_date, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - _by_billing_account_id_initial.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/generateReservationDetailsReport'} # type: ignore - - async def begin_by_billing_account_id( - self, - billing_account_id: str, - start_date: str, - end_date: str, - **kwargs: Any - ) -> AsyncLROPoller["_models.OperationStatus"]: - """Generates the reservations details report for provided date range asynchronously based on - enrollment id. - - :param billing_account_id: Enrollment ID (Legacy BillingAccount ID). - :type billing_account_id: str - :param start_date: Start Date. - :type start_date: str - :param end_date: End Date. - :type end_date: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OperationStatus or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.costmanagement.models.OperationStatus] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatus"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._by_billing_account_id_initial( - billing_account_id=billing_account_id, - start_date=start_date, - end_date=end_date, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('OperationStatus', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_by_billing_account_id.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/generateReservationDetailsReport'} # type: ignore - - async def _by_billing_profile_id_initial( - self, - billing_account_id: str, - billing_profile_id: str, - start_date: str, - end_date: str, - **kwargs: Any - ) -> Optional["_models.OperationStatus"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatus"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self._by_billing_profile_id_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), - 'billingProfileId': self._serialize.url("billing_profile_id", billing_profile_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['startDate'] = self._serialize.query("start_date", start_date, 'str') - query_parameters['endDate'] = self._serialize.query("end_date", end_date, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - _by_billing_profile_id_initial.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/generateReservationDetailsReport'} # type: ignore - - async def begin_by_billing_profile_id( - self, - billing_account_id: str, - billing_profile_id: str, - start_date: str, - end_date: str, - **kwargs: Any - ) -> AsyncLROPoller["_models.OperationStatus"]: - """Generates the reservations details report for provided date range asynchronously by billing - profile. - - :param billing_account_id: BillingAccount ID. - :type billing_account_id: str - :param billing_profile_id: BillingProfile ID. - :type billing_profile_id: str - :param start_date: Start Date. - :type start_date: str - :param end_date: End Date. - :type end_date: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OperationStatus or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.costmanagement.models.OperationStatus] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatus"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._by_billing_profile_id_initial( - billing_account_id=billing_account_id, - billing_profile_id=billing_profile_id, - start_date=start_date, - end_date=end_date, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('OperationStatus', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), - 'billingProfileId': self._serialize.url("billing_profile_id", billing_profile_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_by_billing_profile_id.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/generateReservationDetailsReport'} # type: ignore diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_operations.py index e9b536504b06..b78075cce746 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_operations.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_operations.py @@ -57,7 +57,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_query_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_query_operations.py index 7a973c90e3c8..db7827a0066e 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_query_operations.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_query_operations.py @@ -45,7 +45,7 @@ async def usage( scope: str, parameters: "_models.QueryDefinition", **kwargs: Any - ) -> Optional["_models.QueryResult"]: + ) -> "_models.QueryResult": """Query the usage data for scope defined. :param scope: The scope associated with query and export operations. This includes @@ -69,15 +69,15 @@ async def usage( :type parameters: ~azure.mgmt.costmanagement.models.QueryDefinition :keyword callable cls: A custom type or function that will be passed the direct response :return: QueryResult, or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.QueryResult or None + :rtype: ~azure.mgmt.costmanagement.models.QueryResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.QueryResult"]] + cls = kwargs.pop('cls', None) # type: ClsType["_models.QueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -104,14 +104,12 @@ async def usage( pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 204]: + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('QueryResult', pipeline_response) + deserialized = self._deserialize('QueryResult', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) @@ -147,7 +145,7 @@ async def usage_by_external_cloud_provider_type( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_settings_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_settings_operations.py deleted file mode 100644 index 2a0f8f9e272e..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_settings_operations.py +++ /dev/null @@ -1,273 +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 typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class SettingsOperations: - """SettingsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.costmanagement.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - **kwargs: Any - ) -> AsyncIterable["_models.SettingsListResult"]: - """Lists all of the settings that have been customized. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SettingsListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.costmanagement.models.SettingsListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SettingsListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('SettingsListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/providers/Microsoft.CostManagement/settings'} # type: ignore - - async def get( - self, - setting_name: str, - **kwargs: Any - ) -> "_models.Setting": - """Retrieves the current value for a specific setting. - - :param setting_name: Name of the setting. Allowed values: myscope. - :type setting_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Setting, or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.Setting - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Setting"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'settingName': self._serialize.url("setting_name", setting_name, 'str', max_length=32, min_length=0), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Setting', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/providers/Microsoft.CostManagement/settings/{settingName}'} # type: ignore - - async def create_or_update( - self, - setting_name: str, - parameters: "_models.Setting", - **kwargs: Any - ) -> "_models.Setting": - """Sets a new value for a specific setting. - - :param setting_name: Name of the setting. Allowed values: myscope. - :type setting_name: str - :param parameters: Body supplied to the CreateOrUpdate setting operation. - :type parameters: ~azure.mgmt.costmanagement.models.Setting - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Setting, or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.Setting - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Setting"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'settingName': self._serialize.url("setting_name", setting_name, 'str', max_length=32, min_length=0), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'Setting') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Setting', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_or_update.metadata = {'url': '/providers/Microsoft.CostManagement/settings/{settingName}'} # type: ignore - - async def delete( - self, - setting_name: str, - **kwargs: Any - ) -> None: - """Remove the current value for a specific setting and reverts back to the default value, if - applicable. - - :param setting_name: Name of the setting. Allowed values: myscope. - :type setting_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'settingName': self._serialize.url("setting_name", setting_name, 'str', max_length=32, min_length=0), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/providers/Microsoft.CostManagement/settings/{settingName}'} # type: ignore diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_views_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_views_operations.py index a82f547d6103..59f33bb358f0 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_views_operations.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_views_operations.py @@ -49,7 +49,7 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ViewListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.costmanagement.models.ViewListResultor None] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.costmanagement.models.ViewListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ViewListResult"] @@ -57,7 +57,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" accept = "application/json" def prepare_request(next_link=None): @@ -92,7 +92,7 @@ async def get_next(next_link=None): pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 204]: + if response.status_code not in [200]: error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -131,7 +131,7 @@ def list_by_scope( :type scope: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ViewListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.costmanagement.models.ViewListResultor None] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.costmanagement.models.ViewListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ViewListResult"] @@ -139,7 +139,7 @@ def list_by_scope( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" accept = "application/json" def prepare_request(next_link=None): @@ -178,7 +178,7 @@ async def get_next(next_link=None): pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 204]: + if response.status_code not in [200]: error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -209,7 +209,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" accept = "application/json" # Construct URL @@ -268,7 +268,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -331,7 +331,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" accept = "application/json" # Construct URL @@ -401,7 +401,7 @@ async def get_by_scope( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" accept = "application/json" # Construct URL @@ -480,7 +480,7 @@ async def create_or_update_by_scope( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -563,7 +563,7 @@ async def delete_by_scope( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" accept = "application/json" # Construct URL diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py index c55fa14a8390..2afdd595d689 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py @@ -11,7 +11,6 @@ from ._models_py3 import AlertPropertiesDefinition from ._models_py3 import AlertPropertiesDetails from ._models_py3 import AlertsResult - from ._models_py3 import CacheItem from ._models_py3 import CommonExportProperties from ._models_py3 import Dimension from ._models_py3 import DimensionsListResult @@ -19,6 +18,8 @@ from ._models_py3 import ErrorDetails from ._models_py3 import ErrorResponse from ._models_py3 import Export + from ._models_py3 import ExportDataset + from ._models_py3 import ExportDatasetConfiguration from ._models_py3 import ExportDefinition from ._models_py3 import ExportDeliveryDestination from ._models_py3 import ExportDeliveryInfo @@ -28,39 +29,37 @@ from ._models_py3 import ExportProperties from ._models_py3 import ExportRecurrencePeriod from ._models_py3 import ExportSchedule + from ._models_py3 import ExportTimePeriod + from ._models_py3 import ForecastDataset from ._models_py3 import ForecastDefinition from ._models_py3 import KpiProperties from ._models_py3 import Operation from ._models_py3 import OperationDisplay from ._models_py3 import OperationListResult - from ._models_py3 import OperationStatus from ._models_py3 import PivotProperties from ._models_py3 import ProxyResource - from ._models_py3 import ProxySettingResource from ._models_py3 import QueryAggregation from ._models_py3 import QueryColumn from ._models_py3 import QueryComparisonExpression from ._models_py3 import QueryDataset - from ._models_py3 import QueryDatasetAutoGenerated from ._models_py3 import QueryDatasetConfiguration from ._models_py3 import QueryDefinition from ._models_py3 import QueryFilter - from ._models_py3 import QueryFilterAutoGenerated from ._models_py3 import QueryGrouping from ._models_py3 import QueryResult from ._models_py3 import QueryTimePeriod from ._models_py3 import ReportConfigAggregation from ._models_py3 import ReportConfigComparisonExpression from ._models_py3 import ReportConfigDataset + from ._models_py3 import ReportConfigDatasetAutoGenerated from ._models_py3 import ReportConfigDatasetConfiguration + from ._models_py3 import ReportConfigDefinition from ._models_py3 import ReportConfigFilter + from ._models_py3 import ReportConfigFilterAutoGenerated from ._models_py3 import ReportConfigGrouping from ._models_py3 import ReportConfigSorting from ._models_py3 import ReportConfigTimePeriod from ._models_py3 import Resource - from ._models_py3 import Setting - from ._models_py3 import SettingsListResult - from ._models_py3 import Status from ._models_py3 import View from ._models_py3 import ViewListResult except (SyntaxError, ImportError): @@ -68,7 +67,6 @@ from ._models import AlertPropertiesDefinition # type: ignore from ._models import AlertPropertiesDetails # type: ignore from ._models import AlertsResult # type: ignore - from ._models import CacheItem # type: ignore from ._models import CommonExportProperties # type: ignore from ._models import Dimension # type: ignore from ._models import DimensionsListResult # type: ignore @@ -76,6 +74,8 @@ from ._models import ErrorDetails # type: ignore from ._models import ErrorResponse # type: ignore from ._models import Export # type: ignore + from ._models import ExportDataset # type: ignore + from ._models import ExportDatasetConfiguration # type: ignore from ._models import ExportDefinition # type: ignore from ._models import ExportDeliveryDestination # type: ignore from ._models import ExportDeliveryInfo # type: ignore @@ -85,39 +85,37 @@ from ._models import ExportProperties # type: ignore from ._models import ExportRecurrencePeriod # type: ignore from ._models import ExportSchedule # type: ignore + from ._models import ExportTimePeriod # type: ignore + from ._models import ForecastDataset # type: ignore from ._models import ForecastDefinition # type: ignore from ._models import KpiProperties # type: ignore from ._models import Operation # type: ignore from ._models import OperationDisplay # type: ignore from ._models import OperationListResult # type: ignore - from ._models import OperationStatus # type: ignore from ._models import PivotProperties # type: ignore from ._models import ProxyResource # type: ignore - from ._models import ProxySettingResource # type: ignore from ._models import QueryAggregation # type: ignore from ._models import QueryColumn # type: ignore from ._models import QueryComparisonExpression # type: ignore from ._models import QueryDataset # type: ignore - from ._models import QueryDatasetAutoGenerated # type: ignore from ._models import QueryDatasetConfiguration # type: ignore from ._models import QueryDefinition # type: ignore from ._models import QueryFilter # type: ignore - from ._models import QueryFilterAutoGenerated # type: ignore from ._models import QueryGrouping # type: ignore from ._models import QueryResult # type: ignore from ._models import QueryTimePeriod # type: ignore from ._models import ReportConfigAggregation # type: ignore from ._models import ReportConfigComparisonExpression # type: ignore from ._models import ReportConfigDataset # type: ignore + from ._models import ReportConfigDatasetAutoGenerated # type: ignore from ._models import ReportConfigDatasetConfiguration # type: ignore + from ._models import ReportConfigDefinition # type: ignore from ._models import ReportConfigFilter # type: ignore + from ._models import ReportConfigFilterAutoGenerated # type: ignore from ._models import ReportConfigGrouping # type: ignore from ._models import ReportConfigSorting # type: ignore from ._models import ReportConfigTimePeriod # type: ignore from ._models import Resource # type: ignore - from ._models import Setting # type: ignore - from ._models import SettingsListResult # type: ignore - from ._models import Status # type: ignore from ._models import View # type: ignore from ._models import ViewListResult # type: ignore @@ -142,17 +140,16 @@ GranularityType, KpiType, MetricType, - OperationStatusType, OperatorType, PivotType, QueryColumnType, + QueryOperatorType, RecurrenceType, ReportConfigColumnType, ReportConfigSortingDirection, ReportGranularityType, ReportTimeframeType, ReportType, - SettingsPropertiesStartOn, StatusType, TimeframeType, ) @@ -162,7 +159,6 @@ 'AlertPropertiesDefinition', 'AlertPropertiesDetails', 'AlertsResult', - 'CacheItem', 'CommonExportProperties', 'Dimension', 'DimensionsListResult', @@ -170,6 +166,8 @@ 'ErrorDetails', 'ErrorResponse', 'Export', + 'ExportDataset', + 'ExportDatasetConfiguration', 'ExportDefinition', 'ExportDeliveryDestination', 'ExportDeliveryInfo', @@ -179,39 +177,37 @@ 'ExportProperties', 'ExportRecurrencePeriod', 'ExportSchedule', + 'ExportTimePeriod', + 'ForecastDataset', 'ForecastDefinition', 'KpiProperties', 'Operation', 'OperationDisplay', 'OperationListResult', - 'OperationStatus', 'PivotProperties', 'ProxyResource', - 'ProxySettingResource', 'QueryAggregation', 'QueryColumn', 'QueryComparisonExpression', 'QueryDataset', - 'QueryDatasetAutoGenerated', 'QueryDatasetConfiguration', 'QueryDefinition', 'QueryFilter', - 'QueryFilterAutoGenerated', 'QueryGrouping', 'QueryResult', 'QueryTimePeriod', 'ReportConfigAggregation', 'ReportConfigComparisonExpression', 'ReportConfigDataset', + 'ReportConfigDatasetAutoGenerated', 'ReportConfigDatasetConfiguration', + 'ReportConfigDefinition', 'ReportConfigFilter', + 'ReportConfigFilterAutoGenerated', 'ReportConfigGrouping', 'ReportConfigSorting', 'ReportConfigTimePeriod', 'Resource', - 'Setting', - 'SettingsListResult', - 'Status', 'View', 'ViewListResult', 'AccumulatedType', @@ -234,17 +230,16 @@ 'GranularityType', 'KpiType', 'MetricType', - 'OperationStatusType', 'OperatorType', 'PivotType', 'QueryColumnType', + 'QueryOperatorType', 'RecurrenceType', 'ReportConfigColumnType', 'ReportConfigSortingDirection', 'ReportGranularityType', 'ReportTimeframeType', 'ReportType', - 'SettingsPropertiesStartOn', 'StatusType', 'TimeframeType', ] diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/_cost_management_client_enums.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/_cost_management_client_enums.py index 16087446457c..884450e0a1ce 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/_cost_management_client_enums.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/_cost_management_client_enums.py @@ -124,7 +124,7 @@ class ChartType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): TABLE = "Table" class ExecutionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The status of the export execution. + """The last known status of the export execution. """ QUEUED = "Queued" @@ -176,7 +176,7 @@ class ForecastType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): AMORTIZED_COST = "AmortizedCost" class FormatType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The format of the export being delivered. + """The format of the export being delivered. Currently only 'Csv' is supported. """ CSV = "Csv" @@ -188,7 +188,7 @@ class FunctionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): SUM = "Sum" class GranularityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The granularity of rows in the query. + """The granularity of rows in the forecast. """ DAILY = "Daily" @@ -208,14 +208,6 @@ class MetricType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): AMORTIZED_COST = "AmortizedCost" AHUB = "AHUB" -class OperationStatusType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The status of the long running operation. - """ - - RUNNING = "Running" - COMPLETED = "Completed" - FAILED = "Failed" - class OperatorType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The operator to use for comparison. """ @@ -237,6 +229,12 @@ class QueryColumnType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): TAG = "Tag" DIMENSION = "Dimension" +class QueryOperatorType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The operator to use for comparison. + """ + + IN_ENUM = "In" + class RecurrenceType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The schedule recurrence. """ @@ -285,18 +283,8 @@ class ReportType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): USAGE = "Usage" -class SettingsPropertiesStartOn(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Indicates what scope Cost Management in the Azure portal should default to. Allowed values: - LastUsed. - """ - - LAST_USED = "LastUsed" - SCOPE_PICKER = "ScopePicker" - SPECIFIC_SCOPE = "SpecificScope" - class StatusType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The status of the schedule. Whether active or not. If inactive, the export's scheduled - execution is paused. + """The status of the export's schedule. If 'Inactive', the export's schedule is paused. """ ACTIVE = "Active" diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/_models.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/_models.py index 2c2ba531e35b..5a436ed59028 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/_models.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/_models.py @@ -275,80 +275,39 @@ def __init__( self.next_link = None -class CacheItem(msrest.serialization.Model): - """CacheItem. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. Resource ID used by Resource Manager to uniquely identify the scope. - :type id: str - :param name: Required. Display name for the scope. - :type name: str - :param channel: Required. Indicates the account type. Allowed values include: EA, PAYG, Modern, - Internal, Unknown. - :type channel: str - :param subchannel: Required. Indicates the type of modern account. Allowed values include: - Individual, Enterprise, Partner, Indirect, NotApplicable. - :type subchannel: str - :param parent: Resource ID of the parent scope. For instance, subscription's resource ID for a - resource group or a management group resource ID for a subscription. - :type parent: str - :param status: Indicates the status of the scope. Status only applies to subscriptions and - billing accounts. - :type status: str - """ - - _validation = { - 'id': {'required': True}, - 'name': {'required': True}, - 'channel': {'required': True}, - 'subchannel': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'channel': {'key': 'channel', 'type': 'str'}, - 'subchannel': {'key': 'subchannel', 'type': 'str'}, - 'parent': {'key': 'parent', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(CacheItem, self).__init__(**kwargs) - self.id = kwargs['id'] - self.name = kwargs['name'] - self.channel = kwargs['channel'] - self.subchannel = kwargs['subchannel'] - self.parent = kwargs.get('parent', None) - self.status = kwargs.get('status', None) - - class CommonExportProperties(msrest.serialization.Model): """The common properties of the export. + 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 format: The format of the export being delivered. Possible values include: "Csv". + :param format: The format of the export being delivered. Currently only 'Csv' is supported. + Possible values include: "Csv". :type format: str or ~azure.mgmt.costmanagement.models.FormatType :param delivery_info: Required. Has delivery information for the export. :type delivery_info: ~azure.mgmt.costmanagement.models.ExportDeliveryInfo - :param definition: Required. Has definition for the export. + :param definition: Required. Has the definition for the export. :type definition: ~azure.mgmt.costmanagement.models.ExportDefinition + :param run_history: If requested, has the most recent execution history for the export. + :type run_history: ~azure.mgmt.costmanagement.models.ExportExecutionListResult + :ivar next_run_time_estimate: If the export has an active schedule, provides an estimate of the + next execution time. + :vartype next_run_time_estimate: ~datetime.datetime """ _validation = { 'delivery_info': {'required': True}, 'definition': {'required': True}, + 'next_run_time_estimate': {'readonly': True}, } _attribute_map = { 'format': {'key': 'format', 'type': 'str'}, 'delivery_info': {'key': 'deliveryInfo', 'type': 'ExportDeliveryInfo'}, 'definition': {'key': 'definition', 'type': 'ExportDefinition'}, + 'run_history': {'key': 'runHistory', 'type': 'ExportExecutionListResult'}, + 'next_run_time_estimate': {'key': 'nextRunTimeEstimate', 'type': 'iso-8601'}, } def __init__( @@ -359,6 +318,8 @@ def __init__( self.format = kwargs.get('format', None) self.delivery_info = kwargs['delivery_info'] self.definition = kwargs['definition'] + self.run_history = kwargs.get('run_history', None) + self.next_run_time_estimate = None class Dimension(Resource): @@ -625,7 +586,7 @@ def __init__( class Export(ProxyResource): - """A export resource. + """An export resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -638,12 +599,18 @@ class Export(ProxyResource): :param e_tag: eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not. :type e_tag: str - :param format: The format of the export being delivered. Possible values include: "Csv". + :param format: The format of the export being delivered. Currently only 'Csv' is supported. + Possible values include: "Csv". :type format: str or ~azure.mgmt.costmanagement.models.FormatType :param delivery_info: Has delivery information for the export. :type delivery_info: ~azure.mgmt.costmanagement.models.ExportDeliveryInfo - :param definition: Has definition for the export. + :param definition: Has the definition for the export. :type definition: ~azure.mgmt.costmanagement.models.ExportDefinition + :param run_history: If requested, has the most recent execution history for the export. + :type run_history: ~azure.mgmt.costmanagement.models.ExportExecutionListResult + :ivar next_run_time_estimate: If the export has an active schedule, provides an estimate of the + next execution time. + :vartype next_run_time_estimate: ~datetime.datetime :param schedule: Has schedule information for the export. :type schedule: ~azure.mgmt.costmanagement.models.ExportSchedule """ @@ -652,6 +619,7 @@ class Export(ProxyResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'next_run_time_estimate': {'readonly': True}, } _attribute_map = { @@ -662,6 +630,8 @@ class Export(ProxyResource): 'format': {'key': 'properties.format', 'type': 'str'}, 'delivery_info': {'key': 'properties.deliveryInfo', 'type': 'ExportDeliveryInfo'}, 'definition': {'key': 'properties.definition', 'type': 'ExportDefinition'}, + 'run_history': {'key': 'properties.runHistory', 'type': 'ExportExecutionListResult'}, + 'next_run_time_estimate': {'key': 'properties.nextRunTimeEstimate', 'type': 'iso-8601'}, 'schedule': {'key': 'properties.schedule', 'type': 'ExportSchedule'}, } @@ -673,25 +643,73 @@ def __init__( self.format = kwargs.get('format', None) self.delivery_info = kwargs.get('delivery_info', None) self.definition = kwargs.get('definition', None) + self.run_history = kwargs.get('run_history', None) + self.next_run_time_estimate = None self.schedule = kwargs.get('schedule', None) +class ExportDataset(msrest.serialization.Model): + """The definition for data in the export. + + :param granularity: The granularity of rows in the export. Currently only 'Daily' is supported. + Possible values include: "Daily". + :type granularity: str or ~azure.mgmt.costmanagement.models.GranularityType + :param configuration: The export dataset configuration. + :type configuration: ~azure.mgmt.costmanagement.models.ExportDatasetConfiguration + """ + + _attribute_map = { + 'granularity': {'key': 'granularity', 'type': 'str'}, + 'configuration': {'key': 'configuration', 'type': 'ExportDatasetConfiguration'}, + } + + def __init__( + self, + **kwargs + ): + super(ExportDataset, self).__init__(**kwargs) + self.granularity = kwargs.get('granularity', None) + self.configuration = kwargs.get('configuration', None) + + +class ExportDatasetConfiguration(msrest.serialization.Model): + """The export dataset configuration. Allows columns to be selected for the export. If not provided then the export will include all available columns. + + :param columns: Array of column names to be included in the export. If not provided then the + export will include all available columns. The available columns can vary by customer channel + (see examples). + :type columns: list[str] + """ + + _attribute_map = { + 'columns': {'key': 'columns', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(ExportDatasetConfiguration, self).__init__(**kwargs) + self.columns = kwargs.get('columns', None) + + class ExportDefinition(msrest.serialization.Model): - """The definition of a query. + """The definition of an export. All required parameters must be populated in order to send to Azure. - :param type: Required. The type of the query. Possible values include: "Usage", "ActualCost", - "AmortizedCost". + :param type: Required. The type of the export. Note that 'Usage' is equivalent to 'ActualCost' + and is applicable to exports that do not yet provide data for charges or amortization for + service reservations. Possible values include: "Usage", "ActualCost", "AmortizedCost". :type type: str or ~azure.mgmt.costmanagement.models.ExportType - :param timeframe: Required. The time frame for pulling data for the query. If custom, then a + :param timeframe: Required. The time frame for pulling data for the export. If custom, then a specific time period must be provided. Possible values include: "MonthToDate", "BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom". :type timeframe: str or ~azure.mgmt.costmanagement.models.TimeframeType - :param time_period: Has time period for pulling data for the query. - :type time_period: ~azure.mgmt.costmanagement.models.QueryTimePeriod - :param data_set: Has definition for data in this query. - :type data_set: ~azure.mgmt.costmanagement.models.QueryDatasetAutoGenerated + :param time_period: Has time period for pulling data for the export. + :type time_period: ~azure.mgmt.costmanagement.models.ExportTimePeriod + :param data_set: The definition for data in the export. + :type data_set: ~azure.mgmt.costmanagement.models.ExportDataset """ _validation = { @@ -702,8 +720,8 @@ class ExportDefinition(msrest.serialization.Model): _attribute_map = { 'type': {'key': 'type', 'type': 'str'}, 'timeframe': {'key': 'timeframe', 'type': 'str'}, - 'time_period': {'key': 'timePeriod', 'type': 'QueryTimePeriod'}, - 'data_set': {'key': 'dataSet', 'type': 'QueryDatasetAutoGenerated'}, + 'time_period': {'key': 'timePeriod', 'type': 'ExportTimePeriod'}, + 'data_set': {'key': 'dataSet', 'type': 'ExportDataset'}, } def __init__( @@ -777,8 +795,8 @@ def __init__( self.destination = kwargs['destination'] -class ExportExecution(Resource): - """A export execution. +class ExportExecution(ProxyResource): + """An export execution. Variables are only populated by the server, and will be ignored when sending a request. @@ -788,41 +806,44 @@ class ExportExecution(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] + :param e_tag: eTag of the resource. To handle concurrent update scenario, this field will be + used to determine whether the user is updating the latest version or not. + :type e_tag: str :param execution_type: The type of the export execution. Possible values include: "OnDemand", "Scheduled". :type execution_type: str or ~azure.mgmt.costmanagement.models.ExecutionType - :param status: The status of the export execution. Possible values include: "Queued", - "InProgress", "Completed", "Failed", "Timeout", "NewDataNotAvailable", "DataNotAvailable". + :param status: The last known status of the export execution. Possible values include: + "Queued", "InProgress", "Completed", "Failed", "Timeout", "NewDataNotAvailable", + "DataNotAvailable". :type status: str or ~azure.mgmt.costmanagement.models.ExecutionStatus :param submitted_by: The identifier for the entity that executed the export. For OnDemand - executions, it is the email id. For Scheduled executions, it is the constant value - System. + executions it is the user email. For scheduled executions it is 'System'. :type submitted_by: str :param submitted_time: The time when export was queued to be executed. :type submitted_time: ~datetime.datetime :param processing_start_time: The time when export was picked up to be executed. :type processing_start_time: ~datetime.datetime - :param processing_end_time: The time when export execution finished. + :param processing_end_time: The time when the export execution finished. :type processing_end_time: ~datetime.datetime - :param file_name: The name of the file export got written to. + :param file_name: The name of the exported file. :type file_name: str - :param run_settings: The common properties of the export. + :param run_settings: The export settings that were in effect for this execution. :type run_settings: ~azure.mgmt.costmanagement.models.CommonExportProperties + :param error: The details of any error. + :type error: ~azure.mgmt.costmanagement.models.ErrorDetails """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'tags': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, 'execution_type': {'key': 'properties.executionType', 'type': 'str'}, 'status': {'key': 'properties.status', 'type': 'str'}, 'submitted_by': {'key': 'properties.submittedBy', 'type': 'str'}, @@ -831,6 +852,7 @@ class ExportExecution(Resource): 'processing_end_time': {'key': 'properties.processingEndTime', 'type': 'iso-8601'}, 'file_name': {'key': 'properties.fileName', 'type': 'str'}, 'run_settings': {'key': 'properties.runSettings', 'type': 'CommonExportProperties'}, + 'error': {'key': 'properties.error', 'type': 'ErrorDetails'}, } def __init__( @@ -846,14 +868,15 @@ def __init__( self.processing_end_time = kwargs.get('processing_end_time', None) self.file_name = kwargs.get('file_name', None) self.run_settings = kwargs.get('run_settings', None) + self.error = kwargs.get('error', None) class ExportExecutionListResult(msrest.serialization.Model): - """Result of listing exports execution history of a export by name. + """Result of listing the execution history of an export. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: The list of export executions. + :ivar value: A list of export executions. :vartype value: list[~azure.mgmt.costmanagement.models.ExportExecution] """ @@ -901,14 +924,22 @@ def __init__( class ExportProperties(CommonExportProperties): """The properties of the export. + 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 format: The format of the export being delivered. Possible values include: "Csv". + :param format: The format of the export being delivered. Currently only 'Csv' is supported. + Possible values include: "Csv". :type format: str or ~azure.mgmt.costmanagement.models.FormatType :param delivery_info: Required. Has delivery information for the export. :type delivery_info: ~azure.mgmt.costmanagement.models.ExportDeliveryInfo - :param definition: Required. Has definition for the export. + :param definition: Required. Has the definition for the export. :type definition: ~azure.mgmt.costmanagement.models.ExportDefinition + :param run_history: If requested, has the most recent execution history for the export. + :type run_history: ~azure.mgmt.costmanagement.models.ExportExecutionListResult + :ivar next_run_time_estimate: If the export has an active schedule, provides an estimate of the + next execution time. + :vartype next_run_time_estimate: ~datetime.datetime :param schedule: Has schedule information for the export. :type schedule: ~azure.mgmt.costmanagement.models.ExportSchedule """ @@ -916,12 +947,15 @@ class ExportProperties(CommonExportProperties): _validation = { 'delivery_info': {'required': True}, 'definition': {'required': True}, + 'next_run_time_estimate': {'readonly': True}, } _attribute_map = { 'format': {'key': 'format', 'type': 'str'}, 'delivery_info': {'key': 'deliveryInfo', 'type': 'ExportDeliveryInfo'}, 'definition': {'key': 'definition', 'type': 'ExportDefinition'}, + 'run_history': {'key': 'runHistory', 'type': 'ExportExecutionListResult'}, + 'next_run_time_estimate': {'key': 'nextRunTimeEstimate', 'type': 'iso-8601'}, 'schedule': {'key': 'schedule', 'type': 'ExportSchedule'}, } @@ -963,25 +997,19 @@ def __init__( class ExportSchedule(msrest.serialization.Model): - """The schedule associated with a export. - - All required parameters must be populated in order to send to Azure. + """The schedule associated with the export. - :param status: The status of the schedule. Whether active or not. If inactive, the export's - scheduled execution is paused. Possible values include: "Active", "Inactive". + :param status: The status of the export's schedule. If 'Inactive', the export's schedule 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". + :param recurrence: The schedule recurrence. Possible values include: "Daily", "Weekly", + "Monthly", "Annually". :type recurrence: str or ~azure.mgmt.costmanagement.models.RecurrenceType :param recurrence_period: Has start and end date of the recurrence. The start date must be in future. If present, the end date must be greater than start date. :type recurrence_period: ~azure.mgmt.costmanagement.models.ExportRecurrencePeriod """ - _validation = { - 'recurrence': {'required': True}, - } - _attribute_map = { 'status': {'key': 'status', 'type': 'str'}, 'recurrence': {'key': 'recurrence', 'type': 'str'}, @@ -994,10 +1022,74 @@ def __init__( ): super(ExportSchedule, self).__init__(**kwargs) self.status = kwargs.get('status', None) - self.recurrence = kwargs['recurrence'] + self.recurrence = kwargs.get('recurrence', None) self.recurrence_period = kwargs.get('recurrence_period', None) +class ExportTimePeriod(msrest.serialization.Model): + """The date range for data in the export. This should only be specified with timeFrame set to 'Custom'. The maximum date range is 3 months. + + All required parameters must be populated in order to send to Azure. + + :param from_property: Required. The start date for export data. + :type from_property: ~datetime.datetime + :param to: Required. The end date for export data. + :type to: ~datetime.datetime + """ + + _validation = { + 'from_property': {'required': True}, + 'to': {'required': True}, + } + + _attribute_map = { + 'from_property': {'key': 'from', 'type': 'iso-8601'}, + 'to': {'key': 'to', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(ExportTimePeriod, self).__init__(**kwargs) + self.from_property = kwargs['from_property'] + self.to = kwargs['to'] + + +class ForecastDataset(msrest.serialization.Model): + """The definition of data present in the forecast. + + :param granularity: The granularity of rows in the forecast. Possible values include: "Daily". + :type granularity: str or ~azure.mgmt.costmanagement.models.GranularityType + :param configuration: Has configuration information for the data in the export. The + configuration will be ignored if aggregation and grouping are provided. + :type configuration: ~azure.mgmt.costmanagement.models.QueryDatasetConfiguration + :param aggregation: Dictionary of aggregation expression to use in the forecast. The key of + each item in the dictionary is the alias for the aggregated column. forecast can have up to 2 + aggregation clauses. + :type aggregation: dict[str, ~azure.mgmt.costmanagement.models.QueryAggregation] + :param filter: Has filter expression to use in the forecast. + :type filter: ~azure.mgmt.costmanagement.models.QueryFilter + """ + + _attribute_map = { + 'granularity': {'key': 'granularity', 'type': 'str'}, + 'configuration': {'key': 'configuration', 'type': 'QueryDatasetConfiguration'}, + 'aggregation': {'key': 'aggregation', 'type': '{QueryAggregation}'}, + 'filter': {'key': 'filter', 'type': 'QueryFilter'}, + } + + def __init__( + self, + **kwargs + ): + super(ForecastDataset, self).__init__(**kwargs) + self.granularity = kwargs.get('granularity', None) + self.configuration = kwargs.get('configuration', None) + self.aggregation = kwargs.get('aggregation', None) + self.filter = kwargs.get('filter', None) + + class ForecastDefinition(msrest.serialization.Model): """The definition of a forecast. @@ -1012,8 +1104,8 @@ class ForecastDefinition(msrest.serialization.Model): :type timeframe: str or ~azure.mgmt.costmanagement.models.ForecastTimeframeType :param time_period: Has time period for pulling data for the forecast. :type time_period: ~azure.mgmt.costmanagement.models.QueryTimePeriod - :param dataset: Has definition for data in this forecast. - :type dataset: ~azure.mgmt.costmanagement.models.QueryDataset + :param dataset: Required. Has definition for data in this forecast. + :type dataset: ~azure.mgmt.costmanagement.models.ForecastDataset :param include_actual_cost: a boolean determining if actualCost will be included. :type include_actual_cost: bool :param include_fresh_partial_cost: a boolean determining if FreshPartialCost will be included. @@ -1023,13 +1115,14 @@ class ForecastDefinition(msrest.serialization.Model): _validation = { 'type': {'required': True}, 'timeframe': {'required': True}, + 'dataset': {'required': True}, } _attribute_map = { 'type': {'key': 'type', 'type': 'str'}, 'timeframe': {'key': 'timeframe', 'type': 'str'}, 'time_period': {'key': 'timePeriod', 'type': 'QueryTimePeriod'}, - 'dataset': {'key': 'dataset', 'type': 'QueryDataset'}, + 'dataset': {'key': 'dataset', 'type': 'ForecastDataset'}, 'include_actual_cost': {'key': 'includeActualCost', 'type': 'bool'}, 'include_fresh_partial_cost': {'key': 'includeFreshPartialCost', 'type': 'bool'}, } @@ -1042,7 +1135,7 @@ def __init__( self.type = kwargs['type'] self.timeframe = kwargs['timeframe'] self.time_period = kwargs.get('time_period', None) - self.dataset = kwargs.get('dataset', None) + self.dataset = kwargs['dataset'] self.include_actual_cost = kwargs.get('include_actual_cost', None) self.include_fresh_partial_cost = kwargs.get('include_fresh_partial_cost', None) @@ -1169,33 +1262,6 @@ def __init__( self.next_link = None -class OperationStatus(msrest.serialization.Model): - """The status of the long running operation. - - :param status: The status of the long running operation. - :type status: ~azure.mgmt.costmanagement.models.Status - :param report_url: The URL to download the generated report. - :type report_url: str - :param valid_until: The time at which report URL becomes invalid. - :type valid_until: ~datetime.datetime - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'Status'}, - 'report_url': {'key': 'properties.reportUrl', 'type': 'str'}, - 'valid_until': {'key': 'properties.validUntil', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationStatus, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.report_url = kwargs.get('report_url', None) - self.valid_until = kwargs.get('valid_until', None) - - class PivotProperties(msrest.serialization.Model): """Each pivot must contain a 'type' and 'name'. @@ -1219,46 +1285,6 @@ def __init__( self.name = kwargs.get('name', None) -class ProxySettingResource(msrest.serialization.Model): - """The Resource model definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar kind: Resource kind. - :vartype kind: str - :ivar type: Resource type. - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'kind': {'readonly': True, 'max_length': 10, 'min_length': 0}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ProxySettingResource, self).__init__(**kwargs) - self.id = None - self.name = None - self.kind = None - self.type = None - - class QueryAggregation(msrest.serialization.Model): """The aggregation expression to be used in the query. @@ -1320,9 +1346,8 @@ class QueryComparisonExpression(msrest.serialization.Model): :param name: Required. The name of the column to use in comparison. :type name: str - :param operator: Required. The operator to use for comparison. Possible values include: "In", - "Contains". - :type operator: str or ~azure.mgmt.costmanagement.models.OperatorType + :param operator: Required. The operator to use for comparison. Possible values include: "In". + :type operator: str or ~azure.mgmt.costmanagement.models.QueryOperatorType :param values: Required. Array of values to use for comparison. :type values: list[str] """ @@ -1364,7 +1389,8 @@ class QueryDataset(msrest.serialization.Model): :param grouping: Array of group by expression to use in the query. Query can have up to 2 group by clauses. :type grouping: list[~azure.mgmt.costmanagement.models.QueryGrouping] - :param filter: Has filter expression to use in the query. + :param filter: The filter expression to use in the query. Please reference our Query API REST + documentation for how to properly format the filter. :type filter: ~azure.mgmt.costmanagement.models.QueryFilter """ @@ -1392,49 +1418,6 @@ def __init__( self.filter = kwargs.get('filter', None) -class QueryDatasetAutoGenerated(msrest.serialization.Model): - """The definition of data present in the query. - - :param granularity: The granularity of rows in the query. Possible values include: "Daily". - :type granularity: str or ~azure.mgmt.costmanagement.models.GranularityType - :param configuration: Has configuration information for the data in the export. The - configuration will be ignored if aggregation and grouping are provided. - :type configuration: ~azure.mgmt.costmanagement.models.QueryDatasetConfiguration - :param aggregation: Dictionary of aggregation expression to use in the query. The key of each - item in the dictionary is the alias for the aggregated column. Query can have up to 2 - aggregation clauses. - :type aggregation: dict[str, ~azure.mgmt.costmanagement.models.QueryAggregation] - :param grouping: Array of group by expression to use in the query. Query can have up to 2 group - by clauses. - :type grouping: list[~azure.mgmt.costmanagement.models.QueryGrouping] - :param filter: Has filter expression to use in the query. - :type filter: ~azure.mgmt.costmanagement.models.QueryFilterAutoGenerated - """ - - _validation = { - 'grouping': {'max_items': 2, 'min_items': 0}, - } - - _attribute_map = { - 'granularity': {'key': 'granularity', 'type': 'str'}, - 'configuration': {'key': 'configuration', 'type': 'QueryDatasetConfiguration'}, - 'aggregation': {'key': 'aggregation', 'type': '{QueryAggregation}'}, - 'grouping': {'key': 'grouping', 'type': '[QueryGrouping]'}, - 'filter': {'key': 'filter', 'type': 'QueryFilterAutoGenerated'}, - } - - def __init__( - self, - **kwargs - ): - super(QueryDatasetAutoGenerated, self).__init__(**kwargs) - self.granularity = kwargs.get('granularity', None) - self.configuration = kwargs.get('configuration', None) - self.aggregation = kwargs.get('aggregation', None) - self.grouping = kwargs.get('grouping', None) - self.filter = kwargs.get('filter', None) - - class QueryDatasetConfiguration(msrest.serialization.Model): """The configuration of dataset in the query. @@ -1469,13 +1452,14 @@ class QueryDefinition(msrest.serialization.Model): :type timeframe: str or ~azure.mgmt.costmanagement.models.TimeframeType :param time_period: Has time period for pulling data for the query. :type time_period: ~azure.mgmt.costmanagement.models.QueryTimePeriod - :param dataset: Has definition for data in this query. + :param dataset: Required. Has definition for data in this query. :type dataset: ~azure.mgmt.costmanagement.models.QueryDataset """ _validation = { 'type': {'required': True}, 'timeframe': {'required': True}, + 'dataset': {'required': True}, } _attribute_map = { @@ -1493,7 +1477,7 @@ def __init__( self.type = kwargs['type'] self.timeframe = kwargs['timeframe'] self.time_period = kwargs.get('time_period', None) - self.dataset = kwargs.get('dataset', None) + self.dataset = kwargs['dataset'] class QueryFilter(msrest.serialization.Model): @@ -1503,10 +1487,12 @@ class QueryFilter(msrest.serialization.Model): :type and_property: list[~azure.mgmt.costmanagement.models.QueryFilter] :param or_property: The logical "OR" expression. Must have at least 2 items. :type or_property: list[~azure.mgmt.costmanagement.models.QueryFilter] - :param dimensions: Has comparison expression for a dimension. - :type dimensions: ~azure.mgmt.costmanagement.models.QueryComparisonExpression - :param tags: A set of tags. Has comparison expression for a tag. - :type tags: ~azure.mgmt.costmanagement.models.QueryComparisonExpression + :param not_property: The logical "NOT" expression. + :type not_property: ~azure.mgmt.costmanagement.models.QueryFilter + :param dimension: Has comparison expression for a dimension. + :type dimension: ~azure.mgmt.costmanagement.models.QueryComparisonExpression + :param tag: Has comparison expression for a tag. + :type tag: ~azure.mgmt.costmanagement.models.QueryComparisonExpression """ _validation = { @@ -1517,8 +1503,9 @@ class QueryFilter(msrest.serialization.Model): _attribute_map = { 'and_property': {'key': 'and', 'type': '[QueryFilter]'}, 'or_property': {'key': 'or', 'type': '[QueryFilter]'}, - 'dimensions': {'key': 'dimensions', 'type': 'QueryComparisonExpression'}, - 'tags': {'key': 'tags', 'type': 'QueryComparisonExpression'}, + 'not_property': {'key': 'not', 'type': 'QueryFilter'}, + 'dimension': {'key': 'dimension', 'type': 'QueryComparisonExpression'}, + 'tag': {'key': 'tag', 'type': 'QueryComparisonExpression'}, } def __init__( @@ -1528,44 +1515,9 @@ def __init__( super(QueryFilter, self).__init__(**kwargs) self.and_property = kwargs.get('and_property', None) self.or_property = kwargs.get('or_property', None) - self.dimensions = kwargs.get('dimensions', None) - self.tags = kwargs.get('tags', None) - - -class QueryFilterAutoGenerated(msrest.serialization.Model): - """The filter expression to be used in the export. - - :param and_property: The logical "AND" expression. Must have at least 2 items. - :type and_property: list[~azure.mgmt.costmanagement.models.QueryFilterAutoGenerated] - :param or_property: The logical "OR" expression. Must have at least 2 items. - :type or_property: list[~azure.mgmt.costmanagement.models.QueryFilterAutoGenerated] - :param dimensions: Has comparison expression for a dimension. - :type dimensions: ~azure.mgmt.costmanagement.models.QueryComparisonExpression - :param tags: A set of tags. Has comparison expression for a tag. - :type tags: ~azure.mgmt.costmanagement.models.QueryComparisonExpression - """ - - _validation = { - 'and_property': {'min_items': 2}, - 'or_property': {'min_items': 2}, - } - - _attribute_map = { - 'and_property': {'key': 'and', 'type': '[QueryFilterAutoGenerated]'}, - 'or_property': {'key': 'or', 'type': '[QueryFilterAutoGenerated]'}, - 'dimensions': {'key': 'dimensions', 'type': 'QueryComparisonExpression'}, - 'tags': {'key': 'tags', 'type': 'QueryComparisonExpression'}, - } - - def __init__( - self, - **kwargs - ): - super(QueryFilterAutoGenerated, self).__init__(**kwargs) - self.and_property = kwargs.get('and_property', None) - self.or_property = kwargs.get('or_property', None) - self.dimensions = kwargs.get('dimensions', None) - self.tags = kwargs.get('tags', None) + self.not_property = kwargs.get('not_property', None) + self.dimension = kwargs.get('dimension', None) + self.tag = kwargs.get('tag', None) class QueryGrouping(msrest.serialization.Model): @@ -1612,13 +1564,6 @@ class QueryResult(Resource): :vartype type: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] - :param e_tag: eTag of the resource. To handle concurrent update scenario, this field will be - used to determine whether the user is updating the latest version or not. - :type e_tag: str - :ivar location: Resource location. - :vartype location: str - :ivar sku: Resource SKU. - :vartype sku: str :param next_link: The link (url) to the next page of results. :type next_link: str :param columns: Array of columns. @@ -1632,8 +1577,6 @@ class QueryResult(Resource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'tags': {'readonly': True}, - 'location': {'readonly': True}, - 'sku': {'readonly': True}, } _attribute_map = { @@ -1641,9 +1584,6 @@ class QueryResult(Resource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'e_tag': {'key': 'eTag', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'str'}, 'next_link': {'key': 'properties.nextLink', 'type': 'str'}, 'columns': {'key': 'properties.columns', 'type': '[QueryColumn]'}, 'rows': {'key': 'properties.rows', 'type': '[[object]]'}, @@ -1654,9 +1594,6 @@ def __init__( **kwargs ): super(QueryResult, self).__init__(**kwargs) - self.e_tag = kwargs.get('e_tag', None) - self.location = None - self.sku = None self.next_link = kwargs.get('next_link', None) self.columns = kwargs.get('columns', None) self.rows = kwargs.get('rows', None) @@ -1807,6 +1744,54 @@ def __init__( self.filter = kwargs.get('filter', None) +class ReportConfigDatasetAutoGenerated(msrest.serialization.Model): + """The definition of data present in the report. + + :param granularity: The granularity of rows in the report. Possible values include: "Daily", + "Monthly". + :type granularity: str or ~azure.mgmt.costmanagement.models.ReportGranularityType + :param configuration: Has configuration information for the data in the report. The + configuration will be ignored if aggregation and grouping are provided. + :type configuration: ~azure.mgmt.costmanagement.models.ReportConfigDatasetConfiguration + :param aggregation: Dictionary of aggregation expression to use in the report. The key of each + item in the dictionary is the alias for the aggregated column. Report can have up to 2 + aggregation clauses. + :type aggregation: dict[str, ~azure.mgmt.costmanagement.models.ReportConfigAggregation] + :param grouping: Array of group by expression to use in the report. Report 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.ReportConfigFilterAutoGenerated + """ + + _validation = { + 'grouping': {'max_items': 2, 'min_items': 0}, + } + + _attribute_map = { + 'granularity': {'key': 'granularity', 'type': 'str'}, + 'configuration': {'key': 'configuration', 'type': 'ReportConfigDatasetConfiguration'}, + 'aggregation': {'key': 'aggregation', 'type': '{ReportConfigAggregation}'}, + 'grouping': {'key': 'grouping', 'type': '[ReportConfigGrouping]'}, + 'sorting': {'key': 'sorting', 'type': '[ReportConfigSorting]'}, + 'filter': {'key': 'filter', 'type': 'ReportConfigFilterAutoGenerated'}, + } + + def __init__( + self, + **kwargs + ): + super(ReportConfigDatasetAutoGenerated, self).__init__(**kwargs) + self.granularity = kwargs.get('granularity', None) + self.configuration = kwargs.get('configuration', None) + self.aggregation = kwargs.get('aggregation', None) + self.grouping = kwargs.get('grouping', None) + self.sorting = kwargs.get('sorting', None) + self.filter = kwargs.get('filter', None) + + class ReportConfigDatasetConfiguration(msrest.serialization.Model): """The configuration of dataset in the report. @@ -1827,6 +1812,49 @@ def __init__( self.columns = kwargs.get('columns', None) +class ReportConfigDefinition(msrest.serialization.Model): + """The definition of a report config. + + All required parameters must be populated in order to send to Azure. + + :param 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. Possible values include: + "Usage". + :type type: str or ~azure.mgmt.costmanagement.models.ReportType + :param timeframe: Required. The time frame for pulling data for the report. If custom, then a + specific time period must be provided. Possible values include: "WeekToDate", "MonthToDate", + "YearToDate", "Custom". + :type timeframe: str or ~azure.mgmt.costmanagement.models.ReportTimeframeType + :param time_period: Has time period for pulling data for the report. + :type time_period: ~azure.mgmt.costmanagement.models.ReportConfigTimePeriod + :param dataset: Has definition for data in this report config. + :type dataset: ~azure.mgmt.costmanagement.models.ReportConfigDatasetAutoGenerated + """ + + _validation = { + 'type': {'required': True}, + 'timeframe': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'timeframe': {'key': 'timeframe', 'type': 'str'}, + 'time_period': {'key': 'timePeriod', 'type': 'ReportConfigTimePeriod'}, + 'dataset': {'key': 'dataset', 'type': 'ReportConfigDatasetAutoGenerated'}, + } + + def __init__( + self, + **kwargs + ): + super(ReportConfigDefinition, self).__init__(**kwargs) + self.type = kwargs['type'] + self.timeframe = kwargs['timeframe'] + self.time_period = kwargs.get('time_period', None) + self.dataset = kwargs.get('dataset', None) + + class ReportConfigFilter(msrest.serialization.Model): """The filter expression to be used in the report. @@ -1834,14 +1862,12 @@ class ReportConfigFilter(msrest.serialization.Model): :type and_property: list[~azure.mgmt.costmanagement.models.ReportConfigFilter] :param or_property: The logical "OR" expression. Must have at least 2 items. :type or_property: list[~azure.mgmt.costmanagement.models.ReportConfigFilter] - :param dimensions: Has comparison expression for a dimension. - :type dimensions: ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression - :param tags: A set of tags. Has comparison expression for a tag. - :type tags: ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression - :param tag_key: Has comparison expression for a tag key. - :type tag_key: ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression - :param tag_value: Has comparison expression for a tag value. - :type tag_value: ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression + :param not_property: The logical "NOT" expression. + :type not_property: ~azure.mgmt.costmanagement.models.ReportConfigFilter + :param dimension: Has comparison expression for a dimension. + :type dimension: ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression + :param tag: Has comparison expression for a tag. + :type tag: ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression """ _validation = { @@ -1852,10 +1878,9 @@ class ReportConfigFilter(msrest.serialization.Model): _attribute_map = { 'and_property': {'key': 'and', 'type': '[ReportConfigFilter]'}, 'or_property': {'key': 'or', 'type': '[ReportConfigFilter]'}, - 'dimensions': {'key': 'dimensions', 'type': 'ReportConfigComparisonExpression'}, - 'tags': {'key': 'tags', 'type': 'ReportConfigComparisonExpression'}, - 'tag_key': {'key': 'tagKey', 'type': 'ReportConfigComparisonExpression'}, - 'tag_value': {'key': 'tagValue', 'type': 'ReportConfigComparisonExpression'}, + 'not_property': {'key': 'not', 'type': 'ReportConfigFilter'}, + 'dimension': {'key': 'dimension', 'type': 'ReportConfigComparisonExpression'}, + 'tag': {'key': 'tag', 'type': 'ReportConfigComparisonExpression'}, } def __init__( @@ -1865,10 +1890,49 @@ def __init__( super(ReportConfigFilter, self).__init__(**kwargs) self.and_property = kwargs.get('and_property', None) self.or_property = kwargs.get('or_property', None) - self.dimensions = kwargs.get('dimensions', None) - self.tags = kwargs.get('tags', None) - self.tag_key = kwargs.get('tag_key', None) - self.tag_value = kwargs.get('tag_value', None) + self.not_property = kwargs.get('not_property', None) + self.dimension = kwargs.get('dimension', None) + self.tag = kwargs.get('tag', None) + + +class ReportConfigFilterAutoGenerated(msrest.serialization.Model): + """The filter expression to be used in the report. + + :param and_property: The logical "AND" expression. Must have at least 2 items. + :type and_property: list[~azure.mgmt.costmanagement.models.ReportConfigFilterAutoGenerated] + :param or_property: The logical "OR" expression. Must have at least 2 items. + :type or_property: list[~azure.mgmt.costmanagement.models.ReportConfigFilterAutoGenerated] + :param not_property: The logical "NOT" expression. + :type not_property: ~azure.mgmt.costmanagement.models.ReportConfigFilterAutoGenerated + :param dimension: Has comparison expression for a dimension. + :type dimension: ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression + :param tag: Has comparison expression for a tag. + :type tag: ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression + """ + + _validation = { + 'and_property': {'min_items': 2}, + 'or_property': {'min_items': 2}, + } + + _attribute_map = { + 'and_property': {'key': 'and', 'type': '[ReportConfigFilterAutoGenerated]'}, + 'or_property': {'key': 'or', 'type': '[ReportConfigFilterAutoGenerated]'}, + 'not_property': {'key': 'not', 'type': 'ReportConfigFilterAutoGenerated'}, + 'dimension': {'key': 'dimension', 'type': 'ReportConfigComparisonExpression'}, + 'tag': {'key': 'tag', 'type': 'ReportConfigComparisonExpression'}, + } + + def __init__( + self, + **kwargs + ): + super(ReportConfigFilterAutoGenerated, self).__init__(**kwargs) + self.and_property = kwargs.get('and_property', None) + self.or_property = kwargs.get('or_property', None) + self.not_property = kwargs.get('not_property', None) + self.dimension = kwargs.get('dimension', None) + self.tag = kwargs.get('tag', None) class ReportConfigGrouping(msrest.serialization.Model): @@ -1962,107 +2026,6 @@ def __init__( self.to = kwargs['to'] -class Setting(ProxySettingResource): - """State of the myscope setting. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar kind: Resource kind. - :vartype kind: str - :ivar type: Resource type. - :vartype type: str - :param scope: Sets the default scope the current user will see when they sign into Azure Cost - Management in the Azure portal. - :type scope: str - :param start_on: Indicates what scope Cost Management in the Azure portal should default to. - Allowed values: LastUsed. Possible values include: "LastUsed", "ScopePicker", "SpecificScope". - :type start_on: str or ~azure.mgmt.costmanagement.models.SettingsPropertiesStartOn - :param cache: Array of scopes with additional details used by Cost Management in the Azure - portal. - :type cache: list[~azure.mgmt.costmanagement.models.CacheItem] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'kind': {'readonly': True, 'max_length': 10, 'min_length': 0}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'scope': {'key': 'properties.scope', 'type': 'str'}, - 'start_on': {'key': 'properties.startOn', 'type': 'str'}, - 'cache': {'key': 'properties.cache', 'type': '[CacheItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(Setting, self).__init__(**kwargs) - self.scope = kwargs.get('scope', None) - self.start_on = kwargs.get('start_on', None) - self.cache = kwargs.get('cache', None) - - -class SettingsListResult(msrest.serialization.Model): - """Result of listing settings. It contains a list of available settings. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of settings. - :vartype value: list[~azure.mgmt.costmanagement.models.Setting] - :ivar next_link: The link (url) to the next page of results. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True, 'max_items': 10, 'min_items': 0}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Setting]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SettingsListResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class Status(msrest.serialization.Model): - """The status of the long running operation. - - :param status: The status of the long running operation. Possible values include: "Running", - "Completed", "Failed". - :type status: str or ~azure.mgmt.costmanagement.models.OperationStatusType - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Status, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - - class View(ProxyResource): """States and configurations of Cost Analysis. @@ -2101,10 +2064,6 @@ class View(ProxyResource): :vartype created_on: ~datetime.datetime :ivar modified_on: Date when the user last modified this view. :vartype modified_on: ~datetime.datetime - :ivar date_range: Selected date range for viewing cost in. - :vartype date_range: str - :ivar currency: Selected currency. - :vartype currency: str :param chart: Chart type of the main view in Cost Analysis. Required. Possible values include: "Area", "Line", "StackedColumn", "GroupedColumn", "Table". :type chart: str or ~azure.mgmt.costmanagement.models.ChartType @@ -2128,10 +2087,8 @@ class View(ProxyResource): :type timeframe: str or ~azure.mgmt.costmanagement.models.ReportTimeframeType :param time_period: Has time period for pulling data for the report. :type time_period: ~azure.mgmt.costmanagement.models.ReportConfigTimePeriod - :param data_set: Has definition for data in this report config. - :type data_set: ~azure.mgmt.costmanagement.models.ReportConfigDataset - :ivar include_monetary_commitment: Include monetary commitment. - :vartype include_monetary_commitment: bool + :param dataset: Has definition for data in this report config. + :type dataset: ~azure.mgmt.costmanagement.models.ReportConfigDataset """ _validation = { @@ -2140,9 +2097,6 @@ class View(ProxyResource): 'type': {'readonly': True}, 'created_on': {'readonly': True}, 'modified_on': {'readonly': True}, - 'date_range': {'readonly': True}, - 'currency': {'readonly': True}, - 'include_monetary_commitment': {'readonly': True}, } _attribute_map = { @@ -2154,8 +2108,6 @@ class View(ProxyResource): 'scope': {'key': 'properties.scope', 'type': 'str'}, 'created_on': {'key': 'properties.createdOn', 'type': 'iso-8601'}, 'modified_on': {'key': 'properties.modifiedOn', 'type': 'iso-8601'}, - 'date_range': {'key': 'properties.dateRange', 'type': 'str'}, - 'currency': {'key': 'properties.currency', 'type': 'str'}, 'chart': {'key': 'properties.chart', 'type': 'str'}, 'accumulated': {'key': 'properties.accumulated', 'type': 'str'}, 'metric': {'key': 'properties.metric', 'type': 'str'}, @@ -2164,8 +2116,7 @@ class View(ProxyResource): 'type_properties_query_type': {'key': 'properties.query.type', 'type': 'str'}, 'timeframe': {'key': 'properties.query.timeframe', 'type': 'str'}, 'time_period': {'key': 'properties.query.timePeriod', 'type': 'ReportConfigTimePeriod'}, - 'data_set': {'key': 'properties.query.dataSet', 'type': 'ReportConfigDataset'}, - 'include_monetary_commitment': {'key': 'properties.query.includeMonetaryCommitment', 'type': 'bool'}, + 'dataset': {'key': 'properties.query.dataset', 'type': 'ReportConfigDataset'}, } def __init__( @@ -2177,8 +2128,6 @@ def __init__( self.scope = kwargs.get('scope', None) self.created_on = None self.modified_on = None - self.date_range = None - self.currency = None self.chart = kwargs.get('chart', None) self.accumulated = kwargs.get('accumulated', None) self.metric = kwargs.get('metric', None) @@ -2187,8 +2136,7 @@ def __init__( self.type_properties_query_type = kwargs.get('type_properties_query_type', None) self.timeframe = kwargs.get('timeframe', None) self.time_period = kwargs.get('time_period', None) - self.data_set = kwargs.get('data_set', None) - self.include_monetary_commitment = None + self.dataset = kwargs.get('dataset', None) class ViewListResult(msrest.serialization.Model): diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/_models_py3.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/_models_py3.py index 699d4b63d817..2a9b3d2294ed 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/_models_py3.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/_models_py3.py @@ -313,87 +313,39 @@ def __init__( self.next_link = None -class CacheItem(msrest.serialization.Model): - """CacheItem. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. Resource ID used by Resource Manager to uniquely identify the scope. - :type id: str - :param name: Required. Display name for the scope. - :type name: str - :param channel: Required. Indicates the account type. Allowed values include: EA, PAYG, Modern, - Internal, Unknown. - :type channel: str - :param subchannel: Required. Indicates the type of modern account. Allowed values include: - Individual, Enterprise, Partner, Indirect, NotApplicable. - :type subchannel: str - :param parent: Resource ID of the parent scope. For instance, subscription's resource ID for a - resource group or a management group resource ID for a subscription. - :type parent: str - :param status: Indicates the status of the scope. Status only applies to subscriptions and - billing accounts. - :type status: str - """ - - _validation = { - 'id': {'required': True}, - 'name': {'required': True}, - 'channel': {'required': True}, - 'subchannel': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'channel': {'key': 'channel', 'type': 'str'}, - 'subchannel': {'key': 'subchannel', 'type': 'str'}, - 'parent': {'key': 'parent', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - *, - id: str, - name: str, - channel: str, - subchannel: str, - parent: Optional[str] = None, - status: Optional[str] = None, - **kwargs - ): - super(CacheItem, self).__init__(**kwargs) - self.id = id - self.name = name - self.channel = channel - self.subchannel = subchannel - self.parent = parent - self.status = status - - class CommonExportProperties(msrest.serialization.Model): """The common properties of the export. + 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 format: The format of the export being delivered. Possible values include: "Csv". + :param format: The format of the export being delivered. Currently only 'Csv' is supported. + Possible values include: "Csv". :type format: str or ~azure.mgmt.costmanagement.models.FormatType :param delivery_info: Required. Has delivery information for the export. :type delivery_info: ~azure.mgmt.costmanagement.models.ExportDeliveryInfo - :param definition: Required. Has definition for the export. + :param definition: Required. Has the definition for the export. :type definition: ~azure.mgmt.costmanagement.models.ExportDefinition + :param run_history: If requested, has the most recent execution history for the export. + :type run_history: ~azure.mgmt.costmanagement.models.ExportExecutionListResult + :ivar next_run_time_estimate: If the export has an active schedule, provides an estimate of the + next execution time. + :vartype next_run_time_estimate: ~datetime.datetime """ _validation = { 'delivery_info': {'required': True}, 'definition': {'required': True}, + 'next_run_time_estimate': {'readonly': True}, } _attribute_map = { 'format': {'key': 'format', 'type': 'str'}, 'delivery_info': {'key': 'deliveryInfo', 'type': 'ExportDeliveryInfo'}, 'definition': {'key': 'definition', 'type': 'ExportDefinition'}, + 'run_history': {'key': 'runHistory', 'type': 'ExportExecutionListResult'}, + 'next_run_time_estimate': {'key': 'nextRunTimeEstimate', 'type': 'iso-8601'}, } def __init__( @@ -402,12 +354,15 @@ def __init__( delivery_info: "ExportDeliveryInfo", definition: "ExportDefinition", format: Optional[Union[str, "FormatType"]] = None, + run_history: Optional["ExportExecutionListResult"] = None, **kwargs ): super(CommonExportProperties, self).__init__(**kwargs) self.format = format self.delivery_info = delivery_info self.definition = definition + self.run_history = run_history + self.next_run_time_estimate = None class Dimension(Resource): @@ -692,7 +647,7 @@ def __init__( class Export(ProxyResource): - """A export resource. + """An export resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -705,12 +660,18 @@ class Export(ProxyResource): :param e_tag: eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not. :type e_tag: str - :param format: The format of the export being delivered. Possible values include: "Csv". + :param format: The format of the export being delivered. Currently only 'Csv' is supported. + Possible values include: "Csv". :type format: str or ~azure.mgmt.costmanagement.models.FormatType :param delivery_info: Has delivery information for the export. :type delivery_info: ~azure.mgmt.costmanagement.models.ExportDeliveryInfo - :param definition: Has definition for the export. + :param definition: Has the definition for the export. :type definition: ~azure.mgmt.costmanagement.models.ExportDefinition + :param run_history: If requested, has the most recent execution history for the export. + :type run_history: ~azure.mgmt.costmanagement.models.ExportExecutionListResult + :ivar next_run_time_estimate: If the export has an active schedule, provides an estimate of the + next execution time. + :vartype next_run_time_estimate: ~datetime.datetime :param schedule: Has schedule information for the export. :type schedule: ~azure.mgmt.costmanagement.models.ExportSchedule """ @@ -719,6 +680,7 @@ class Export(ProxyResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'next_run_time_estimate': {'readonly': True}, } _attribute_map = { @@ -729,6 +691,8 @@ class Export(ProxyResource): 'format': {'key': 'properties.format', 'type': 'str'}, 'delivery_info': {'key': 'properties.deliveryInfo', 'type': 'ExportDeliveryInfo'}, 'definition': {'key': 'properties.definition', 'type': 'ExportDefinition'}, + 'run_history': {'key': 'properties.runHistory', 'type': 'ExportExecutionListResult'}, + 'next_run_time_estimate': {'key': 'properties.nextRunTimeEstimate', 'type': 'iso-8601'}, 'schedule': {'key': 'properties.schedule', 'type': 'ExportSchedule'}, } @@ -739,6 +703,7 @@ def __init__( format: Optional[Union[str, "FormatType"]] = None, delivery_info: Optional["ExportDeliveryInfo"] = None, definition: Optional["ExportDefinition"] = None, + run_history: Optional["ExportExecutionListResult"] = None, schedule: Optional["ExportSchedule"] = None, **kwargs ): @@ -746,25 +711,78 @@ def __init__( self.format = format self.delivery_info = delivery_info self.definition = definition + self.run_history = run_history + self.next_run_time_estimate = None self.schedule = schedule +class ExportDataset(msrest.serialization.Model): + """The definition for data in the export. + + :param granularity: The granularity of rows in the export. Currently only 'Daily' is supported. + Possible values include: "Daily". + :type granularity: str or ~azure.mgmt.costmanagement.models.GranularityType + :param configuration: The export dataset configuration. + :type configuration: ~azure.mgmt.costmanagement.models.ExportDatasetConfiguration + """ + + _attribute_map = { + 'granularity': {'key': 'granularity', 'type': 'str'}, + 'configuration': {'key': 'configuration', 'type': 'ExportDatasetConfiguration'}, + } + + def __init__( + self, + *, + granularity: Optional[Union[str, "GranularityType"]] = None, + configuration: Optional["ExportDatasetConfiguration"] = None, + **kwargs + ): + super(ExportDataset, self).__init__(**kwargs) + self.granularity = granularity + self.configuration = configuration + + +class ExportDatasetConfiguration(msrest.serialization.Model): + """The export dataset configuration. Allows columns to be selected for the export. If not provided then the export will include all available columns. + + :param columns: Array of column names to be included in the export. If not provided then the + export will include all available columns. The available columns can vary by customer channel + (see examples). + :type columns: list[str] + """ + + _attribute_map = { + 'columns': {'key': 'columns', 'type': '[str]'}, + } + + def __init__( + self, + *, + columns: Optional[List[str]] = None, + **kwargs + ): + super(ExportDatasetConfiguration, self).__init__(**kwargs) + self.columns = columns + + class ExportDefinition(msrest.serialization.Model): - """The definition of a query. + """The definition of an export. All required parameters must be populated in order to send to Azure. - :param type: Required. The type of the query. Possible values include: "Usage", "ActualCost", - "AmortizedCost". + :param type: Required. The type of the export. Note that 'Usage' is equivalent to 'ActualCost' + and is applicable to exports that do not yet provide data for charges or amortization for + service reservations. Possible values include: "Usage", "ActualCost", "AmortizedCost". :type type: str or ~azure.mgmt.costmanagement.models.ExportType - :param timeframe: Required. The time frame for pulling data for the query. If custom, then a + :param timeframe: Required. The time frame for pulling data for the export. If custom, then a specific time period must be provided. Possible values include: "MonthToDate", "BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom". :type timeframe: str or ~azure.mgmt.costmanagement.models.TimeframeType - :param time_period: Has time period for pulling data for the query. - :type time_period: ~azure.mgmt.costmanagement.models.QueryTimePeriod - :param data_set: Has definition for data in this query. - :type data_set: ~azure.mgmt.costmanagement.models.QueryDatasetAutoGenerated + :param time_period: Has time period for pulling data for the export. + :type time_period: ~azure.mgmt.costmanagement.models.ExportTimePeriod + :param data_set: The definition for data in the export. + :type data_set: ~azure.mgmt.costmanagement.models.ExportDataset """ _validation = { @@ -775,8 +793,8 @@ class ExportDefinition(msrest.serialization.Model): _attribute_map = { 'type': {'key': 'type', 'type': 'str'}, 'timeframe': {'key': 'timeframe', 'type': 'str'}, - 'time_period': {'key': 'timePeriod', 'type': 'QueryTimePeriod'}, - 'data_set': {'key': 'dataSet', 'type': 'QueryDatasetAutoGenerated'}, + 'time_period': {'key': 'timePeriod', 'type': 'ExportTimePeriod'}, + 'data_set': {'key': 'dataSet', 'type': 'ExportDataset'}, } def __init__( @@ -784,8 +802,8 @@ def __init__( *, type: Union[str, "ExportType"], timeframe: Union[str, "TimeframeType"], - time_period: Optional["QueryTimePeriod"] = None, - data_set: Optional["QueryDatasetAutoGenerated"] = None, + time_period: Optional["ExportTimePeriod"] = None, + data_set: Optional["ExportDataset"] = None, **kwargs ): super(ExportDefinition, self).__init__(**kwargs) @@ -861,8 +879,8 @@ def __init__( self.destination = destination -class ExportExecution(Resource): - """A export execution. +class ExportExecution(ProxyResource): + """An export execution. Variables are only populated by the server, and will be ignored when sending a request. @@ -872,41 +890,44 @@ class ExportExecution(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] + :param e_tag: eTag of the resource. To handle concurrent update scenario, this field will be + used to determine whether the user is updating the latest version or not. + :type e_tag: str :param execution_type: The type of the export execution. Possible values include: "OnDemand", "Scheduled". :type execution_type: str or ~azure.mgmt.costmanagement.models.ExecutionType - :param status: The status of the export execution. Possible values include: "Queued", - "InProgress", "Completed", "Failed", "Timeout", "NewDataNotAvailable", "DataNotAvailable". + :param status: The last known status of the export execution. Possible values include: + "Queued", "InProgress", "Completed", "Failed", "Timeout", "NewDataNotAvailable", + "DataNotAvailable". :type status: str or ~azure.mgmt.costmanagement.models.ExecutionStatus :param submitted_by: The identifier for the entity that executed the export. For OnDemand - executions, it is the email id. For Scheduled executions, it is the constant value - System. + executions it is the user email. For scheduled executions it is 'System'. :type submitted_by: str :param submitted_time: The time when export was queued to be executed. :type submitted_time: ~datetime.datetime :param processing_start_time: The time when export was picked up to be executed. :type processing_start_time: ~datetime.datetime - :param processing_end_time: The time when export execution finished. + :param processing_end_time: The time when the export execution finished. :type processing_end_time: ~datetime.datetime - :param file_name: The name of the file export got written to. + :param file_name: The name of the exported file. :type file_name: str - :param run_settings: The common properties of the export. + :param run_settings: The export settings that were in effect for this execution. :type run_settings: ~azure.mgmt.costmanagement.models.CommonExportProperties + :param error: The details of any error. + :type error: ~azure.mgmt.costmanagement.models.ErrorDetails """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'tags': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, 'execution_type': {'key': 'properties.executionType', 'type': 'str'}, 'status': {'key': 'properties.status', 'type': 'str'}, 'submitted_by': {'key': 'properties.submittedBy', 'type': 'str'}, @@ -915,11 +936,13 @@ class ExportExecution(Resource): 'processing_end_time': {'key': 'properties.processingEndTime', 'type': 'iso-8601'}, 'file_name': {'key': 'properties.fileName', 'type': 'str'}, 'run_settings': {'key': 'properties.runSettings', 'type': 'CommonExportProperties'}, + 'error': {'key': 'properties.error', 'type': 'ErrorDetails'}, } def __init__( self, *, + e_tag: Optional[str] = None, execution_type: Optional[Union[str, "ExecutionType"]] = None, status: Optional[Union[str, "ExecutionStatus"]] = None, submitted_by: Optional[str] = None, @@ -928,9 +951,10 @@ def __init__( processing_end_time: Optional[datetime.datetime] = None, file_name: Optional[str] = None, run_settings: Optional["CommonExportProperties"] = None, + error: Optional["ErrorDetails"] = None, **kwargs ): - super(ExportExecution, self).__init__(**kwargs) + super(ExportExecution, self).__init__(e_tag=e_tag, **kwargs) self.execution_type = execution_type self.status = status self.submitted_by = submitted_by @@ -939,14 +963,15 @@ def __init__( self.processing_end_time = processing_end_time self.file_name = file_name self.run_settings = run_settings + self.error = error class ExportExecutionListResult(msrest.serialization.Model): - """Result of listing exports execution history of a export by name. + """Result of listing the execution history of an export. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: The list of export executions. + :ivar value: A list of export executions. :vartype value: list[~azure.mgmt.costmanagement.models.ExportExecution] """ @@ -994,14 +1019,22 @@ def __init__( class ExportProperties(CommonExportProperties): """The properties of the export. + 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 format: The format of the export being delivered. Possible values include: "Csv". + :param format: The format of the export being delivered. Currently only 'Csv' is supported. + Possible values include: "Csv". :type format: str or ~azure.mgmt.costmanagement.models.FormatType :param delivery_info: Required. Has delivery information for the export. :type delivery_info: ~azure.mgmt.costmanagement.models.ExportDeliveryInfo - :param definition: Required. Has definition for the export. + :param definition: Required. Has the definition for the export. :type definition: ~azure.mgmt.costmanagement.models.ExportDefinition + :param run_history: If requested, has the most recent execution history for the export. + :type run_history: ~azure.mgmt.costmanagement.models.ExportExecutionListResult + :ivar next_run_time_estimate: If the export has an active schedule, provides an estimate of the + next execution time. + :vartype next_run_time_estimate: ~datetime.datetime :param schedule: Has schedule information for the export. :type schedule: ~azure.mgmt.costmanagement.models.ExportSchedule """ @@ -1009,12 +1042,15 @@ class ExportProperties(CommonExportProperties): _validation = { 'delivery_info': {'required': True}, 'definition': {'required': True}, + 'next_run_time_estimate': {'readonly': True}, } _attribute_map = { 'format': {'key': 'format', 'type': 'str'}, 'delivery_info': {'key': 'deliveryInfo', 'type': 'ExportDeliveryInfo'}, 'definition': {'key': 'definition', 'type': 'ExportDefinition'}, + 'run_history': {'key': 'runHistory', 'type': 'ExportExecutionListResult'}, + 'next_run_time_estimate': {'key': 'nextRunTimeEstimate', 'type': 'iso-8601'}, 'schedule': {'key': 'schedule', 'type': 'ExportSchedule'}, } @@ -1024,10 +1060,11 @@ def __init__( delivery_info: "ExportDeliveryInfo", definition: "ExportDefinition", format: Optional[Union[str, "FormatType"]] = None, + run_history: Optional["ExportExecutionListResult"] = None, schedule: Optional["ExportSchedule"] = None, **kwargs ): - super(ExportProperties, self).__init__(format=format, delivery_info=delivery_info, definition=definition, **kwargs) + super(ExportProperties, self).__init__(format=format, delivery_info=delivery_info, definition=definition, run_history=run_history, **kwargs) self.schedule = schedule @@ -1064,25 +1101,19 @@ def __init__( class ExportSchedule(msrest.serialization.Model): - """The schedule associated with a export. - - All required parameters must be populated in order to send to Azure. + """The schedule associated with the export. - :param status: The status of the schedule. Whether active or not. If inactive, the export's - scheduled execution is paused. Possible values include: "Active", "Inactive". + :param status: The status of the export's schedule. If 'Inactive', the export's schedule 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". + :param recurrence: The schedule recurrence. Possible values include: "Daily", "Weekly", + "Monthly", "Annually". :type recurrence: str or ~azure.mgmt.costmanagement.models.RecurrenceType :param recurrence_period: Has start and end date of the recurrence. The start date must be in future. If present, the end date must be greater than start date. :type recurrence_period: ~azure.mgmt.costmanagement.models.ExportRecurrencePeriod """ - _validation = { - 'recurrence': {'required': True}, - } - _attribute_map = { 'status': {'key': 'status', 'type': 'str'}, 'recurrence': {'key': 'recurrence', 'type': 'str'}, @@ -1092,8 +1123,8 @@ class ExportSchedule(msrest.serialization.Model): def __init__( self, *, - recurrence: Union[str, "RecurrenceType"], status: Optional[Union[str, "StatusType"]] = None, + recurrence: Optional[Union[str, "RecurrenceType"]] = None, recurrence_period: Optional["ExportRecurrencePeriod"] = None, **kwargs ): @@ -1103,6 +1134,78 @@ def __init__( self.recurrence_period = recurrence_period +class ExportTimePeriod(msrest.serialization.Model): + """The date range for data in the export. This should only be specified with timeFrame set to 'Custom'. The maximum date range is 3 months. + + All required parameters must be populated in order to send to Azure. + + :param from_property: Required. The start date for export data. + :type from_property: ~datetime.datetime + :param to: Required. The end date for export data. + :type to: ~datetime.datetime + """ + + _validation = { + 'from_property': {'required': True}, + 'to': {'required': True}, + } + + _attribute_map = { + 'from_property': {'key': 'from', 'type': 'iso-8601'}, + 'to': {'key': 'to', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + from_property: datetime.datetime, + to: datetime.datetime, + **kwargs + ): + super(ExportTimePeriod, self).__init__(**kwargs) + self.from_property = from_property + self.to = to + + +class ForecastDataset(msrest.serialization.Model): + """The definition of data present in the forecast. + + :param granularity: The granularity of rows in the forecast. Possible values include: "Daily". + :type granularity: str or ~azure.mgmt.costmanagement.models.GranularityType + :param configuration: Has configuration information for the data in the export. The + configuration will be ignored if aggregation and grouping are provided. + :type configuration: ~azure.mgmt.costmanagement.models.QueryDatasetConfiguration + :param aggregation: Dictionary of aggregation expression to use in the forecast. The key of + each item in the dictionary is the alias for the aggregated column. forecast can have up to 2 + aggregation clauses. + :type aggregation: dict[str, ~azure.mgmt.costmanagement.models.QueryAggregation] + :param filter: Has filter expression to use in the forecast. + :type filter: ~azure.mgmt.costmanagement.models.QueryFilter + """ + + _attribute_map = { + 'granularity': {'key': 'granularity', 'type': 'str'}, + 'configuration': {'key': 'configuration', 'type': 'QueryDatasetConfiguration'}, + 'aggregation': {'key': 'aggregation', 'type': '{QueryAggregation}'}, + 'filter': {'key': 'filter', 'type': 'QueryFilter'}, + } + + def __init__( + self, + *, + granularity: Optional[Union[str, "GranularityType"]] = None, + configuration: Optional["QueryDatasetConfiguration"] = None, + aggregation: Optional[Dict[str, "QueryAggregation"]] = None, + filter: Optional["QueryFilter"] = None, + **kwargs + ): + super(ForecastDataset, self).__init__(**kwargs) + self.granularity = granularity + self.configuration = configuration + self.aggregation = aggregation + self.filter = filter + + class ForecastDefinition(msrest.serialization.Model): """The definition of a forecast. @@ -1117,8 +1220,8 @@ class ForecastDefinition(msrest.serialization.Model): :type timeframe: str or ~azure.mgmt.costmanagement.models.ForecastTimeframeType :param time_period: Has time period for pulling data for the forecast. :type time_period: ~azure.mgmt.costmanagement.models.QueryTimePeriod - :param dataset: Has definition for data in this forecast. - :type dataset: ~azure.mgmt.costmanagement.models.QueryDataset + :param dataset: Required. Has definition for data in this forecast. + :type dataset: ~azure.mgmt.costmanagement.models.ForecastDataset :param include_actual_cost: a boolean determining if actualCost will be included. :type include_actual_cost: bool :param include_fresh_partial_cost: a boolean determining if FreshPartialCost will be included. @@ -1128,13 +1231,14 @@ class ForecastDefinition(msrest.serialization.Model): _validation = { 'type': {'required': True}, 'timeframe': {'required': True}, + 'dataset': {'required': True}, } _attribute_map = { 'type': {'key': 'type', 'type': 'str'}, 'timeframe': {'key': 'timeframe', 'type': 'str'}, 'time_period': {'key': 'timePeriod', 'type': 'QueryTimePeriod'}, - 'dataset': {'key': 'dataset', 'type': 'QueryDataset'}, + 'dataset': {'key': 'dataset', 'type': 'ForecastDataset'}, 'include_actual_cost': {'key': 'includeActualCost', 'type': 'bool'}, 'include_fresh_partial_cost': {'key': 'includeFreshPartialCost', 'type': 'bool'}, } @@ -1144,8 +1248,8 @@ def __init__( *, type: Union[str, "ForecastType"], timeframe: Union[str, "ForecastTimeframeType"], + dataset: "ForecastDataset", time_period: Optional["QueryTimePeriod"] = None, - dataset: Optional["QueryDataset"] = None, include_actual_cost: Optional[bool] = None, include_fresh_partial_cost: Optional[bool] = None, **kwargs @@ -1287,37 +1391,6 @@ def __init__( self.next_link = None -class OperationStatus(msrest.serialization.Model): - """The status of the long running operation. - - :param status: The status of the long running operation. - :type status: ~azure.mgmt.costmanagement.models.Status - :param report_url: The URL to download the generated report. - :type report_url: str - :param valid_until: The time at which report URL becomes invalid. - :type valid_until: ~datetime.datetime - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'Status'}, - 'report_url': {'key': 'properties.reportUrl', 'type': 'str'}, - 'valid_until': {'key': 'properties.validUntil', 'type': 'iso-8601'}, - } - - def __init__( - self, - *, - status: Optional["Status"] = None, - report_url: Optional[str] = None, - valid_until: Optional[datetime.datetime] = None, - **kwargs - ): - super(OperationStatus, self).__init__(**kwargs) - self.status = status - self.report_url = report_url - self.valid_until = valid_until - - class PivotProperties(msrest.serialization.Model): """Each pivot must contain a 'type' and 'name'. @@ -1344,46 +1417,6 @@ def __init__( self.name = name -class ProxySettingResource(msrest.serialization.Model): - """The Resource model definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar kind: Resource kind. - :vartype kind: str - :ivar type: Resource type. - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'kind': {'readonly': True, 'max_length': 10, 'min_length': 0}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ProxySettingResource, self).__init__(**kwargs) - self.id = None - self.name = None - self.kind = None - self.type = None - - class QueryAggregation(msrest.serialization.Model): """The aggregation expression to be used in the query. @@ -1451,9 +1484,8 @@ class QueryComparisonExpression(msrest.serialization.Model): :param name: Required. The name of the column to use in comparison. :type name: str - :param operator: Required. The operator to use for comparison. Possible values include: "In", - "Contains". - :type operator: str or ~azure.mgmt.costmanagement.models.OperatorType + :param operator: Required. The operator to use for comparison. Possible values include: "In". + :type operator: str or ~azure.mgmt.costmanagement.models.QueryOperatorType :param values: Required. Array of values to use for comparison. :type values: list[str] """ @@ -1474,7 +1506,7 @@ def __init__( self, *, name: str, - operator: Union[str, "OperatorType"], + operator: Union[str, "QueryOperatorType"], values: List[str], **kwargs ): @@ -1499,7 +1531,8 @@ class QueryDataset(msrest.serialization.Model): :param grouping: Array of group by expression to use in the query. Query can have up to 2 group by clauses. :type grouping: list[~azure.mgmt.costmanagement.models.QueryGrouping] - :param filter: Has filter expression to use in the query. + :param filter: The filter expression to use in the query. Please reference our Query API REST + documentation for how to properly format the filter. :type filter: ~azure.mgmt.costmanagement.models.QueryFilter """ @@ -1533,55 +1566,6 @@ def __init__( self.filter = filter -class QueryDatasetAutoGenerated(msrest.serialization.Model): - """The definition of data present in the query. - - :param granularity: The granularity of rows in the query. Possible values include: "Daily". - :type granularity: str or ~azure.mgmt.costmanagement.models.GranularityType - :param configuration: Has configuration information for the data in the export. The - configuration will be ignored if aggregation and grouping are provided. - :type configuration: ~azure.mgmt.costmanagement.models.QueryDatasetConfiguration - :param aggregation: Dictionary of aggregation expression to use in the query. The key of each - item in the dictionary is the alias for the aggregated column. Query can have up to 2 - aggregation clauses. - :type aggregation: dict[str, ~azure.mgmt.costmanagement.models.QueryAggregation] - :param grouping: Array of group by expression to use in the query. Query can have up to 2 group - by clauses. - :type grouping: list[~azure.mgmt.costmanagement.models.QueryGrouping] - :param filter: Has filter expression to use in the query. - :type filter: ~azure.mgmt.costmanagement.models.QueryFilterAutoGenerated - """ - - _validation = { - 'grouping': {'max_items': 2, 'min_items': 0}, - } - - _attribute_map = { - 'granularity': {'key': 'granularity', 'type': 'str'}, - 'configuration': {'key': 'configuration', 'type': 'QueryDatasetConfiguration'}, - 'aggregation': {'key': 'aggregation', 'type': '{QueryAggregation}'}, - 'grouping': {'key': 'grouping', 'type': '[QueryGrouping]'}, - 'filter': {'key': 'filter', 'type': 'QueryFilterAutoGenerated'}, - } - - def __init__( - self, - *, - granularity: Optional[Union[str, "GranularityType"]] = None, - configuration: Optional["QueryDatasetConfiguration"] = None, - aggregation: Optional[Dict[str, "QueryAggregation"]] = None, - grouping: Optional[List["QueryGrouping"]] = None, - filter: Optional["QueryFilterAutoGenerated"] = None, - **kwargs - ): - super(QueryDatasetAutoGenerated, self).__init__(**kwargs) - self.granularity = granularity - self.configuration = configuration - self.aggregation = aggregation - self.grouping = grouping - self.filter = filter - - class QueryDatasetConfiguration(msrest.serialization.Model): """The configuration of dataset in the query. @@ -1618,13 +1602,14 @@ class QueryDefinition(msrest.serialization.Model): :type timeframe: str or ~azure.mgmt.costmanagement.models.TimeframeType :param time_period: Has time period for pulling data for the query. :type time_period: ~azure.mgmt.costmanagement.models.QueryTimePeriod - :param dataset: Has definition for data in this query. + :param dataset: Required. Has definition for data in this query. :type dataset: ~azure.mgmt.costmanagement.models.QueryDataset """ _validation = { 'type': {'required': True}, 'timeframe': {'required': True}, + 'dataset': {'required': True}, } _attribute_map = { @@ -1639,8 +1624,8 @@ def __init__( *, type: Union[str, "ExportType"], timeframe: Union[str, "TimeframeType"], + dataset: "QueryDataset", time_period: Optional["QueryTimePeriod"] = None, - dataset: Optional["QueryDataset"] = None, **kwargs ): super(QueryDefinition, self).__init__(**kwargs) @@ -1657,10 +1642,12 @@ class QueryFilter(msrest.serialization.Model): :type and_property: list[~azure.mgmt.costmanagement.models.QueryFilter] :param or_property: The logical "OR" expression. Must have at least 2 items. :type or_property: list[~azure.mgmt.costmanagement.models.QueryFilter] - :param dimensions: Has comparison expression for a dimension. - :type dimensions: ~azure.mgmt.costmanagement.models.QueryComparisonExpression - :param tags: A set of tags. Has comparison expression for a tag. - :type tags: ~azure.mgmt.costmanagement.models.QueryComparisonExpression + :param not_property: The logical "NOT" expression. + :type not_property: ~azure.mgmt.costmanagement.models.QueryFilter + :param dimension: Has comparison expression for a dimension. + :type dimension: ~azure.mgmt.costmanagement.models.QueryComparisonExpression + :param tag: Has comparison expression for a tag. + :type tag: ~azure.mgmt.costmanagement.models.QueryComparisonExpression """ _validation = { @@ -1671,8 +1658,9 @@ class QueryFilter(msrest.serialization.Model): _attribute_map = { 'and_property': {'key': 'and', 'type': '[QueryFilter]'}, 'or_property': {'key': 'or', 'type': '[QueryFilter]'}, - 'dimensions': {'key': 'dimensions', 'type': 'QueryComparisonExpression'}, - 'tags': {'key': 'tags', 'type': 'QueryComparisonExpression'}, + 'not_property': {'key': 'not', 'type': 'QueryFilter'}, + 'dimension': {'key': 'dimension', 'type': 'QueryComparisonExpression'}, + 'tag': {'key': 'tag', 'type': 'QueryComparisonExpression'}, } def __init__( @@ -1680,56 +1668,17 @@ def __init__( *, and_property: Optional[List["QueryFilter"]] = None, or_property: Optional[List["QueryFilter"]] = None, - dimensions: Optional["QueryComparisonExpression"] = None, - tags: Optional["QueryComparisonExpression"] = None, + not_property: Optional["QueryFilter"] = None, + dimension: Optional["QueryComparisonExpression"] = None, + tag: Optional["QueryComparisonExpression"] = None, **kwargs ): super(QueryFilter, self).__init__(**kwargs) self.and_property = and_property self.or_property = or_property - self.dimensions = dimensions - self.tags = tags - - -class QueryFilterAutoGenerated(msrest.serialization.Model): - """The filter expression to be used in the export. - - :param and_property: The logical "AND" expression. Must have at least 2 items. - :type and_property: list[~azure.mgmt.costmanagement.models.QueryFilterAutoGenerated] - :param or_property: The logical "OR" expression. Must have at least 2 items. - :type or_property: list[~azure.mgmt.costmanagement.models.QueryFilterAutoGenerated] - :param dimensions: Has comparison expression for a dimension. - :type dimensions: ~azure.mgmt.costmanagement.models.QueryComparisonExpression - :param tags: A set of tags. Has comparison expression for a tag. - :type tags: ~azure.mgmt.costmanagement.models.QueryComparisonExpression - """ - - _validation = { - 'and_property': {'min_items': 2}, - 'or_property': {'min_items': 2}, - } - - _attribute_map = { - 'and_property': {'key': 'and', 'type': '[QueryFilterAutoGenerated]'}, - 'or_property': {'key': 'or', 'type': '[QueryFilterAutoGenerated]'}, - 'dimensions': {'key': 'dimensions', 'type': 'QueryComparisonExpression'}, - 'tags': {'key': 'tags', 'type': 'QueryComparisonExpression'}, - } - - def __init__( - self, - *, - and_property: Optional[List["QueryFilterAutoGenerated"]] = None, - or_property: Optional[List["QueryFilterAutoGenerated"]] = None, - dimensions: Optional["QueryComparisonExpression"] = None, - tags: Optional["QueryComparisonExpression"] = None, - **kwargs - ): - super(QueryFilterAutoGenerated, self).__init__(**kwargs) - self.and_property = and_property - self.or_property = or_property - self.dimensions = dimensions - self.tags = tags + self.not_property = not_property + self.dimension = dimension + self.tag = tag class QueryGrouping(msrest.serialization.Model): @@ -1779,13 +1728,6 @@ class QueryResult(Resource): :vartype type: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] - :param e_tag: eTag of the resource. To handle concurrent update scenario, this field will be - used to determine whether the user is updating the latest version or not. - :type e_tag: str - :ivar location: Resource location. - :vartype location: str - :ivar sku: Resource SKU. - :vartype sku: str :param next_link: The link (url) to the next page of results. :type next_link: str :param columns: Array of columns. @@ -1799,8 +1741,6 @@ class QueryResult(Resource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'tags': {'readonly': True}, - 'location': {'readonly': True}, - 'sku': {'readonly': True}, } _attribute_map = { @@ -1808,9 +1748,6 @@ class QueryResult(Resource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'e_tag': {'key': 'eTag', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'str'}, 'next_link': {'key': 'properties.nextLink', 'type': 'str'}, 'columns': {'key': 'properties.columns', 'type': '[QueryColumn]'}, 'rows': {'key': 'properties.rows', 'type': '[[object]]'}, @@ -1819,16 +1756,12 @@ class QueryResult(Resource): def __init__( self, *, - e_tag: Optional[str] = None, next_link: Optional[str] = None, columns: Optional[List["QueryColumn"]] = None, rows: Optional[List[List[Any]]] = None, **kwargs ): super(QueryResult, self).__init__(**kwargs) - self.e_tag = e_tag - self.location = None - self.sku = None self.next_link = next_link self.columns = columns self.rows = rows @@ -1996,6 +1929,61 @@ def __init__( self.filter = filter +class ReportConfigDatasetAutoGenerated(msrest.serialization.Model): + """The definition of data present in the report. + + :param granularity: The granularity of rows in the report. Possible values include: "Daily", + "Monthly". + :type granularity: str or ~azure.mgmt.costmanagement.models.ReportGranularityType + :param configuration: Has configuration information for the data in the report. The + configuration will be ignored if aggregation and grouping are provided. + :type configuration: ~azure.mgmt.costmanagement.models.ReportConfigDatasetConfiguration + :param aggregation: Dictionary of aggregation expression to use in the report. The key of each + item in the dictionary is the alias for the aggregated column. Report can have up to 2 + aggregation clauses. + :type aggregation: dict[str, ~azure.mgmt.costmanagement.models.ReportConfigAggregation] + :param grouping: Array of group by expression to use in the report. Report 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.ReportConfigFilterAutoGenerated + """ + + _validation = { + 'grouping': {'max_items': 2, 'min_items': 0}, + } + + _attribute_map = { + 'granularity': {'key': 'granularity', 'type': 'str'}, + 'configuration': {'key': 'configuration', 'type': 'ReportConfigDatasetConfiguration'}, + 'aggregation': {'key': 'aggregation', 'type': '{ReportConfigAggregation}'}, + 'grouping': {'key': 'grouping', 'type': '[ReportConfigGrouping]'}, + 'sorting': {'key': 'sorting', 'type': '[ReportConfigSorting]'}, + 'filter': {'key': 'filter', 'type': 'ReportConfigFilterAutoGenerated'}, + } + + def __init__( + self, + *, + granularity: Optional[Union[str, "ReportGranularityType"]] = None, + configuration: Optional["ReportConfigDatasetConfiguration"] = None, + aggregation: Optional[Dict[str, "ReportConfigAggregation"]] = None, + grouping: Optional[List["ReportConfigGrouping"]] = None, + sorting: Optional[List["ReportConfigSorting"]] = None, + filter: Optional["ReportConfigFilterAutoGenerated"] = None, + **kwargs + ): + super(ReportConfigDatasetAutoGenerated, self).__init__(**kwargs) + self.granularity = granularity + self.configuration = configuration + self.aggregation = aggregation + self.grouping = grouping + self.sorting = sorting + self.filter = filter + + class ReportConfigDatasetConfiguration(msrest.serialization.Model): """The configuration of dataset in the report. @@ -2018,6 +2006,54 @@ def __init__( self.columns = columns +class ReportConfigDefinition(msrest.serialization.Model): + """The definition of a report config. + + All required parameters must be populated in order to send to Azure. + + :param 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. Possible values include: + "Usage". + :type type: str or ~azure.mgmt.costmanagement.models.ReportType + :param timeframe: Required. The time frame for pulling data for the report. If custom, then a + specific time period must be provided. Possible values include: "WeekToDate", "MonthToDate", + "YearToDate", "Custom". + :type timeframe: str or ~azure.mgmt.costmanagement.models.ReportTimeframeType + :param time_period: Has time period for pulling data for the report. + :type time_period: ~azure.mgmt.costmanagement.models.ReportConfigTimePeriod + :param dataset: Has definition for data in this report config. + :type dataset: ~azure.mgmt.costmanagement.models.ReportConfigDatasetAutoGenerated + """ + + _validation = { + 'type': {'required': True}, + 'timeframe': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'timeframe': {'key': 'timeframe', 'type': 'str'}, + 'time_period': {'key': 'timePeriod', 'type': 'ReportConfigTimePeriod'}, + 'dataset': {'key': 'dataset', 'type': 'ReportConfigDatasetAutoGenerated'}, + } + + def __init__( + self, + *, + type: Union[str, "ReportType"], + timeframe: Union[str, "ReportTimeframeType"], + time_period: Optional["ReportConfigTimePeriod"] = None, + dataset: Optional["ReportConfigDatasetAutoGenerated"] = None, + **kwargs + ): + super(ReportConfigDefinition, self).__init__(**kwargs) + self.type = type + self.timeframe = timeframe + self.time_period = time_period + self.dataset = dataset + + class ReportConfigFilter(msrest.serialization.Model): """The filter expression to be used in the report. @@ -2025,14 +2061,12 @@ class ReportConfigFilter(msrest.serialization.Model): :type and_property: list[~azure.mgmt.costmanagement.models.ReportConfigFilter] :param or_property: The logical "OR" expression. Must have at least 2 items. :type or_property: list[~azure.mgmt.costmanagement.models.ReportConfigFilter] - :param dimensions: Has comparison expression for a dimension. - :type dimensions: ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression - :param tags: A set of tags. Has comparison expression for a tag. - :type tags: ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression - :param tag_key: Has comparison expression for a tag key. - :type tag_key: ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression - :param tag_value: Has comparison expression for a tag value. - :type tag_value: ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression + :param not_property: The logical "NOT" expression. + :type not_property: ~azure.mgmt.costmanagement.models.ReportConfigFilter + :param dimension: Has comparison expression for a dimension. + :type dimension: ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression + :param tag: Has comparison expression for a tag. + :type tag: ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression """ _validation = { @@ -2043,10 +2077,9 @@ class ReportConfigFilter(msrest.serialization.Model): _attribute_map = { 'and_property': {'key': 'and', 'type': '[ReportConfigFilter]'}, 'or_property': {'key': 'or', 'type': '[ReportConfigFilter]'}, - 'dimensions': {'key': 'dimensions', 'type': 'ReportConfigComparisonExpression'}, - 'tags': {'key': 'tags', 'type': 'ReportConfigComparisonExpression'}, - 'tag_key': {'key': 'tagKey', 'type': 'ReportConfigComparisonExpression'}, - 'tag_value': {'key': 'tagValue', 'type': 'ReportConfigComparisonExpression'}, + 'not_property': {'key': 'not', 'type': 'ReportConfigFilter'}, + 'dimension': {'key': 'dimension', 'type': 'ReportConfigComparisonExpression'}, + 'tag': {'key': 'tag', 'type': 'ReportConfigComparisonExpression'}, } def __init__( @@ -2054,19 +2087,63 @@ def __init__( *, and_property: Optional[List["ReportConfigFilter"]] = None, or_property: Optional[List["ReportConfigFilter"]] = None, - dimensions: Optional["ReportConfigComparisonExpression"] = None, - tags: Optional["ReportConfigComparisonExpression"] = None, - tag_key: Optional["ReportConfigComparisonExpression"] = None, - tag_value: Optional["ReportConfigComparisonExpression"] = None, + not_property: Optional["ReportConfigFilter"] = None, + dimension: Optional["ReportConfigComparisonExpression"] = None, + tag: Optional["ReportConfigComparisonExpression"] = None, **kwargs ): super(ReportConfigFilter, self).__init__(**kwargs) self.and_property = and_property self.or_property = or_property - self.dimensions = dimensions - self.tags = tags - self.tag_key = tag_key - self.tag_value = tag_value + self.not_property = not_property + self.dimension = dimension + self.tag = tag + + +class ReportConfigFilterAutoGenerated(msrest.serialization.Model): + """The filter expression to be used in the report. + + :param and_property: The logical "AND" expression. Must have at least 2 items. + :type and_property: list[~azure.mgmt.costmanagement.models.ReportConfigFilterAutoGenerated] + :param or_property: The logical "OR" expression. Must have at least 2 items. + :type or_property: list[~azure.mgmt.costmanagement.models.ReportConfigFilterAutoGenerated] + :param not_property: The logical "NOT" expression. + :type not_property: ~azure.mgmt.costmanagement.models.ReportConfigFilterAutoGenerated + :param dimension: Has comparison expression for a dimension. + :type dimension: ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression + :param tag: Has comparison expression for a tag. + :type tag: ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression + """ + + _validation = { + 'and_property': {'min_items': 2}, + 'or_property': {'min_items': 2}, + } + + _attribute_map = { + 'and_property': {'key': 'and', 'type': '[ReportConfigFilterAutoGenerated]'}, + 'or_property': {'key': 'or', 'type': '[ReportConfigFilterAutoGenerated]'}, + 'not_property': {'key': 'not', 'type': 'ReportConfigFilterAutoGenerated'}, + 'dimension': {'key': 'dimension', 'type': 'ReportConfigComparisonExpression'}, + 'tag': {'key': 'tag', 'type': 'ReportConfigComparisonExpression'}, + } + + def __init__( + self, + *, + and_property: Optional[List["ReportConfigFilterAutoGenerated"]] = None, + or_property: Optional[List["ReportConfigFilterAutoGenerated"]] = None, + not_property: Optional["ReportConfigFilterAutoGenerated"] = None, + dimension: Optional["ReportConfigComparisonExpression"] = None, + tag: Optional["ReportConfigComparisonExpression"] = None, + **kwargs + ): + super(ReportConfigFilterAutoGenerated, self).__init__(**kwargs) + self.and_property = and_property + self.or_property = or_property + self.not_property = not_property + self.dimension = dimension + self.tag = tag class ReportConfigGrouping(msrest.serialization.Model): @@ -2169,113 +2246,6 @@ def __init__( self.to = to -class Setting(ProxySettingResource): - """State of the myscope setting. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar kind: Resource kind. - :vartype kind: str - :ivar type: Resource type. - :vartype type: str - :param scope: Sets the default scope the current user will see when they sign into Azure Cost - Management in the Azure portal. - :type scope: str - :param start_on: Indicates what scope Cost Management in the Azure portal should default to. - Allowed values: LastUsed. Possible values include: "LastUsed", "ScopePicker", "SpecificScope". - :type start_on: str or ~azure.mgmt.costmanagement.models.SettingsPropertiesStartOn - :param cache: Array of scopes with additional details used by Cost Management in the Azure - portal. - :type cache: list[~azure.mgmt.costmanagement.models.CacheItem] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'kind': {'readonly': True, 'max_length': 10, 'min_length': 0}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'scope': {'key': 'properties.scope', 'type': 'str'}, - 'start_on': {'key': 'properties.startOn', 'type': 'str'}, - 'cache': {'key': 'properties.cache', 'type': '[CacheItem]'}, - } - - def __init__( - self, - *, - scope: Optional[str] = None, - start_on: Optional[Union[str, "SettingsPropertiesStartOn"]] = None, - cache: Optional[List["CacheItem"]] = None, - **kwargs - ): - super(Setting, self).__init__(**kwargs) - self.scope = scope - self.start_on = start_on - self.cache = cache - - -class SettingsListResult(msrest.serialization.Model): - """Result of listing settings. It contains a list of available settings. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of settings. - :vartype value: list[~azure.mgmt.costmanagement.models.Setting] - :ivar next_link: The link (url) to the next page of results. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True, 'max_items': 10, 'min_items': 0}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Setting]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SettingsListResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class Status(msrest.serialization.Model): - """The status of the long running operation. - - :param status: The status of the long running operation. Possible values include: "Running", - "Completed", "Failed". - :type status: str or ~azure.mgmt.costmanagement.models.OperationStatusType - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - *, - status: Optional[Union[str, "OperationStatusType"]] = None, - **kwargs - ): - super(Status, self).__init__(**kwargs) - self.status = status - - class View(ProxyResource): """States and configurations of Cost Analysis. @@ -2314,10 +2284,6 @@ class View(ProxyResource): :vartype created_on: ~datetime.datetime :ivar modified_on: Date when the user last modified this view. :vartype modified_on: ~datetime.datetime - :ivar date_range: Selected date range for viewing cost in. - :vartype date_range: str - :ivar currency: Selected currency. - :vartype currency: str :param chart: Chart type of the main view in Cost Analysis. Required. Possible values include: "Area", "Line", "StackedColumn", "GroupedColumn", "Table". :type chart: str or ~azure.mgmt.costmanagement.models.ChartType @@ -2341,10 +2307,8 @@ class View(ProxyResource): :type timeframe: str or ~azure.mgmt.costmanagement.models.ReportTimeframeType :param time_period: Has time period for pulling data for the report. :type time_period: ~azure.mgmt.costmanagement.models.ReportConfigTimePeriod - :param data_set: Has definition for data in this report config. - :type data_set: ~azure.mgmt.costmanagement.models.ReportConfigDataset - :ivar include_monetary_commitment: Include monetary commitment. - :vartype include_monetary_commitment: bool + :param dataset: Has definition for data in this report config. + :type dataset: ~azure.mgmt.costmanagement.models.ReportConfigDataset """ _validation = { @@ -2353,9 +2317,6 @@ class View(ProxyResource): 'type': {'readonly': True}, 'created_on': {'readonly': True}, 'modified_on': {'readonly': True}, - 'date_range': {'readonly': True}, - 'currency': {'readonly': True}, - 'include_monetary_commitment': {'readonly': True}, } _attribute_map = { @@ -2367,8 +2328,6 @@ class View(ProxyResource): 'scope': {'key': 'properties.scope', 'type': 'str'}, 'created_on': {'key': 'properties.createdOn', 'type': 'iso-8601'}, 'modified_on': {'key': 'properties.modifiedOn', 'type': 'iso-8601'}, - 'date_range': {'key': 'properties.dateRange', 'type': 'str'}, - 'currency': {'key': 'properties.currency', 'type': 'str'}, 'chart': {'key': 'properties.chart', 'type': 'str'}, 'accumulated': {'key': 'properties.accumulated', 'type': 'str'}, 'metric': {'key': 'properties.metric', 'type': 'str'}, @@ -2377,8 +2336,7 @@ class View(ProxyResource): 'type_properties_query_type': {'key': 'properties.query.type', 'type': 'str'}, 'timeframe': {'key': 'properties.query.timeframe', 'type': 'str'}, 'time_period': {'key': 'properties.query.timePeriod', 'type': 'ReportConfigTimePeriod'}, - 'data_set': {'key': 'properties.query.dataSet', 'type': 'ReportConfigDataset'}, - 'include_monetary_commitment': {'key': 'properties.query.includeMonetaryCommitment', 'type': 'bool'}, + 'dataset': {'key': 'properties.query.dataset', 'type': 'ReportConfigDataset'}, } def __init__( @@ -2395,7 +2353,7 @@ def __init__( type_properties_query_type: Optional[Union[str, "ReportType"]] = None, timeframe: Optional[Union[str, "ReportTimeframeType"]] = None, time_period: Optional["ReportConfigTimePeriod"] = None, - data_set: Optional["ReportConfigDataset"] = None, + dataset: Optional["ReportConfigDataset"] = None, **kwargs ): super(View, self).__init__(e_tag=e_tag, **kwargs) @@ -2403,8 +2361,6 @@ def __init__( self.scope = scope self.created_on = None self.modified_on = None - self.date_range = None - self.currency = None self.chart = chart self.accumulated = accumulated self.metric = metric @@ -2413,8 +2369,7 @@ def __init__( self.type_properties_query_type = type_properties_query_type self.timeframe = timeframe self.time_period = time_period - self.data_set = data_set - self.include_monetary_commitment = None + self.dataset = dataset class ViewListResult(msrest.serialization.Model): diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py index c70a4cb564cb..6065b201f9cc 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py @@ -6,24 +6,20 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._settings_operations import SettingsOperations from ._views_operations import ViewsOperations from ._alerts_operations import AlertsOperations from ._forecast_operations import ForecastOperations from ._dimensions_operations import DimensionsOperations from ._query_operations import QueryOperations -from ._generate_reservation_details_report_operations import GenerateReservationDetailsReportOperations from ._operations import Operations from ._exports_operations import ExportsOperations __all__ = [ - 'SettingsOperations', 'ViewsOperations', 'AlertsOperations', 'ForecastOperations', 'DimensionsOperations', 'QueryOperations', - 'GenerateReservationDetailsReportOperations', 'Operations', 'ExportsOperations', ] diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_alerts_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_alerts_operations.py index 13969e75db88..7ba05a3121b7 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_alerts_operations.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_alerts_operations.py @@ -79,7 +79,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" accept = "application/json" # Construct URL @@ -152,7 +152,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" accept = "application/json" # Construct URL @@ -229,7 +229,7 @@ def dismiss( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -296,7 +296,7 @@ def list_external( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" accept = "application/json" # Construct URL diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_dimensions_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_dimensions_operations.py index ff843ebbf69e..c8bc8ef51142 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_dimensions_operations.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_dimensions_operations.py @@ -88,7 +88,7 @@ def list( :type top: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DimensionsListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.costmanagement.models.DimensionsListResultor None] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.costmanagement.models.DimensionsListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DimensionsListResult"] @@ -96,7 +96,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" accept = "application/json" def prepare_request(next_link=None): @@ -143,7 +143,7 @@ def get_next(next_link=None): pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 204]: + if response.status_code not in [200]: error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -197,7 +197,7 @@ def by_external_cloud_provider_type( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_exports_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_exports_operations.py index 89eefe5166d4..167d7caeab38 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_exports_operations.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_exports_operations.py @@ -47,12 +47,13 @@ def __init__(self, client, config, serializer, deserializer): def list( self, scope, # type: str + expand=None, # type: Optional[str] **kwargs # type: Any ): # type: (...) -> "_models.ExportListResult" """The operation to list all exports at the given scope. - :param scope: The scope associated with query and export operations. This includes + :param scope: The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and @@ -69,6 +70,9 @@ def list( '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. :type scope: str + :param expand: May be used to expand the properties within an export. Currently only + 'runHistory' is supported and will return information for the last execution of each export. + :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ExportListResult, or the result of cls(response) :rtype: ~azure.mgmt.costmanagement.models.ExportListResult @@ -79,7 +83,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" accept = "application/json" # Construct URL @@ -92,6 +96,8 @@ def list( # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') # Construct headers header_parameters = {} # type: Dict[str, Any] @@ -118,12 +124,13 @@ def get( self, scope, # type: str export_name, # type: str + expand=None, # type: Optional[str] **kwargs # type: Any ): # type: (...) -> "_models.Export" """The operation to get the export for the defined scope by export name. - :param scope: The scope associated with query and export operations. This includes + :param scope: The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and @@ -142,6 +149,9 @@ def get( :type scope: str :param export_name: Export Name. :type export_name: str + :param expand: May be used to expand the properties within an export. Currently only + 'runHistory' is supported and will return information for the last 10 executions of the export. + :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Export, or the result of cls(response) :rtype: ~azure.mgmt.costmanagement.models.Export @@ -152,7 +162,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" accept = "application/json" # Construct URL @@ -166,6 +176,8 @@ def get( # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') # Construct headers header_parameters = {} # type: Dict[str, Any] @@ -200,7 +212,7 @@ def create_or_update( the request. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag. - :param scope: The scope associated with query and export operations. This includes + :param scope: The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and @@ -231,7 +243,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -285,7 +297,7 @@ def delete( # type: (...) -> None """The operation to delete a export. - :param scope: The scope associated with query and export operations. This includes + :param scope: The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and @@ -314,7 +326,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" accept = "application/json" # Construct URL @@ -354,9 +366,9 @@ def execute( **kwargs # type: Any ): # type: (...) -> None - """The operation to execute a export. + """The operation to execute an export. - :param scope: The scope associated with query and export operations. This includes + :param scope: The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and @@ -385,7 +397,7 @@ def execute( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" accept = "application/json" # Construct URL @@ -425,9 +437,9 @@ def get_execution_history( **kwargs # type: Any ): # type: (...) -> "_models.ExportExecutionListResult" - """The operation to get the execution history of an export for the defined scope by export name. + """The operation to get the execution history of an export for the defined scope and export name. - :param scope: The scope associated with query and export operations. This includes + :param scope: The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and @@ -456,7 +468,7 @@ def get_execution_history( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" accept = "application/json" # Construct URL diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_forecast_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_forecast_operations.py index 71c2e338e1e5..81ace4371619 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_forecast_operations.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_forecast_operations.py @@ -51,7 +51,7 @@ def usage( filter=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Optional["_models.QueryResult"] + # type: (...) -> "_models.QueryResult" """Lists the forecast charges for scope defined. :param scope: The scope associated with forecast operations. This includes @@ -79,15 +79,15 @@ def usage( :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response :return: QueryResult, or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.QueryResult or None + :rtype: ~azure.mgmt.costmanagement.models.QueryResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.QueryResult"]] + cls = kwargs.pop('cls', None) # type: ClsType["_models.QueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -116,14 +116,12 @@ def usage( pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 204]: + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('QueryResult', pipeline_response) + deserialized = self._deserialize('QueryResult', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) @@ -165,7 +163,7 @@ def external_cloud_provider_usage( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_generate_reservation_details_report_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_generate_reservation_details_report_operations.py deleted file mode 100644 index 4c93c64e8755..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_generate_reservation_details_report_operations.py +++ /dev/null @@ -1,310 +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 typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class GenerateReservationDetailsReportOperations(object): - """GenerateReservationDetailsReportOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.costmanagement.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def _by_billing_account_id_initial( - self, - billing_account_id, # type: str - start_date, # type: str - end_date, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.OperationStatus"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatus"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self._by_billing_account_id_initial.metadata['url'] # type: ignore - 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 = {} # type: Dict[str, Any] - query_parameters['startDate'] = self._serialize.query("start_date", start_date, 'str') - query_parameters['endDate'] = self._serialize.query("end_date", end_date, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - _by_billing_account_id_initial.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/generateReservationDetailsReport'} # type: ignore - - def begin_by_billing_account_id( - self, - billing_account_id, # type: str - start_date, # type: str - end_date, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OperationStatus"] - """Generates the reservations details report for provided date range asynchronously based on - enrollment id. - - :param billing_account_id: Enrollment ID (Legacy BillingAccount ID). - :type billing_account_id: str - :param start_date: Start Date. - :type start_date: str - :param end_date: End Date. - :type end_date: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either OperationStatus or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.costmanagement.models.OperationStatus] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatus"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._by_billing_account_id_initial( - billing_account_id=billing_account_id, - start_date=start_date, - end_date=end_date, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('OperationStatus', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_by_billing_account_id.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/generateReservationDetailsReport'} # type: ignore - - def _by_billing_profile_id_initial( - self, - billing_account_id, # type: str - billing_profile_id, # type: str - start_date, # type: str - end_date, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.OperationStatus"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatus"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self._by_billing_profile_id_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), - 'billingProfileId': self._serialize.url("billing_profile_id", billing_profile_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['startDate'] = self._serialize.query("start_date", start_date, 'str') - query_parameters['endDate'] = self._serialize.query("end_date", end_date, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', pipeline_response) - - if response.status_code == 202: - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - _by_billing_profile_id_initial.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/generateReservationDetailsReport'} # type: ignore - - def begin_by_billing_profile_id( - self, - billing_account_id, # type: str - billing_profile_id, # type: str - start_date, # type: str - end_date, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OperationStatus"] - """Generates the reservations details report for provided date range asynchronously by billing - profile. - - :param billing_account_id: BillingAccount ID. - :type billing_account_id: str - :param billing_profile_id: BillingProfile ID. - :type billing_profile_id: str - :param start_date: Start Date. - :type start_date: str - :param end_date: End Date. - :type end_date: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either OperationStatus or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.costmanagement.models.OperationStatus] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatus"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._by_billing_profile_id_initial( - billing_account_id=billing_account_id, - billing_profile_id=billing_profile_id, - start_date=start_date, - end_date=end_date, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('OperationStatus', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), - 'billingProfileId': self._serialize.url("billing_profile_id", billing_profile_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_by_billing_profile_id.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/generateReservationDetailsReport'} # type: ignore diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_operations.py index 4a538a66f2c5..aad95f1eab95 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_operations.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_operations.py @@ -62,7 +62,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_query_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_query_operations.py index b5dd2dc857ec..18a3a4cb005c 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_query_operations.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_query_operations.py @@ -50,7 +50,7 @@ def usage( parameters, # type: "_models.QueryDefinition" **kwargs # type: Any ): - # type: (...) -> Optional["_models.QueryResult"] + # type: (...) -> "_models.QueryResult" """Query the usage data for scope defined. :param scope: The scope associated with query and export operations. This includes @@ -74,15 +74,15 @@ def usage( :type parameters: ~azure.mgmt.costmanagement.models.QueryDefinition :keyword callable cls: A custom type or function that will be passed the direct response :return: QueryResult, or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.QueryResult or None + :rtype: ~azure.mgmt.costmanagement.models.QueryResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.QueryResult"]] + cls = kwargs.pop('cls', None) # type: ClsType["_models.QueryResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -109,14 +109,12 @@ def usage( pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 204]: + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('QueryResult', pipeline_response) + deserialized = self._deserialize('QueryResult', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) @@ -153,7 +151,7 @@ def usage_by_external_cloud_provider_type( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_settings_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_settings_operations.py deleted file mode 100644 index 3140937a8c4c..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_settings_operations.py +++ /dev/null @@ -1,281 +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 typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class SettingsOperations(object): - """SettingsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.costmanagement.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.SettingsListResult"] - """Lists all of the settings that have been customized. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SettingsListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.costmanagement.models.SettingsListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SettingsListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('SettingsListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/providers/Microsoft.CostManagement/settings'} # type: ignore - - def get( - self, - setting_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Setting" - """Retrieves the current value for a specific setting. - - :param setting_name: Name of the setting. Allowed values: myscope. - :type setting_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Setting, or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.Setting - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Setting"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'settingName': self._serialize.url("setting_name", setting_name, 'str', max_length=32, min_length=0), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Setting', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/providers/Microsoft.CostManagement/settings/{settingName}'} # type: ignore - - def create_or_update( - self, - setting_name, # type: str - parameters, # type: "_models.Setting" - **kwargs # type: Any - ): - # type: (...) -> "_models.Setting" - """Sets a new value for a specific setting. - - :param setting_name: Name of the setting. Allowed values: myscope. - :type setting_name: str - :param parameters: Body supplied to the CreateOrUpdate setting operation. - :type parameters: ~azure.mgmt.costmanagement.models.Setting - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Setting, or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.Setting - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Setting"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'settingName': self._serialize.url("setting_name", setting_name, 'str', max_length=32, min_length=0), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'Setting') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Setting', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_or_update.metadata = {'url': '/providers/Microsoft.CostManagement/settings/{settingName}'} # type: ignore - - def delete( - self, - setting_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Remove the current value for a specific setting and reverts back to the default value, if - applicable. - - :param setting_name: Name of the setting. Allowed values: myscope. - :type setting_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'settingName': self._serialize.url("setting_name", setting_name, 'str', max_length=32, min_length=0), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/providers/Microsoft.CostManagement/settings/{settingName}'} # type: ignore diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_views_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_views_operations.py index d7512a2a7003..f7fbad1744f8 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_views_operations.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_views_operations.py @@ -54,7 +54,7 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ViewListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.costmanagement.models.ViewListResultor None] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.costmanagement.models.ViewListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ViewListResult"] @@ -62,7 +62,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" accept = "application/json" def prepare_request(next_link=None): @@ -97,7 +97,7 @@ def get_next(next_link=None): pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 204]: + if response.status_code not in [200]: error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -137,7 +137,7 @@ def list_by_scope( :type scope: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ViewListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.costmanagement.models.ViewListResultor None] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.costmanagement.models.ViewListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ViewListResult"] @@ -145,7 +145,7 @@ def list_by_scope( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" accept = "application/json" def prepare_request(next_link=None): @@ -184,7 +184,7 @@ def get_next(next_link=None): pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 204]: + if response.status_code not in [200]: error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -216,7 +216,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" accept = "application/json" # Construct URL @@ -276,7 +276,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -340,7 +340,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" accept = "application/json" # Construct URL @@ -411,7 +411,7 @@ def get_by_scope( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" accept = "application/json" # Construct URL @@ -491,7 +491,7 @@ def create_or_update_by_scope( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -575,7 +575,7 @@ def delete_by_scope( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" + api_version = "2020-06-01" accept = "application/json" # Construct URL