diff --git a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/MANIFEST.in b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/MANIFEST.in index a3cb07df8765..3a9b6517412b 100644 --- a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/MANIFEST.in +++ b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/MANIFEST.in @@ -1,3 +1,4 @@ +include _meta.json recursive-include tests *.py *.yaml include *.md include azure/__init__.py diff --git a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/_meta.json b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/_meta.json new file mode 100644 index 000000000000..6f40fe371f31 --- /dev/null +++ b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/_meta.json @@ -0,0 +1,11 @@ +{ + "autorest": "3.4.2", + "use": [ + "@autorest/python@5.8.1", + "@autorest/modelerfour@4.19.2" + ], + "commit": "c803720c6bcfcb0fcf4c97f3463ec33a18f9e55c", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/powerbidedicated/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.1 --use=@autorest/modelerfour@4.19.2 --version=3.4.2", + "readme": "specification/powerbidedicated/resource-manager/readme.md" +} \ No newline at end of file diff --git a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/__init__.py b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/__init__.py index 85242d086108..63a500016f0e 100644 --- a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/__init__.py +++ b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/__init__.py @@ -1,15 +1,10 @@ # 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. +# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.4.2, generator: @autorest/python@5.8.1) # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from ._power_bi_dedicated import PowerBIDedicated -from ._version import VERSION - -__version__ = VERSION __all__ = ['PowerBIDedicated'] try: diff --git a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/_configuration.py b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/_configuration.py index e6d5726d4e10..1b9acbbaa180 100644 --- a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/_configuration.py +++ b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/_configuration.py @@ -1,8 +1,6 @@ # 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. +# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.4.2, generator: @autorest/python@5.8.1) # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -10,16 +8,12 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy - -from ._version import VERSION if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any - from azure.core.credentials import TokenCredential - +VERSION = "unknown" class PowerBIDedicatedConfiguration(Configuration): """Configuration for PowerBIDedicated. @@ -27,30 +21,23 @@ class PowerBIDedicatedConfiguration(Configuration): Note that all parameters used to create this instance are saved as instance attributes. - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: A unique identifier for a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. :type subscription_id: str """ def __init__( self, - credential, # type: "TokenCredential" subscription_id, # type: str **kwargs # type: Any ): # type: (...) -> None - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") super(PowerBIDedicatedConfiguration, self).__init__(**kwargs) - self.credential = credential self.subscription_id = subscription_id self.api_version = "2021-01-01" - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-powerbidedicated/{}'.format(VERSION)) + kwargs.setdefault('sdk_moniker', 'powerbidedicated/{}'.format(VERSION)) self._configure(**kwargs) def _configure( @@ -62,10 +49,8 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or policies.HttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) self.authentication_policy = kwargs.get('authentication_policy') - if self.credential and not self.authentication_policy: - self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/_metadata.json b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/_metadata.json new file mode 100644 index 000000000000..4663e59232c5 --- /dev/null +++ b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/_metadata.json @@ -0,0 +1,93 @@ +{ + "chosen_version": "2021-01-01", + "total_api_version_list": ["2021-01-01"], + "client": { + "name": "PowerBIDedicated", + "filename": "_power_bi_dedicated", + "description": "PowerBI Dedicated Web API provides a RESTful set of web services that enables users to create, retrieve, update, and delete Power BI dedicated capacities.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": false, + "has_lro_operations": true, + "client_side_validation": false, + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.core\": [\"PipelineClient\"]}, \"local\": {\"._configuration\": [\"PowerBIDedicatedConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.core\": [\"AsyncPipelineClient\"]}, \"local\": {\"._configuration\": [\"PowerBIDedicatedConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + }, + "global_parameters": { + "sync": { + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "A unique identifier for a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + "docstring_type": "str", + "required": true + } + }, + "async": { + "subscription_id": { + "signature": "subscription_id: str,", + "description": "A unique identifier for a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=None, # type: Optional[str]", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: Optional[str] = None,", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } + }, + "config": { + "credential": false, + "credential_scopes": null, + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null, + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}}" + }, + "operation_groups": { + "capacities": "CapacitiesOperations", + "operations": "Operations", + "auto_scale_vcores": "AutoScaleVCoresOperations" + } +} \ No newline at end of file diff --git a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/_power_bi_dedicated.py b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/_power_bi_dedicated.py index 4290021c67cc..4711c18b3edf 100644 --- a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/_power_bi_dedicated.py +++ b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/_power_bi_dedicated.py @@ -1,21 +1,19 @@ # 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. +# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.4.2, generator: @autorest/python@5.8.1) # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from typing import TYPE_CHECKING -from azure.mgmt.core import ARMPipelineClient +from azure.core import PipelineClient from msrest import Deserializer, Serializer if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Optional - from azure.core.credentials import TokenCredential + from azure.core.pipeline.transport import HttpRequest, HttpResponse from ._configuration import PowerBIDedicatedConfiguration from .operations import CapacitiesOperations @@ -28,13 +26,11 @@ class PowerBIDedicated(object): """PowerBI Dedicated Web API provides a RESTful set of web services that enables users to create, retrieve, update, and delete Power BI dedicated capacities. :ivar capacities: CapacitiesOperations operations - :vartype capacities: azure.mgmt.powerbidedicated.operations.CapacitiesOperations + :vartype capacities: power_bi_dedicated.operations.CapacitiesOperations :ivar operations: Operations operations - :vartype operations: azure.mgmt.powerbidedicated.operations.Operations + :vartype operations: power_bi_dedicated.operations.Operations :ivar auto_scale_vcores: AutoScaleVCoresOperations operations - :vartype auto_scale_vcores: azure.mgmt.powerbidedicated.operations.AutoScaleVCoresOperations - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials.TokenCredential + :vartype auto_scale_vcores: power_bi_dedicated.operations.AutoScaleVCoresOperations :param subscription_id: A unique identifier for a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. :type subscription_id: str :param str base_url: Service URL @@ -43,7 +39,6 @@ class PowerBIDedicated(object): def __init__( self, - credential, # type: "TokenCredential" subscription_id, # type: str base_url=None, # type: Optional[str] **kwargs # type: Any @@ -51,8 +46,8 @@ def __init__( # type: (...) -> None if not base_url: base_url = 'https://management.azure.com' - self._config = PowerBIDedicatedConfiguration(credential, subscription_id, **kwargs) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + self._config = PowerBIDedicatedConfiguration(subscription_id, **kwargs) + self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -66,6 +61,24 @@ def __init__( self.auto_scale_vcores = AutoScaleVCoresOperations( self._client, self._config, self._serialize, self._deserialize) + def _send_request(self, http_request, **kwargs): + # type: (HttpRequest, Any) -> HttpResponse + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.HttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + def close(self): # type: () -> None self._client.close() diff --git a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/__init__.py b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/__init__.py index 7b60751482fd..e221bb17aa9e 100644 --- a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/__init__.py +++ b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/__init__.py @@ -1,8 +1,6 @@ # 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. +# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.4.2, generator: @autorest/python@5.8.1) # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- diff --git a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/_configuration.py b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/_configuration.py index dffbc7ec413e..c9d743da3321 100644 --- a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/_configuration.py +++ b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/_configuration.py @@ -1,23 +1,15 @@ # 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. +# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.4.2, generator: @autorest/python@5.8.1) # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, TYPE_CHECKING +from typing import Any from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy - -from .._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential +VERSION = "unknown" class PowerBIDedicatedConfiguration(Configuration): """Configuration for PowerBIDedicated. @@ -25,29 +17,22 @@ class PowerBIDedicatedConfiguration(Configuration): Note that all parameters used to create this instance are saved as instance attributes. - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: A unique identifier for a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. :type subscription_id: str """ def __init__( self, - credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any ) -> None: - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") super(PowerBIDedicatedConfiguration, self).__init__(**kwargs) - self.credential = credential self.subscription_id = subscription_id self.api_version = "2021-01-01" - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-powerbidedicated/{}'.format(VERSION)) + kwargs.setdefault('sdk_moniker', 'powerbidedicated/{}'.format(VERSION)) self._configure(**kwargs) def _configure( @@ -58,10 +43,8 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or policies.HttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) self.authentication_policy = kwargs.get('authentication_policy') - if self.credential and not self.authentication_policy: - self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/_power_bi_dedicated.py b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/_power_bi_dedicated.py index c104e7384419..e2c50f7091f3 100644 --- a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/_power_bi_dedicated.py +++ b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/_power_bi_dedicated.py @@ -1,20 +1,15 @@ # 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. +# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.4.2, generator: @autorest/python@5.8.1) # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional, TYPE_CHECKING +from typing import Any, Optional -from azure.mgmt.core import AsyncARMPipelineClient +from azure.core import AsyncPipelineClient +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from msrest import Deserializer, Serializer -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - from ._configuration import PowerBIDedicatedConfiguration from .operations import CapacitiesOperations from .operations import Operations @@ -26,13 +21,11 @@ class PowerBIDedicated(object): """PowerBI Dedicated Web API provides a RESTful set of web services that enables users to create, retrieve, update, and delete Power BI dedicated capacities. :ivar capacities: CapacitiesOperations operations - :vartype capacities: azure.mgmt.powerbidedicated.aio.operations.CapacitiesOperations + :vartype capacities: power_bi_dedicated.aio.operations.CapacitiesOperations :ivar operations: Operations operations - :vartype operations: azure.mgmt.powerbidedicated.aio.operations.Operations + :vartype operations: power_bi_dedicated.aio.operations.Operations :ivar auto_scale_vcores: AutoScaleVCoresOperations operations - :vartype auto_scale_vcores: azure.mgmt.powerbidedicated.aio.operations.AutoScaleVCoresOperations - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :vartype auto_scale_vcores: power_bi_dedicated.aio.operations.AutoScaleVCoresOperations :param subscription_id: A unique identifier for a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. :type subscription_id: str :param str base_url: Service URL @@ -41,15 +34,14 @@ class PowerBIDedicated(object): def __init__( self, - credential: "AsyncTokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any ) -> None: if not base_url: base_url = 'https://management.azure.com' - self._config = PowerBIDedicatedConfiguration(credential, subscription_id, **kwargs) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + self._config = PowerBIDedicatedConfiguration(subscription_id, **kwargs) + self._client = AsyncPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -63,6 +55,23 @@ def __init__( self.auto_scale_vcores = AutoScaleVCoresOperations( self._client, self._config, self._serialize, self._deserialize) + async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + async def close(self) -> None: await self._client.close() diff --git a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/operations/__init__.py b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/operations/__init__.py index 4178fdb5dcc7..78e4cd463bf5 100644 --- a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/operations/__init__.py +++ b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/operations/__init__.py @@ -1,8 +1,6 @@ # 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. +# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.4.2, generator: @autorest/python@5.8.1) # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- diff --git a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/operations/_auto_scale_vcores_operations.py b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/operations/_auto_scale_vcores_operations.py index 971a0f8af7ff..4b8e10ebea82 100644 --- a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/operations/_auto_scale_vcores_operations.py +++ b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/operations/_auto_scale_vcores_operations.py @@ -1,8 +1,6 @@ # 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. +# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.4.2, generator: @autorest/python@5.8.1) # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar @@ -12,7 +10,6 @@ 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 @@ -26,7 +23,7 @@ class AutoScaleVCoresOperations: 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.powerbidedicated.models + :type models: ~power_bi_dedicated.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -45,7 +42,7 @@ async def get( self, resource_group_name: str, vcore_name: str, - **kwargs + **kwargs: Any ) -> "_models.AutoScaleVCore": """Gets details about the specified auto scale v-core. @@ -58,7 +55,7 @@ async def get( :type vcore_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AutoScaleVCore, or the result of cls(response) - :rtype: ~azure.mgmt.powerbidedicated.models.AutoScaleVCore + :rtype: ~power_bi_dedicated.models.AutoScaleVCore :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoScaleVCore"] @@ -92,8 +89,8 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('AutoScaleVCore', pipeline_response) @@ -108,7 +105,7 @@ async def create( resource_group_name: str, vcore_name: str, v_core_parameters: "_models.AutoScaleVCore", - **kwargs + **kwargs: Any ) -> "_models.AutoScaleVCore": """Provisions the specified auto scale v-core based on the configuration specified in the request. @@ -120,10 +117,10 @@ async def create( a maximum of 63. :type vcore_name: str :param v_core_parameters: Contains the information used to provision the auto scale v-core. - :type v_core_parameters: ~azure.mgmt.powerbidedicated.models.AutoScaleVCore + :type v_core_parameters: ~power_bi_dedicated.models.AutoScaleVCore :keyword callable cls: A custom type or function that will be passed the direct response :return: AutoScaleVCore, or the result of cls(response) - :rtype: ~azure.mgmt.powerbidedicated.models.AutoScaleVCore + :rtype: ~power_bi_dedicated.models.AutoScaleVCore :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoScaleVCore"] @@ -162,8 +159,8 @@ async def create( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('AutoScaleVCore', pipeline_response) @@ -177,7 +174,7 @@ async def delete( self, resource_group_name: str, vcore_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes the specified auto scale v-core. @@ -224,8 +221,8 @@ async def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) if cls: return cls(pipeline_response, None, {}) @@ -237,7 +234,7 @@ async def update( resource_group_name: str, vcore_name: str, v_core_update_parameters: "_models.AutoScaleVCoreUpdateParameters", - **kwargs + **kwargs: Any ) -> "_models.AutoScaleVCore": """Updates the current state of the specified auto scale v-core. @@ -250,10 +247,10 @@ async def update( :type vcore_name: str :param v_core_update_parameters: Request object that contains the updated information for the auto scale v-core. - :type v_core_update_parameters: ~azure.mgmt.powerbidedicated.models.AutoScaleVCoreUpdateParameters + :type v_core_update_parameters: ~power_bi_dedicated.models.AutoScaleVCoreUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: AutoScaleVCore, or the result of cls(response) - :rtype: ~azure.mgmt.powerbidedicated.models.AutoScaleVCore + :rtype: ~power_bi_dedicated.models.AutoScaleVCore :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoScaleVCore"] @@ -292,8 +289,8 @@ async def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('AutoScaleVCore', pipeline_response) @@ -306,7 +303,7 @@ async def update( def list_by_resource_group( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.AutoScaleVCoreListResult"]: """Gets all the auto scale v-cores for the given resource group. @@ -316,7 +313,7 @@ def list_by_resource_group( :type resource_group_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AutoScaleVCoreListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.powerbidedicated.models.AutoScaleVCoreListResult] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~power_bi_dedicated.models.AutoScaleVCoreListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoScaleVCoreListResult"] @@ -365,9 +362,9 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + 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) + raise HttpResponseError(response=response, model=error) return pipeline_response @@ -378,13 +375,13 @@ async def get_next(next_link=None): def list_by_subscription( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.AutoScaleVCoreListResult"]: """Lists all the auto scale v-cores for the given subscription. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AutoScaleVCoreListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.powerbidedicated.models.AutoScaleVCoreListResult] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~power_bi_dedicated.models.AutoScaleVCoreListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoScaleVCoreListResult"] @@ -432,9 +429,9 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + 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) + raise HttpResponseError(response=response, model=error) return pipeline_response diff --git a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/operations/_capacities_operations.py b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/operations/_capacities_operations.py index 413cd0f29457..1724dcd62047 100644 --- a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/operations/_capacities_operations.py +++ b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/operations/_capacities_operations.py @@ -1,8 +1,6 @@ # 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. +# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.4.2, generator: @autorest/python@5.8.1) # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union @@ -13,8 +11,7 @@ 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 azure.core.polling.async_base_polling import AsyncLROBasePolling from ... import models as _models @@ -28,7 +25,7 @@ class CapacitiesOperations: 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.powerbidedicated.models + :type models: ~power_bi_dedicated.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -47,7 +44,7 @@ async def get_details( self, resource_group_name: str, dedicated_capacity_name: str, - **kwargs + **kwargs: Any ) -> "_models.DedicatedCapacity": """Gets details about the specified dedicated capacity. @@ -60,7 +57,7 @@ async def get_details( :type dedicated_capacity_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DedicatedCapacity, or the result of cls(response) - :rtype: ~azure.mgmt.powerbidedicated.models.DedicatedCapacity + :rtype: ~power_bi_dedicated.models.DedicatedCapacity :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedCapacity"] @@ -94,8 +91,8 @@ async def get_details( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('DedicatedCapacity', pipeline_response) @@ -110,7 +107,7 @@ async def _create_initial( resource_group_name: str, dedicated_capacity_name: str, capacity_parameters: "_models.DedicatedCapacity", - **kwargs + **kwargs: Any ) -> "_models.DedicatedCapacity": cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedCapacity"] error_map = { @@ -148,8 +145,8 @@ async def _create_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) if response.status_code == 200: deserialized = self._deserialize('DedicatedCapacity', pipeline_response) @@ -168,7 +165,7 @@ async def begin_create( resource_group_name: str, dedicated_capacity_name: str, capacity_parameters: "_models.DedicatedCapacity", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.DedicatedCapacity"]: """Provisions the specified Dedicated capacity based on the configuration specified in the request. @@ -181,15 +178,15 @@ async def begin_create( characters, and a maximum of 63. :type dedicated_capacity_name: str :param capacity_parameters: Contains the information used to provision the Dedicated capacity. - :type capacity_parameters: ~azure.mgmt.powerbidedicated.models.DedicatedCapacity + :type capacity_parameters: ~power_bi_dedicated.models.DedicatedCapacity :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: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be AsyncLROBasePolling. + 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 DedicatedCapacity or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.powerbidedicated.models.DedicatedCapacity] + :rtype: ~azure.core.polling.AsyncLROPoller[~power_bi_dedicated.models.DedicatedCapacity] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -224,7 +221,7 @@ def get_long_running_output(pipeline_response): 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncLROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -242,7 +239,7 @@ async def _delete_initial( self, resource_group_name: str, dedicated_capacity_name: str, - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { @@ -275,8 +272,8 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) if cls: return cls(pipeline_response, None, {}) @@ -287,7 +284,7 @@ async def begin_delete( self, resource_group_name: str, dedicated_capacity_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Deletes the specified Dedicated capacity. @@ -300,8 +297,8 @@ async def begin_delete( :type dedicated_capacity_name: 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: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be AsyncLROBasePolling. + 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 None or the result of cls(response) @@ -336,7 +333,7 @@ def get_long_running_output(pipeline_response): 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncLROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -355,7 +352,7 @@ async def _update_initial( resource_group_name: str, dedicated_capacity_name: str, capacity_update_parameters: "_models.DedicatedCapacityUpdateParameters", - **kwargs + **kwargs: Any ) -> "_models.DedicatedCapacity": cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedCapacity"] error_map = { @@ -393,8 +390,8 @@ async def _update_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) if response.status_code == 200: deserialized = self._deserialize('DedicatedCapacity', pipeline_response) @@ -413,7 +410,7 @@ async def begin_update( resource_group_name: str, dedicated_capacity_name: str, capacity_update_parameters: "_models.DedicatedCapacityUpdateParameters", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.DedicatedCapacity"]: """Updates the current state of the specified Dedicated capacity. @@ -426,15 +423,15 @@ async def begin_update( :type dedicated_capacity_name: str :param capacity_update_parameters: Request object that contains the updated information for the capacity. - :type capacity_update_parameters: ~azure.mgmt.powerbidedicated.models.DedicatedCapacityUpdateParameters + :type capacity_update_parameters: ~power_bi_dedicated.models.DedicatedCapacityUpdateParameters :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: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be AsyncLROBasePolling. + 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 DedicatedCapacity or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.powerbidedicated.models.DedicatedCapacity] + :rtype: ~azure.core.polling.AsyncLROPoller[~power_bi_dedicated.models.DedicatedCapacity] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -469,7 +466,7 @@ def get_long_running_output(pipeline_response): 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncLROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -487,7 +484,7 @@ async def _suspend_initial( self, resource_group_name: str, dedicated_capacity_name: str, - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { @@ -520,8 +517,8 @@ async def _suspend_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) if cls: return cls(pipeline_response, None, {}) @@ -532,7 +529,7 @@ async def begin_suspend( self, resource_group_name: str, dedicated_capacity_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Suspends operation of the specified dedicated capacity instance. @@ -545,8 +542,8 @@ async def begin_suspend( :type dedicated_capacity_name: 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: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be AsyncLROBasePolling. + 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 None or the result of cls(response) @@ -581,7 +578,7 @@ def get_long_running_output(pipeline_response): 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncLROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -599,7 +596,7 @@ async def _resume_initial( self, resource_group_name: str, dedicated_capacity_name: str, - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { @@ -632,8 +629,8 @@ async def _resume_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) if cls: return cls(pipeline_response, None, {}) @@ -644,7 +641,7 @@ async def begin_resume( self, resource_group_name: str, dedicated_capacity_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Resumes operation of the specified Dedicated capacity instance. @@ -657,8 +654,8 @@ async def begin_resume( :type dedicated_capacity_name: 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: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be AsyncLROBasePolling. + 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 None or the result of cls(response) @@ -693,7 +690,7 @@ def get_long_running_output(pipeline_response): 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncLROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -710,7 +707,7 @@ def get_long_running_output(pipeline_response): def list_by_resource_group( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.DedicatedCapacities"]: """Gets all the Dedicated capacities for the given resource group. @@ -720,7 +717,7 @@ def list_by_resource_group( :type resource_group_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DedicatedCapacities or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.powerbidedicated.models.DedicatedCapacities] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~power_bi_dedicated.models.DedicatedCapacities] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedCapacities"] @@ -769,9 +766,9 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + 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) + raise HttpResponseError(response=response, model=error) return pipeline_response @@ -782,13 +779,13 @@ async def get_next(next_link=None): def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.DedicatedCapacities"]: """Lists all the Dedicated capacities for the given subscription. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DedicatedCapacities or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.powerbidedicated.models.DedicatedCapacities] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~power_bi_dedicated.models.DedicatedCapacities] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedCapacities"] @@ -836,9 +833,9 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + 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) + raise HttpResponseError(response=response, model=error) return pipeline_response @@ -849,13 +846,13 @@ async def get_next(next_link=None): async def list_skus( self, - **kwargs + **kwargs: Any ) -> "_models.SkuEnumerationForNewResourceResult": """Lists eligible SKUs for PowerBI Dedicated resource provider. :keyword callable cls: A custom type or function that will be passed the direct response :return: SkuEnumerationForNewResourceResult, or the result of cls(response) - :rtype: ~azure.mgmt.powerbidedicated.models.SkuEnumerationForNewResourceResult + :rtype: ~power_bi_dedicated.models.SkuEnumerationForNewResourceResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuEnumerationForNewResourceResult"] @@ -887,8 +884,8 @@ async def list_skus( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('SkuEnumerationForNewResourceResult', pipeline_response) @@ -902,7 +899,7 @@ async def list_skus_for_capacity( self, resource_group_name: str, dedicated_capacity_name: str, - **kwargs + **kwargs: Any ) -> "_models.SkuEnumerationForExistingResourceResult": """Lists eligible SKUs for a PowerBI Dedicated resource. @@ -915,7 +912,7 @@ async def list_skus_for_capacity( :type dedicated_capacity_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SkuEnumerationForExistingResourceResult, or the result of cls(response) - :rtype: ~azure.mgmt.powerbidedicated.models.SkuEnumerationForExistingResourceResult + :rtype: ~power_bi_dedicated.models.SkuEnumerationForExistingResourceResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuEnumerationForExistingResourceResult"] @@ -949,8 +946,8 @@ async def list_skus_for_capacity( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('SkuEnumerationForExistingResourceResult', pipeline_response) @@ -964,17 +961,17 @@ async def check_name_availability( self, location: str, capacity_parameters: "_models.CheckCapacityNameAvailabilityParameters", - **kwargs + **kwargs: Any ) -> "_models.CheckCapacityNameAvailabilityResult": """Check the name availability in the target location. :param location: The region name which the operation will lookup into. :type location: str :param capacity_parameters: The name of the capacity. - :type capacity_parameters: ~azure.mgmt.powerbidedicated.models.CheckCapacityNameAvailabilityParameters + :type capacity_parameters: ~power_bi_dedicated.models.CheckCapacityNameAvailabilityParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: CheckCapacityNameAvailabilityResult, or the result of cls(response) - :rtype: ~azure.mgmt.powerbidedicated.models.CheckCapacityNameAvailabilityResult + :rtype: ~power_bi_dedicated.models.CheckCapacityNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckCapacityNameAvailabilityResult"] @@ -1012,8 +1009,8 @@ async def check_name_availability( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('CheckCapacityNameAvailabilityResult', pipeline_response) diff --git a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/operations/_operations.py b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/operations/_operations.py index 969aa7adae39..1ddf3b1f7d03 100644 --- a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/operations/_operations.py +++ b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/operations/_operations.py @@ -1,8 +1,6 @@ # 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. +# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.4.2, generator: @autorest/python@5.8.1) # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar @@ -12,7 +10,6 @@ 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 @@ -26,7 +23,7 @@ class Operations: 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.powerbidedicated.models + :type models: ~power_bi_dedicated.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -43,13 +40,13 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available PowerBIDedicated REST API operations. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.powerbidedicated.models.OperationListResult] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~power_bi_dedicated.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -93,9 +90,9 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + 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) + raise HttpResponseError(response=response, model=error) return pipeline_response diff --git a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/models/__init__.py b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/models/__init__.py index c6c8542fa8ce..791a0d701980 100644 --- a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/models/__init__.py +++ b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/models/__init__.py @@ -1,8 +1,6 @@ # 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. +# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.4.2, generator: @autorest/python@5.8.1) # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- diff --git a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/models/_models.py b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/models/_models.py index 7ab1e4a3b84c..f0b28afca7c0 100644 --- a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/models/_models.py +++ b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/models/_models.py @@ -1,8 +1,6 @@ # 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. +# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.4.2, generator: @autorest/python@5.8.1) # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +26,7 @@ class Resource(msrest.serialization.Model): :param tags: A set of tags. Key-value pairs of additional resource provisioning properties. :type tags: dict[str, str] :param system_data: Metadata pertaining to creation and last modification of the resource. - :type system_data: ~azure.mgmt.powerbidedicated.models.SystemData + :type system_data: ~power_bi_dedicated.models.SystemData """ _validation = { @@ -78,9 +76,9 @@ class AutoScaleVCore(Resource): :param tags: A set of tags. Key-value pairs of additional resource provisioning properties. :type tags: dict[str, str] :param system_data: Metadata pertaining to creation and last modification of the resource. - :type system_data: ~azure.mgmt.powerbidedicated.models.SystemData + :type system_data: ~power_bi_dedicated.models.SystemData :param sku: Required. The SKU of the auto scale v-core resource. - :type sku: ~azure.mgmt.powerbidedicated.models.AutoScaleVCoreSku + :type sku: ~power_bi_dedicated.models.AutoScaleVCoreSku :param capacity_limit: The maximum capacity of an auto scale v-core resource. :type capacity_limit: int :param capacity_object_id: The object ID of the capacity resource associated with the auto @@ -89,7 +87,7 @@ class AutoScaleVCore(Resource): :ivar provisioning_state: The current deployment state of an auto scale v-core resource. The provisioningState is to indicate states for resource provisioning. Possible values include: "Succeeded". - :vartype provisioning_state: str or ~azure.mgmt.powerbidedicated.models.VCoreProvisioningState + :vartype provisioning_state: str or ~power_bi_dedicated.models.VCoreProvisioningState """ _validation = { @@ -131,7 +129,7 @@ class AutoScaleVCoreListResult(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :param value: Required. An array of auto scale v-core resources. - :type value: list[~azure.mgmt.powerbidedicated.models.AutoScaleVCore] + :type value: list[~power_bi_dedicated.models.AutoScaleVCore] """ _validation = { @@ -182,7 +180,7 @@ class AutoScaleVCoreProperties(AutoScaleVCoreMutableProperties): :ivar provisioning_state: The current deployment state of an auto scale v-core resource. The provisioningState is to indicate states for resource provisioning. Possible values include: "Succeeded". - :vartype provisioning_state: str or ~azure.mgmt.powerbidedicated.models.VCoreProvisioningState + :vartype provisioning_state: str or ~power_bi_dedicated.models.VCoreProvisioningState """ _validation = { @@ -213,7 +211,7 @@ class AutoScaleVCoreSku(msrest.serialization.Model): :type name: str :param tier: The name of the Azure pricing tier to which the SKU applies. Possible values include: "AutoScale". - :type tier: str or ~azure.mgmt.powerbidedicated.models.VCoreSkuTier + :type tier: str or ~power_bi_dedicated.models.VCoreSkuTier :param capacity: The capacity of an auto scale v-core resource. :type capacity: int """ @@ -242,7 +240,7 @@ class AutoScaleVCoreUpdateParameters(msrest.serialization.Model): """Update request specification. :param sku: The SKU of the auto scale v-core resource. - :type sku: ~azure.mgmt.powerbidedicated.models.AutoScaleVCoreSku + :type sku: ~power_bi_dedicated.models.AutoScaleVCoreSku :param tags: A set of tags. Key-value pairs of additional provisioning properties. :type tags: dict[str, str] :param capacity_limit: The maximum capacity of an auto scale v-core resource. @@ -274,7 +272,7 @@ class CapacitySku(msrest.serialization.Model): :type name: str :param tier: The name of the Azure pricing tier to which the SKU applies. Possible values include: "PBIE_Azure", "Premium", "AutoPremiumHost". - :type tier: str or ~azure.mgmt.powerbidedicated.models.CapacitySkuTier + :type tier: str or ~power_bi_dedicated.models.CapacitySkuTier """ _validation = { @@ -355,7 +353,7 @@ class DedicatedCapacities(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :param value: Required. An array of Dedicated capacities resources. - :type value: list[~azure.mgmt.powerbidedicated.models.DedicatedCapacity] + :type value: list[~power_bi_dedicated.models.DedicatedCapacity] """ _validation = { @@ -392,24 +390,23 @@ class DedicatedCapacity(Resource): :param tags: A set of tags. Key-value pairs of additional resource provisioning properties. :type tags: dict[str, str] :param system_data: Metadata pertaining to creation and last modification of the resource. - :type system_data: ~azure.mgmt.powerbidedicated.models.SystemData + :type system_data: ~power_bi_dedicated.models.SystemData :param sku: Required. The SKU of the PowerBI Dedicated capacity resource. - :type sku: ~azure.mgmt.powerbidedicated.models.CapacitySku + :type sku: ~power_bi_dedicated.models.CapacitySku :param administration: A collection of Dedicated capacity administrators. - :type administration: ~azure.mgmt.powerbidedicated.models.DedicatedCapacityAdministrators + :type administration: ~power_bi_dedicated.models.DedicatedCapacityAdministrators :param mode: The capacity mode. Possible values include: "Gen1", "Gen2". - :type mode: str or ~azure.mgmt.powerbidedicated.models.Mode + :type mode: str or ~power_bi_dedicated.models.Mode :ivar state: The current state of PowerBI Dedicated resource. The state is to indicate more states outside of resource provisioning. Possible values include: "Deleting", "Succeeded", "Failed", "Paused", "Suspended", "Provisioning", "Updating", "Suspending", "Pausing", "Resuming", "Preparing", "Scaling". - :vartype state: str or ~azure.mgmt.powerbidedicated.models.State + :vartype state: str or ~power_bi_dedicated.models.State :ivar provisioning_state: The current deployment state of PowerBI Dedicated resource. The provisioningState is to indicate states for resource provisioning. Possible values include: "Deleting", "Succeeded", "Failed", "Paused", "Suspended", "Provisioning", "Updating", "Suspending", "Pausing", "Resuming", "Preparing", "Scaling". - :vartype provisioning_state: str or - ~azure.mgmt.powerbidedicated.models.CapacityProvisioningState + :vartype provisioning_state: str or ~power_bi_dedicated.models.CapacityProvisioningState """ _validation = { @@ -471,9 +468,9 @@ class DedicatedCapacityMutableProperties(msrest.serialization.Model): """An object that represents a set of mutable Dedicated capacity resource properties. :param administration: A collection of Dedicated capacity administrators. - :type administration: ~azure.mgmt.powerbidedicated.models.DedicatedCapacityAdministrators + :type administration: ~power_bi_dedicated.models.DedicatedCapacityAdministrators :param mode: The capacity mode. Possible values include: "Gen1", "Gen2". - :type mode: str or ~azure.mgmt.powerbidedicated.models.Mode + :type mode: str or ~power_bi_dedicated.models.Mode """ _attribute_map = { @@ -496,20 +493,19 @@ class DedicatedCapacityProperties(DedicatedCapacityMutableProperties): Variables are only populated by the server, and will be ignored when sending a request. :param administration: A collection of Dedicated capacity administrators. - :type administration: ~azure.mgmt.powerbidedicated.models.DedicatedCapacityAdministrators + :type administration: ~power_bi_dedicated.models.DedicatedCapacityAdministrators :param mode: The capacity mode. Possible values include: "Gen1", "Gen2". - :type mode: str or ~azure.mgmt.powerbidedicated.models.Mode + :type mode: str or ~power_bi_dedicated.models.Mode :ivar state: The current state of PowerBI Dedicated resource. The state is to indicate more states outside of resource provisioning. Possible values include: "Deleting", "Succeeded", "Failed", "Paused", "Suspended", "Provisioning", "Updating", "Suspending", "Pausing", "Resuming", "Preparing", "Scaling". - :vartype state: str or ~azure.mgmt.powerbidedicated.models.State + :vartype state: str or ~power_bi_dedicated.models.State :ivar provisioning_state: The current deployment state of PowerBI Dedicated resource. The provisioningState is to indicate states for resource provisioning. Possible values include: "Deleting", "Succeeded", "Failed", "Paused", "Suspended", "Provisioning", "Updating", "Suspending", "Pausing", "Resuming", "Preparing", "Scaling". - :vartype provisioning_state: str or - ~azure.mgmt.powerbidedicated.models.CapacityProvisioningState + :vartype provisioning_state: str or ~power_bi_dedicated.models.CapacityProvisioningState """ _validation = { @@ -537,13 +533,13 @@ class DedicatedCapacityUpdateParameters(msrest.serialization.Model): """Provision request specification. :param sku: The SKU of the Dedicated capacity resource. - :type sku: ~azure.mgmt.powerbidedicated.models.CapacitySku + :type sku: ~power_bi_dedicated.models.CapacitySku :param tags: A set of tags. Key-value pairs of additional provisioning properties. :type tags: dict[str, str] :param administration: A collection of Dedicated capacity administrators. - :type administration: ~azure.mgmt.powerbidedicated.models.DedicatedCapacityAdministrators + :type administration: ~power_bi_dedicated.models.DedicatedCapacityAdministrators :param mode: The capacity mode. Possible values include: "Gen1", "Gen2". - :type mode: str or ~azure.mgmt.powerbidedicated.models.Mode + :type mode: str or ~power_bi_dedicated.models.Mode """ _attribute_map = { @@ -568,7 +564,7 @@ class ErrorResponse(msrest.serialization.Model): """Describes the format of Error response. :param error: The error object. - :type error: ~azure.mgmt.powerbidedicated.models.ErrorResponseError + :type error: ~power_bi_dedicated.models.ErrorResponseError """ _attribute_map = { @@ -614,7 +610,7 @@ class Operation(msrest.serialization.Model): :ivar name: Operation name: {provider}/{resource}/{operation}. :vartype name: str :param display: The object that represents the operation. - :type display: ~azure.mgmt.powerbidedicated.models.OperationDisplay + :type display: ~power_bi_dedicated.models.OperationDisplay """ _validation = { @@ -676,7 +672,7 @@ class OperationListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of capacities supported by the Microsoft.PowerBIDedicated resource provider. - :vartype value: list[~azure.mgmt.powerbidedicated.models.Operation] + :vartype value: list[~power_bi_dedicated.models.Operation] :ivar next_link: URL to get the next set of operation list results if there are any. :vartype next_link: str """ @@ -704,7 +700,7 @@ class SkuDetailsForExistingResource(msrest.serialization.Model): """An object that represents SKU details for existing resources. :param sku: The SKU in SKU details for existing resources. - :type sku: ~azure.mgmt.powerbidedicated.models.CapacitySku + :type sku: ~power_bi_dedicated.models.CapacitySku """ _attribute_map = { @@ -723,7 +719,7 @@ class SkuEnumerationForExistingResourceResult(msrest.serialization.Model): """An object that represents enumerating SKUs for existing resources. :param value: The collection of available SKUs for existing resources. - :type value: list[~azure.mgmt.powerbidedicated.models.SkuDetailsForExistingResource] + :type value: list[~power_bi_dedicated.models.SkuDetailsForExistingResource] """ _attribute_map = { @@ -742,7 +738,7 @@ class SkuEnumerationForNewResourceResult(msrest.serialization.Model): """An object that represents enumerating SKUs for new resources. :param value: The collection of available SKUs for new resources. - :type value: list[~azure.mgmt.powerbidedicated.models.CapacitySku] + :type value: list[~power_bi_dedicated.models.CapacitySku] """ _attribute_map = { @@ -764,14 +760,14 @@ class SystemData(msrest.serialization.Model): :type created_by: str :param created_by_type: The type of identity that created the resource. Possible values include: "User", "Application", "ManagedIdentity", "Key". - :type created_by_type: str or ~azure.mgmt.powerbidedicated.models.IdentityType + :type created_by_type: str or ~power_bi_dedicated.models.IdentityType :param created_at: The timestamp of resource creation (UTC). :type created_at: ~datetime.datetime :param last_modified_by: An identifier for the identity that last modified the resource. :type last_modified_by: str :param last_modified_by_type: The type of identity that last modified the resource. Possible values include: "User", "Application", "ManagedIdentity", "Key". - :type last_modified_by_type: str or ~azure.mgmt.powerbidedicated.models.IdentityType + :type last_modified_by_type: str or ~power_bi_dedicated.models.IdentityType :param last_modified_at: The timestamp of resource last modification (UTC). :type last_modified_at: ~datetime.datetime """ diff --git a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/models/_models_py3.py b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/models/_models_py3.py index 72ea08ea8a8e..8bab7ddae93b 100644 --- a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/models/_models_py3.py +++ b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/models/_models_py3.py @@ -1,8 +1,6 @@ # 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. +# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.4.2, generator: @autorest/python@5.8.1) # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -33,7 +31,7 @@ class Resource(msrest.serialization.Model): :param tags: A set of tags. Key-value pairs of additional resource provisioning properties. :type tags: dict[str, str] :param system_data: Metadata pertaining to creation and last modification of the resource. - :type system_data: ~azure.mgmt.powerbidedicated.models.SystemData + :type system_data: ~power_bi_dedicated.models.SystemData """ _validation = { @@ -87,9 +85,9 @@ class AutoScaleVCore(Resource): :param tags: A set of tags. Key-value pairs of additional resource provisioning properties. :type tags: dict[str, str] :param system_data: Metadata pertaining to creation and last modification of the resource. - :type system_data: ~azure.mgmt.powerbidedicated.models.SystemData + :type system_data: ~power_bi_dedicated.models.SystemData :param sku: Required. The SKU of the auto scale v-core resource. - :type sku: ~azure.mgmt.powerbidedicated.models.AutoScaleVCoreSku + :type sku: ~power_bi_dedicated.models.AutoScaleVCoreSku :param capacity_limit: The maximum capacity of an auto scale v-core resource. :type capacity_limit: int :param capacity_object_id: The object ID of the capacity resource associated with the auto @@ -98,7 +96,7 @@ class AutoScaleVCore(Resource): :ivar provisioning_state: The current deployment state of an auto scale v-core resource. The provisioningState is to indicate states for resource provisioning. Possible values include: "Succeeded". - :vartype provisioning_state: str or ~azure.mgmt.powerbidedicated.models.VCoreProvisioningState + :vartype provisioning_state: str or ~power_bi_dedicated.models.VCoreProvisioningState """ _validation = { @@ -147,7 +145,7 @@ class AutoScaleVCoreListResult(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :param value: Required. An array of auto scale v-core resources. - :type value: list[~azure.mgmt.powerbidedicated.models.AutoScaleVCore] + :type value: list[~power_bi_dedicated.models.AutoScaleVCore] """ _validation = { @@ -202,7 +200,7 @@ class AutoScaleVCoreProperties(AutoScaleVCoreMutableProperties): :ivar provisioning_state: The current deployment state of an auto scale v-core resource. The provisioningState is to indicate states for resource provisioning. Possible values include: "Succeeded". - :vartype provisioning_state: str or ~azure.mgmt.powerbidedicated.models.VCoreProvisioningState + :vartype provisioning_state: str or ~power_bi_dedicated.models.VCoreProvisioningState """ _validation = { @@ -236,7 +234,7 @@ class AutoScaleVCoreSku(msrest.serialization.Model): :type name: str :param tier: The name of the Azure pricing tier to which the SKU applies. Possible values include: "AutoScale". - :type tier: str or ~azure.mgmt.powerbidedicated.models.VCoreSkuTier + :type tier: str or ~power_bi_dedicated.models.VCoreSkuTier :param capacity: The capacity of an auto scale v-core resource. :type capacity: int """ @@ -269,7 +267,7 @@ class AutoScaleVCoreUpdateParameters(msrest.serialization.Model): """Update request specification. :param sku: The SKU of the auto scale v-core resource. - :type sku: ~azure.mgmt.powerbidedicated.models.AutoScaleVCoreSku + :type sku: ~power_bi_dedicated.models.AutoScaleVCoreSku :param tags: A set of tags. Key-value pairs of additional provisioning properties. :type tags: dict[str, str] :param capacity_limit: The maximum capacity of an auto scale v-core resource. @@ -305,7 +303,7 @@ class CapacitySku(msrest.serialization.Model): :type name: str :param tier: The name of the Azure pricing tier to which the SKU applies. Possible values include: "PBIE_Azure", "Premium", "AutoPremiumHost". - :type tier: str or ~azure.mgmt.powerbidedicated.models.CapacitySkuTier + :type tier: str or ~power_bi_dedicated.models.CapacitySkuTier """ _validation = { @@ -396,7 +394,7 @@ class DedicatedCapacities(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :param value: Required. An array of Dedicated capacities resources. - :type value: list[~azure.mgmt.powerbidedicated.models.DedicatedCapacity] + :type value: list[~power_bi_dedicated.models.DedicatedCapacity] """ _validation = { @@ -435,24 +433,23 @@ class DedicatedCapacity(Resource): :param tags: A set of tags. Key-value pairs of additional resource provisioning properties. :type tags: dict[str, str] :param system_data: Metadata pertaining to creation and last modification of the resource. - :type system_data: ~azure.mgmt.powerbidedicated.models.SystemData + :type system_data: ~power_bi_dedicated.models.SystemData :param sku: Required. The SKU of the PowerBI Dedicated capacity resource. - :type sku: ~azure.mgmt.powerbidedicated.models.CapacitySku + :type sku: ~power_bi_dedicated.models.CapacitySku :param administration: A collection of Dedicated capacity administrators. - :type administration: ~azure.mgmt.powerbidedicated.models.DedicatedCapacityAdministrators + :type administration: ~power_bi_dedicated.models.DedicatedCapacityAdministrators :param mode: The capacity mode. Possible values include: "Gen1", "Gen2". - :type mode: str or ~azure.mgmt.powerbidedicated.models.Mode + :type mode: str or ~power_bi_dedicated.models.Mode :ivar state: The current state of PowerBI Dedicated resource. The state is to indicate more states outside of resource provisioning. Possible values include: "Deleting", "Succeeded", "Failed", "Paused", "Suspended", "Provisioning", "Updating", "Suspending", "Pausing", "Resuming", "Preparing", "Scaling". - :vartype state: str or ~azure.mgmt.powerbidedicated.models.State + :vartype state: str or ~power_bi_dedicated.models.State :ivar provisioning_state: The current deployment state of PowerBI Dedicated resource. The provisioningState is to indicate states for resource provisioning. Possible values include: "Deleting", "Succeeded", "Failed", "Paused", "Suspended", "Provisioning", "Updating", "Suspending", "Pausing", "Resuming", "Preparing", "Scaling". - :vartype provisioning_state: str or - ~azure.mgmt.powerbidedicated.models.CapacityProvisioningState + :vartype provisioning_state: str or ~power_bi_dedicated.models.CapacityProvisioningState """ _validation = { @@ -523,9 +520,9 @@ class DedicatedCapacityMutableProperties(msrest.serialization.Model): """An object that represents a set of mutable Dedicated capacity resource properties. :param administration: A collection of Dedicated capacity administrators. - :type administration: ~azure.mgmt.powerbidedicated.models.DedicatedCapacityAdministrators + :type administration: ~power_bi_dedicated.models.DedicatedCapacityAdministrators :param mode: The capacity mode. Possible values include: "Gen1", "Gen2". - :type mode: str or ~azure.mgmt.powerbidedicated.models.Mode + :type mode: str or ~power_bi_dedicated.models.Mode """ _attribute_map = { @@ -551,20 +548,19 @@ class DedicatedCapacityProperties(DedicatedCapacityMutableProperties): Variables are only populated by the server, and will be ignored when sending a request. :param administration: A collection of Dedicated capacity administrators. - :type administration: ~azure.mgmt.powerbidedicated.models.DedicatedCapacityAdministrators + :type administration: ~power_bi_dedicated.models.DedicatedCapacityAdministrators :param mode: The capacity mode. Possible values include: "Gen1", "Gen2". - :type mode: str or ~azure.mgmt.powerbidedicated.models.Mode + :type mode: str or ~power_bi_dedicated.models.Mode :ivar state: The current state of PowerBI Dedicated resource. The state is to indicate more states outside of resource provisioning. Possible values include: "Deleting", "Succeeded", "Failed", "Paused", "Suspended", "Provisioning", "Updating", "Suspending", "Pausing", "Resuming", "Preparing", "Scaling". - :vartype state: str or ~azure.mgmt.powerbidedicated.models.State + :vartype state: str or ~power_bi_dedicated.models.State :ivar provisioning_state: The current deployment state of PowerBI Dedicated resource. The provisioningState is to indicate states for resource provisioning. Possible values include: "Deleting", "Succeeded", "Failed", "Paused", "Suspended", "Provisioning", "Updating", "Suspending", "Pausing", "Resuming", "Preparing", "Scaling". - :vartype provisioning_state: str or - ~azure.mgmt.powerbidedicated.models.CapacityProvisioningState + :vartype provisioning_state: str or ~power_bi_dedicated.models.CapacityProvisioningState """ _validation = { @@ -595,13 +591,13 @@ class DedicatedCapacityUpdateParameters(msrest.serialization.Model): """Provision request specification. :param sku: The SKU of the Dedicated capacity resource. - :type sku: ~azure.mgmt.powerbidedicated.models.CapacitySku + :type sku: ~power_bi_dedicated.models.CapacitySku :param tags: A set of tags. Key-value pairs of additional provisioning properties. :type tags: dict[str, str] :param administration: A collection of Dedicated capacity administrators. - :type administration: ~azure.mgmt.powerbidedicated.models.DedicatedCapacityAdministrators + :type administration: ~power_bi_dedicated.models.DedicatedCapacityAdministrators :param mode: The capacity mode. Possible values include: "Gen1", "Gen2". - :type mode: str or ~azure.mgmt.powerbidedicated.models.Mode + :type mode: str or ~power_bi_dedicated.models.Mode """ _attribute_map = { @@ -631,7 +627,7 @@ class ErrorResponse(msrest.serialization.Model): """Describes the format of Error response. :param error: The error object. - :type error: ~azure.mgmt.powerbidedicated.models.ErrorResponseError + :type error: ~power_bi_dedicated.models.ErrorResponseError """ _attribute_map = { @@ -682,7 +678,7 @@ class Operation(msrest.serialization.Model): :ivar name: Operation name: {provider}/{resource}/{operation}. :vartype name: str :param display: The object that represents the operation. - :type display: ~azure.mgmt.powerbidedicated.models.OperationDisplay + :type display: ~power_bi_dedicated.models.OperationDisplay """ _validation = { @@ -746,7 +742,7 @@ class OperationListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of capacities supported by the Microsoft.PowerBIDedicated resource provider. - :vartype value: list[~azure.mgmt.powerbidedicated.models.Operation] + :vartype value: list[~power_bi_dedicated.models.Operation] :ivar next_link: URL to get the next set of operation list results if there are any. :vartype next_link: str """ @@ -774,7 +770,7 @@ class SkuDetailsForExistingResource(msrest.serialization.Model): """An object that represents SKU details for existing resources. :param sku: The SKU in SKU details for existing resources. - :type sku: ~azure.mgmt.powerbidedicated.models.CapacitySku + :type sku: ~power_bi_dedicated.models.CapacitySku """ _attribute_map = { @@ -795,7 +791,7 @@ class SkuEnumerationForExistingResourceResult(msrest.serialization.Model): """An object that represents enumerating SKUs for existing resources. :param value: The collection of available SKUs for existing resources. - :type value: list[~azure.mgmt.powerbidedicated.models.SkuDetailsForExistingResource] + :type value: list[~power_bi_dedicated.models.SkuDetailsForExistingResource] """ _attribute_map = { @@ -816,7 +812,7 @@ class SkuEnumerationForNewResourceResult(msrest.serialization.Model): """An object that represents enumerating SKUs for new resources. :param value: The collection of available SKUs for new resources. - :type value: list[~azure.mgmt.powerbidedicated.models.CapacitySku] + :type value: list[~power_bi_dedicated.models.CapacitySku] """ _attribute_map = { @@ -840,14 +836,14 @@ class SystemData(msrest.serialization.Model): :type created_by: str :param created_by_type: The type of identity that created the resource. Possible values include: "User", "Application", "ManagedIdentity", "Key". - :type created_by_type: str or ~azure.mgmt.powerbidedicated.models.IdentityType + :type created_by_type: str or ~power_bi_dedicated.models.IdentityType :param created_at: The timestamp of resource creation (UTC). :type created_at: ~datetime.datetime :param last_modified_by: An identifier for the identity that last modified the resource. :type last_modified_by: str :param last_modified_by_type: The type of identity that last modified the resource. Possible values include: "User", "Application", "ManagedIdentity", "Key". - :type last_modified_by_type: str or ~azure.mgmt.powerbidedicated.models.IdentityType + :type last_modified_by_type: str or ~power_bi_dedicated.models.IdentityType :param last_modified_at: The timestamp of resource last modification (UTC). :type last_modified_at: ~datetime.datetime """ diff --git a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/models/_power_bi_dedicated_enums.py b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/models/_power_bi_dedicated_enums.py index 577b86f2d997..23b40c53dde2 100644 --- a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/models/_power_bi_dedicated_enums.py +++ b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/models/_power_bi_dedicated_enums.py @@ -1,8 +1,6 @@ # 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. +# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.4.2, generator: @autorest/python@5.8.1) # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- diff --git a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/operations/__init__.py b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/operations/__init__.py index 4178fdb5dcc7..78e4cd463bf5 100644 --- a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/operations/__init__.py +++ b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/operations/__init__.py @@ -1,8 +1,6 @@ # 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. +# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.4.2, generator: @autorest/python@5.8.1) # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- diff --git a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/operations/_auto_scale_vcores_operations.py b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/operations/_auto_scale_vcores_operations.py index 38ae7039470e..d932712c853e 100644 --- a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/operations/_auto_scale_vcores_operations.py +++ b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/operations/_auto_scale_vcores_operations.py @@ -1,8 +1,6 @@ # 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. +# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.4.2, generator: @autorest/python@5.8.1) # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from typing import TYPE_CHECKING @@ -12,7 +10,6 @@ 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 @@ -30,7 +27,7 @@ class AutoScaleVCoresOperations(object): 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.powerbidedicated.models + :type models: ~power_bi_dedicated.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -63,7 +60,7 @@ def get( :type vcore_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AutoScaleVCore, or the result of cls(response) - :rtype: ~azure.mgmt.powerbidedicated.models.AutoScaleVCore + :rtype: ~power_bi_dedicated.models.AutoScaleVCore :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoScaleVCore"] @@ -97,8 +94,8 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('AutoScaleVCore', pipeline_response) @@ -126,10 +123,10 @@ def create( a maximum of 63. :type vcore_name: str :param v_core_parameters: Contains the information used to provision the auto scale v-core. - :type v_core_parameters: ~azure.mgmt.powerbidedicated.models.AutoScaleVCore + :type v_core_parameters: ~power_bi_dedicated.models.AutoScaleVCore :keyword callable cls: A custom type or function that will be passed the direct response :return: AutoScaleVCore, or the result of cls(response) - :rtype: ~azure.mgmt.powerbidedicated.models.AutoScaleVCore + :rtype: ~power_bi_dedicated.models.AutoScaleVCore :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoScaleVCore"] @@ -168,8 +165,8 @@ def create( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('AutoScaleVCore', pipeline_response) @@ -231,8 +228,8 @@ def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) if cls: return cls(pipeline_response, None, {}) @@ -258,10 +255,10 @@ def update( :type vcore_name: str :param v_core_update_parameters: Request object that contains the updated information for the auto scale v-core. - :type v_core_update_parameters: ~azure.mgmt.powerbidedicated.models.AutoScaleVCoreUpdateParameters + :type v_core_update_parameters: ~power_bi_dedicated.models.AutoScaleVCoreUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: AutoScaleVCore, or the result of cls(response) - :rtype: ~azure.mgmt.powerbidedicated.models.AutoScaleVCore + :rtype: ~power_bi_dedicated.models.AutoScaleVCore :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoScaleVCore"] @@ -300,8 +297,8 @@ def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('AutoScaleVCore', pipeline_response) @@ -325,7 +322,7 @@ def list_by_resource_group( :type resource_group_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AutoScaleVCoreListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.powerbidedicated.models.AutoScaleVCoreListResult] + :rtype: ~azure.core.paging.ItemPaged[~power_bi_dedicated.models.AutoScaleVCoreListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoScaleVCoreListResult"] @@ -374,9 +371,9 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + 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) + raise HttpResponseError(response=response, model=error) return pipeline_response @@ -394,7 +391,7 @@ def list_by_subscription( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AutoScaleVCoreListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.powerbidedicated.models.AutoScaleVCoreListResult] + :rtype: ~azure.core.paging.ItemPaged[~power_bi_dedicated.models.AutoScaleVCoreListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoScaleVCoreListResult"] @@ -442,9 +439,9 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + 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) + raise HttpResponseError(response=response, model=error) return pipeline_response diff --git a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/operations/_capacities_operations.py b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/operations/_capacities_operations.py index f2948c55082c..77a1747347bb 100644 --- a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/operations/_capacities_operations.py +++ b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/operations/_capacities_operations.py @@ -1,8 +1,6 @@ # 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. +# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.4.2, generator: @autorest/python@5.8.1) # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from typing import TYPE_CHECKING @@ -13,8 +11,7 @@ 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 azure.core.polling.base_polling import LROBasePolling from .. import models as _models @@ -32,7 +29,7 @@ class CapacitiesOperations(object): 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.powerbidedicated.models + :type models: ~power_bi_dedicated.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -65,7 +62,7 @@ def get_details( :type dedicated_capacity_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DedicatedCapacity, or the result of cls(response) - :rtype: ~azure.mgmt.powerbidedicated.models.DedicatedCapacity + :rtype: ~power_bi_dedicated.models.DedicatedCapacity :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedCapacity"] @@ -99,8 +96,8 @@ def get_details( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('DedicatedCapacity', pipeline_response) @@ -154,8 +151,8 @@ def _create_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) if response.status_code == 200: deserialized = self._deserialize('DedicatedCapacity', pipeline_response) @@ -188,15 +185,15 @@ def begin_create( characters, and a maximum of 63. :type dedicated_capacity_name: str :param capacity_parameters: Contains the information used to provision the Dedicated capacity. - :type capacity_parameters: ~azure.mgmt.powerbidedicated.models.DedicatedCapacity + :type capacity_parameters: ~power_bi_dedicated.models.DedicatedCapacity :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: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be LROBasePolling. + 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 DedicatedCapacity or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.powerbidedicated.models.DedicatedCapacity] + :rtype: ~azure.core.polling.LROPoller[~power_bi_dedicated.models.DedicatedCapacity] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] @@ -231,7 +228,7 @@ def get_long_running_output(pipeline_response): 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -283,8 +280,8 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) if cls: return cls(pipeline_response, None, {}) @@ -309,8 +306,8 @@ def begin_delete( :type dedicated_capacity_name: 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: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be LROBasePolling. + 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 None or the result of cls(response) @@ -345,7 +342,7 @@ def get_long_running_output(pipeline_response): 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -403,8 +400,8 @@ def _update_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) if response.status_code == 200: deserialized = self._deserialize('DedicatedCapacity', pipeline_response) @@ -437,15 +434,15 @@ def begin_update( :type dedicated_capacity_name: str :param capacity_update_parameters: Request object that contains the updated information for the capacity. - :type capacity_update_parameters: ~azure.mgmt.powerbidedicated.models.DedicatedCapacityUpdateParameters + :type capacity_update_parameters: ~power_bi_dedicated.models.DedicatedCapacityUpdateParameters :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: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be LROBasePolling. + 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 DedicatedCapacity or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.powerbidedicated.models.DedicatedCapacity] + :rtype: ~azure.core.polling.LROPoller[~power_bi_dedicated.models.DedicatedCapacity] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] @@ -480,7 +477,7 @@ def get_long_running_output(pipeline_response): 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -532,8 +529,8 @@ def _suspend_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) if cls: return cls(pipeline_response, None, {}) @@ -558,8 +555,8 @@ def begin_suspend( :type dedicated_capacity_name: 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: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be LROBasePolling. + 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 None or the result of cls(response) @@ -594,7 +591,7 @@ def get_long_running_output(pipeline_response): 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -646,8 +643,8 @@ def _resume_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) if cls: return cls(pipeline_response, None, {}) @@ -672,8 +669,8 @@ def begin_resume( :type dedicated_capacity_name: 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: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be LROBasePolling. + 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 None or the result of cls(response) @@ -708,7 +705,7 @@ def get_long_running_output(pipeline_response): 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -736,7 +733,7 @@ def list_by_resource_group( :type resource_group_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DedicatedCapacities or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.powerbidedicated.models.DedicatedCapacities] + :rtype: ~azure.core.paging.ItemPaged[~power_bi_dedicated.models.DedicatedCapacities] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedCapacities"] @@ -785,9 +782,9 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + 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) + raise HttpResponseError(response=response, model=error) return pipeline_response @@ -805,7 +802,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 DedicatedCapacities or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.powerbidedicated.models.DedicatedCapacities] + :rtype: ~azure.core.paging.ItemPaged[~power_bi_dedicated.models.DedicatedCapacities] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedCapacities"] @@ -853,9 +850,9 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + 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) + raise HttpResponseError(response=response, model=error) return pipeline_response @@ -873,7 +870,7 @@ def list_skus( :keyword callable cls: A custom type or function that will be passed the direct response :return: SkuEnumerationForNewResourceResult, or the result of cls(response) - :rtype: ~azure.mgmt.powerbidedicated.models.SkuEnumerationForNewResourceResult + :rtype: ~power_bi_dedicated.models.SkuEnumerationForNewResourceResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuEnumerationForNewResourceResult"] @@ -905,8 +902,8 @@ def list_skus( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('SkuEnumerationForNewResourceResult', pipeline_response) @@ -934,7 +931,7 @@ def list_skus_for_capacity( :type dedicated_capacity_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SkuEnumerationForExistingResourceResult, or the result of cls(response) - :rtype: ~azure.mgmt.powerbidedicated.models.SkuEnumerationForExistingResourceResult + :rtype: ~power_bi_dedicated.models.SkuEnumerationForExistingResourceResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuEnumerationForExistingResourceResult"] @@ -968,8 +965,8 @@ def list_skus_for_capacity( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('SkuEnumerationForExistingResourceResult', pipeline_response) @@ -991,10 +988,10 @@ def check_name_availability( :param location: The region name which the operation will lookup into. :type location: str :param capacity_parameters: The name of the capacity. - :type capacity_parameters: ~azure.mgmt.powerbidedicated.models.CheckCapacityNameAvailabilityParameters + :type capacity_parameters: ~power_bi_dedicated.models.CheckCapacityNameAvailabilityParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: CheckCapacityNameAvailabilityResult, or the result of cls(response) - :rtype: ~azure.mgmt.powerbidedicated.models.CheckCapacityNameAvailabilityResult + :rtype: ~power_bi_dedicated.models.CheckCapacityNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckCapacityNameAvailabilityResult"] @@ -1032,8 +1029,8 @@ def check_name_availability( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('CheckCapacityNameAvailabilityResult', pipeline_response) diff --git a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/operations/_operations.py b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/operations/_operations.py index 71ca9b47ad83..f6f95f52937e 100644 --- a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/operations/_operations.py +++ b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/operations/_operations.py @@ -1,8 +1,6 @@ # 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. +# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.4.2, generator: @autorest/python@5.8.1) # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from typing import TYPE_CHECKING @@ -12,7 +10,6 @@ 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 @@ -30,7 +27,7 @@ class Operations(object): 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.powerbidedicated.models + :type models: ~power_bi_dedicated.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -54,7 +51,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 OperationListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.powerbidedicated.models.OperationListResult] + :rtype: ~azure.core.paging.ItemPaged[~power_bi_dedicated.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -98,9 +95,9 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + 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) + raise HttpResponseError(response=response, model=error) return pipeline_response