diff --git a/sdk/kusto/azure-mgmt-kusto/_meta.json b/sdk/kusto/azure-mgmt-kusto/_meta.json index 8bf49b74dbb6..ce516a129fc2 100644 --- a/sdk/kusto/azure-mgmt-kusto/_meta.json +++ b/sdk/kusto/azure-mgmt-kusto/_meta.json @@ -1,11 +1,11 @@ { "autorest": "3.7.2", "use": [ - "@autorest/python@5.12.0", + "@autorest/python@5.13.0", "@autorest/modelerfour@4.19.3" ], - "commit": "efd3d669a86d2e123f57ac3a43e5af4bb9e3a29f", + "commit": "79f95347b57d5ed7216169db308cae7c404c0742", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest_command": "autorest specification/azure-kusto/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --python3-only --track2 --use=@autorest/python@5.12.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2", + "autorest_command": "autorest specification/azure-kusto/resource-manager/readme.md --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --python3-only --use=@autorest/python@5.13.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2", "readme": "specification/azure-kusto/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/_configuration.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/_configuration.py index b36053b3cc5d..aacfdb5b6250 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/_configuration.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/_configuration.py @@ -19,7 +19,7 @@ from azure.core.credentials import TokenCredential -class KustoManagementClientConfiguration(Configuration): +class KustoManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for KustoManagementClient. Note that all parameters used to create this instance are saved as instance @@ -27,8 +27,12 @@ class KustoManagementClientConfiguration(Configuration): :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Gets subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :type subscription_id: str + :keyword api_version: Api Version. Default value is "2022-02-01". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str """ def __init__( @@ -38,6 +42,8 @@ def __init__( **kwargs: Any ) -> None: super(KustoManagementClientConfiguration, self).__init__(**kwargs) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: @@ -45,7 +51,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2022-02-01" + self.api_version = api_version self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-kusto/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/_kusto_management_client.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/_kusto_management_client.py index 6982105841f0..9767dc09752e 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/_kusto_management_client.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/_kusto_management_client.py @@ -7,11 +7,12 @@ # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, Optional, TYPE_CHECKING +from typing import Any, TYPE_CHECKING + +from msrest import Deserializer, Serializer from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient -from msrest import Deserializer, Serializer from . import models from ._configuration import KustoManagementClientConfiguration @@ -21,49 +22,53 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential -class KustoManagementClient: - """The Azure Kusto management API provides a RESTful set of web services that interact with Azure Kusto services to manage your clusters and databases. The API enables you to create, update, and delete clusters and databases. +class KustoManagementClient: # pylint: disable=too-many-instance-attributes + """The Azure Kusto management API provides a RESTful set of web services that interact with Azure + Kusto services to manage your clusters and databases. The API enables you to create, update, + and delete clusters and databases. :ivar clusters: ClustersOperations operations - :vartype clusters: kusto_management_client.operations.ClustersOperations + :vartype clusters: azure.mgmt.kusto.operations.ClustersOperations :ivar cluster_principal_assignments: ClusterPrincipalAssignmentsOperations operations :vartype cluster_principal_assignments: - kusto_management_client.operations.ClusterPrincipalAssignmentsOperations + azure.mgmt.kusto.operations.ClusterPrincipalAssignmentsOperations :ivar databases: DatabasesOperations operations - :vartype databases: kusto_management_client.operations.DatabasesOperations + :vartype databases: azure.mgmt.kusto.operations.DatabasesOperations :ivar attached_database_configurations: AttachedDatabaseConfigurationsOperations operations :vartype attached_database_configurations: - kusto_management_client.operations.AttachedDatabaseConfigurationsOperations + azure.mgmt.kusto.operations.AttachedDatabaseConfigurationsOperations :ivar managed_private_endpoints: ManagedPrivateEndpointsOperations operations :vartype managed_private_endpoints: - kusto_management_client.operations.ManagedPrivateEndpointsOperations + azure.mgmt.kusto.operations.ManagedPrivateEndpointsOperations :ivar database_principal_assignments: DatabasePrincipalAssignmentsOperations operations :vartype database_principal_assignments: - kusto_management_client.operations.DatabasePrincipalAssignmentsOperations + azure.mgmt.kusto.operations.DatabasePrincipalAssignmentsOperations :ivar scripts: ScriptsOperations operations - :vartype scripts: kusto_management_client.operations.ScriptsOperations + :vartype scripts: azure.mgmt.kusto.operations.ScriptsOperations :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations :vartype private_endpoint_connections: - kusto_management_client.operations.PrivateEndpointConnectionsOperations + azure.mgmt.kusto.operations.PrivateEndpointConnectionsOperations :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: - kusto_management_client.operations.PrivateLinkResourcesOperations + :vartype private_link_resources: azure.mgmt.kusto.operations.PrivateLinkResourcesOperations :ivar data_connections: DataConnectionsOperations operations - :vartype data_connections: kusto_management_client.operations.DataConnectionsOperations + :vartype data_connections: azure.mgmt.kusto.operations.DataConnectionsOperations :ivar operations: Operations operations - :vartype operations: kusto_management_client.operations.Operations + :vartype operations: azure.mgmt.kusto.operations.Operations :ivar operations_results: OperationsResultsOperations operations - :vartype operations_results: kusto_management_client.operations.OperationsResultsOperations + :vartype operations_results: azure.mgmt.kusto.operations.OperationsResultsOperations :ivar operations_results_location: OperationsResultsLocationOperations operations :vartype operations_results_location: - kusto_management_client.operations.OperationsResultsLocationOperations + azure.mgmt.kusto.operations.OperationsResultsLocationOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. :type subscription_id: str - :param base_url: Service URL. Default value is 'https://management.azure.com'. + :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str + :keyword api_version: Api Version. Default value is "2022-02-01". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ @@ -99,7 +104,7 @@ def __init__( def _send_request( self, - request, # type: HttpRequest + request: HttpRequest, **kwargs: Any ) -> HttpResponse: """Runs the network request through the client's chained policies. diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/_metadata.json b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/_metadata.json deleted file mode 100644 index 9d00f43838c4..000000000000 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/_metadata.json +++ /dev/null @@ -1,114 +0,0 @@ -{ - "chosen_version": "2022-02-01", - "total_api_version_list": ["2022-02-01"], - "client": { - "name": "KustoManagementClient", - "filename": "_kusto_management_client", - "description": "The Azure Kusto management API provides a RESTful set of web services that interact with Azure Kusto services to manage your clusters and databases. The API enables you to create, update, and delete clusters and databases.", - "host_value": "\"https://management.azure.com\"", - "parameterized_host_template": null, - "azure_arm": true, - "has_lro_operations": true, - "client_side_validation": false, - "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"KustoManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", - "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"KustoManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" - }, - "global_parameters": { - "sync": { - "credential": { - "signature": "credential, # type: \"TokenCredential\"", - "description": "Credential needed for the client to connect to Azure.", - "docstring_type": "~azure.core.credentials.TokenCredential", - "required": true - }, - "subscription_id": { - "signature": "subscription_id, # type: str", - "description": "Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", - "docstring_type": "str", - "required": true - } - }, - "async": { - "credential": { - "signature": "credential: \"AsyncTokenCredential\",", - "description": "Credential needed for the client to connect to Azure.", - "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", - "required": true - }, - "subscription_id": { - "signature": "subscription_id: str,", - "description": "Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", - "docstring_type": "str", - "required": true - } - }, - "constant": { - }, - "call": "credential, 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=\"https://management.azure.com\", # type: 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: str = \"https://management.azure.com\",", - "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": true, - "credential_scopes": ["https://management.azure.com/.default"], - "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", - "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" - }, - "operation_groups": { - "clusters": "ClustersOperations", - "cluster_principal_assignments": "ClusterPrincipalAssignmentsOperations", - "databases": "DatabasesOperations", - "attached_database_configurations": "AttachedDatabaseConfigurationsOperations", - "managed_private_endpoints": "ManagedPrivateEndpointsOperations", - "database_principal_assignments": "DatabasePrincipalAssignmentsOperations", - "scripts": "ScriptsOperations", - "private_endpoint_connections": "PrivateEndpointConnectionsOperations", - "private_link_resources": "PrivateLinkResourcesOperations", - "data_connections": "DataConnectionsOperations", - "operations": "Operations", - "operations_results": "OperationsResultsOperations", - "operations_results_location": "OperationsResultsLocationOperations" - } -} \ No newline at end of file diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/_version.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/_version.py index f30401ec2040..e32dc6ec4218 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/_version.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "2.2.0" +VERSION = "2.0.0b1" diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/_configuration.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/_configuration.py index ee409ddb329c..c7cca168bcf9 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/_configuration.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/_configuration.py @@ -19,7 +19,7 @@ from azure.core.credentials_async import AsyncTokenCredential -class KustoManagementClientConfiguration(Configuration): +class KustoManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for KustoManagementClient. Note that all parameters used to create this instance are saved as instance @@ -27,8 +27,12 @@ class KustoManagementClientConfiguration(Configuration): :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Gets subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :type subscription_id: str + :keyword api_version: Api Version. Default value is "2022-02-01". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str """ def __init__( @@ -38,6 +42,8 @@ def __init__( **kwargs: Any ) -> None: super(KustoManagementClientConfiguration, self).__init__(**kwargs) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: @@ -45,7 +51,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2022-02-01" + self.api_version = api_version self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-kusto/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/_kusto_management_client.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/_kusto_management_client.py index 4c1a25d8519d..b8de29baaffa 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/_kusto_management_client.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/_kusto_management_client.py @@ -7,11 +7,12 @@ # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, Awaitable, Optional, TYPE_CHECKING +from typing import Any, Awaitable, TYPE_CHECKING + +from msrest import Deserializer, Serializer from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient -from msrest import Deserializer, Serializer from .. import models from ._configuration import KustoManagementClientConfiguration @@ -21,49 +22,53 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class KustoManagementClient: - """The Azure Kusto management API provides a RESTful set of web services that interact with Azure Kusto services to manage your clusters and databases. The API enables you to create, update, and delete clusters and databases. +class KustoManagementClient: # pylint: disable=too-many-instance-attributes + """The Azure Kusto management API provides a RESTful set of web services that interact with Azure + Kusto services to manage your clusters and databases. The API enables you to create, update, + and delete clusters and databases. :ivar clusters: ClustersOperations operations - :vartype clusters: kusto_management_client.aio.operations.ClustersOperations + :vartype clusters: azure.mgmt.kusto.aio.operations.ClustersOperations :ivar cluster_principal_assignments: ClusterPrincipalAssignmentsOperations operations :vartype cluster_principal_assignments: - kusto_management_client.aio.operations.ClusterPrincipalAssignmentsOperations + azure.mgmt.kusto.aio.operations.ClusterPrincipalAssignmentsOperations :ivar databases: DatabasesOperations operations - :vartype databases: kusto_management_client.aio.operations.DatabasesOperations + :vartype databases: azure.mgmt.kusto.aio.operations.DatabasesOperations :ivar attached_database_configurations: AttachedDatabaseConfigurationsOperations operations :vartype attached_database_configurations: - kusto_management_client.aio.operations.AttachedDatabaseConfigurationsOperations + azure.mgmt.kusto.aio.operations.AttachedDatabaseConfigurationsOperations :ivar managed_private_endpoints: ManagedPrivateEndpointsOperations operations :vartype managed_private_endpoints: - kusto_management_client.aio.operations.ManagedPrivateEndpointsOperations + azure.mgmt.kusto.aio.operations.ManagedPrivateEndpointsOperations :ivar database_principal_assignments: DatabasePrincipalAssignmentsOperations operations :vartype database_principal_assignments: - kusto_management_client.aio.operations.DatabasePrincipalAssignmentsOperations + azure.mgmt.kusto.aio.operations.DatabasePrincipalAssignmentsOperations :ivar scripts: ScriptsOperations operations - :vartype scripts: kusto_management_client.aio.operations.ScriptsOperations + :vartype scripts: azure.mgmt.kusto.aio.operations.ScriptsOperations :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations :vartype private_endpoint_connections: - kusto_management_client.aio.operations.PrivateEndpointConnectionsOperations + azure.mgmt.kusto.aio.operations.PrivateEndpointConnectionsOperations :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: - kusto_management_client.aio.operations.PrivateLinkResourcesOperations + :vartype private_link_resources: azure.mgmt.kusto.aio.operations.PrivateLinkResourcesOperations :ivar data_connections: DataConnectionsOperations operations - :vartype data_connections: kusto_management_client.aio.operations.DataConnectionsOperations + :vartype data_connections: azure.mgmt.kusto.aio.operations.DataConnectionsOperations :ivar operations: Operations operations - :vartype operations: kusto_management_client.aio.operations.Operations + :vartype operations: azure.mgmt.kusto.aio.operations.Operations :ivar operations_results: OperationsResultsOperations operations - :vartype operations_results: kusto_management_client.aio.operations.OperationsResultsOperations + :vartype operations_results: azure.mgmt.kusto.aio.operations.OperationsResultsOperations :ivar operations_results_location: OperationsResultsLocationOperations operations :vartype operations_results_location: - kusto_management_client.aio.operations.OperationsResultsLocationOperations + azure.mgmt.kusto.aio.operations.OperationsResultsLocationOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. :type subscription_id: str - :param base_url: Service URL. Default value is 'https://management.azure.com'. + :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str + :keyword api_version: Api Version. Default value is "2022-02-01". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_attached_database_configurations_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_attached_database_configurations_operations.py index 8482b3470c7d..04506fb9b600 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_attached_database_configurations_operations.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_attached_database_configurations_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -33,7 +32,7 @@ class AttachedDatabaseConfigurationsOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~kusto_management_client.models + :type models: ~azure.mgmt.kusto.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -64,11 +63,10 @@ async def check_name_availability( :param cluster_name: The name of the Kusto cluster. :type cluster_name: str :param resource_name: The name of the resource. - :type resource_name: - ~kusto_management_client.models.AttachedDatabaseConfigurationsCheckNameRequest + :type resource_name: ~azure.mgmt.kusto.models.AttachedDatabaseConfigurationsCheckNameRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: CheckNameResult, or the result of cls(response) - :rtype: ~kusto_management_client.models.CheckNameResult + :rtype: ~azure.mgmt.kusto.models.CheckNameResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameResult"] @@ -77,6 +75,7 @@ async def check_name_availability( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(resource_name, 'AttachedDatabaseConfigurationsCheckNameRequest') @@ -85,6 +84,7 @@ async def check_name_availability( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self.check_name_availability.metadata['url'], @@ -92,7 +92,11 @@ async def check_name_availability( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -106,7 +110,7 @@ async def check_name_availability( return deserialized - check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurationCheckNameAvailability'} # type: ignore + check_name_availability.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurationCheckNameAvailability"} # type: ignore @distributed_trace @@ -126,9 +130,11 @@ def list_by_cluster( :return: An iterator like instance of either AttachedDatabaseConfigurationListResult or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~kusto_management_client.models.AttachedDatabaseConfigurationListResult] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kusto.models.AttachedDatabaseConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.AttachedDatabaseConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -141,6 +147,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_by_cluster.metadata['url'], ) request = _convert_request(request) @@ -152,6 +159,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -169,7 +177,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -182,7 +194,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_cluster.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations'} # type: ignore + list_by_cluster.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations"} # type: ignore @distributed_trace_async async def get( @@ -202,7 +214,7 @@ async def get( :type attached_database_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AttachedDatabaseConfiguration, or the result of cls(response) - :rtype: ~kusto_management_client.models.AttachedDatabaseConfiguration + :rtype: ~azure.mgmt.kusto.models.AttachedDatabaseConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AttachedDatabaseConfiguration"] @@ -211,18 +223,25 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, cluster_name=cluster_name, attached_database_configuration_name=attached_database_configuration_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -236,7 +255,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}"} # type: ignore async def _create_or_update_initial( @@ -253,6 +272,7 @@ async def _create_or_update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'AttachedDatabaseConfiguration') @@ -262,6 +282,7 @@ async def _create_or_update_initial( cluster_name=cluster_name, attached_database_configuration_name=attached_database_configuration_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self._create_or_update_initial.metadata['url'], @@ -269,7 +290,11 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201, 202]: @@ -290,7 +315,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}"} # type: ignore @distributed_trace_async @@ -311,7 +336,7 @@ async def begin_create_or_update( :param attached_database_configuration_name: The name of the attached database configuration. :type attached_database_configuration_name: str :param parameters: The database parameters supplied to the CreateOrUpdate operation. - :type parameters: ~kusto_management_client.models.AttachedDatabaseConfiguration + :type parameters: ~azure.mgmt.kusto.models.AttachedDatabaseConfiguration :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -323,11 +348,12 @@ async def begin_create_or_update( :return: An instance of AsyncLROPoller that returns either AttachedDatabaseConfiguration or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~kusto_management_client.models.AttachedDatabaseConfiguration] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kusto.models.AttachedDatabaseConfiguration] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AttachedDatabaseConfiguration"] lro_delay = kwargs.pop( 'polling_interval', @@ -340,6 +366,7 @@ async def begin_create_or_update( cluster_name=cluster_name, attached_database_configuration_name=attached_database_configuration_name, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -364,12 +391,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}"} # type: ignore - async def _delete_initial( + async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -382,18 +408,25 @@ async def _delete_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + request = build_delete_request_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, attached_database_configuration_name=attached_database_configuration_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self._delete_initial.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -403,11 +436,11 @@ async def _delete_initial( if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}"} # type: ignore @distributed_trace_async - async def begin_delete( + async def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -434,7 +467,8 @@ async def begin_delete( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -446,6 +480,7 @@ async def begin_delete( resource_group_name=resource_group_name, cluster_name=cluster_name, attached_database_configuration_name=attached_database_configuration_name, + api_version=api_version, cls=lambda x,y,z: x, **kwargs ) @@ -466,7 +501,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}"} # type: ignore diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_cluster_principal_assignments_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_cluster_principal_assignments_operations.py index 4683a7b46c99..ef61474ec7d1 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_cluster_principal_assignments_operations.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_cluster_principal_assignments_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -33,7 +32,7 @@ class ClusterPrincipalAssignmentsOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~kusto_management_client.models + :type models: ~azure.mgmt.kusto.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -64,10 +63,10 @@ async def check_name_availability( :type cluster_name: str :param principal_assignment_name: The name of the principal assignment. :type principal_assignment_name: - ~kusto_management_client.models.ClusterPrincipalAssignmentCheckNameRequest + ~azure.mgmt.kusto.models.ClusterPrincipalAssignmentCheckNameRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: CheckNameResult, or the result of cls(response) - :rtype: ~kusto_management_client.models.CheckNameResult + :rtype: ~azure.mgmt.kusto.models.CheckNameResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameResult"] @@ -76,6 +75,7 @@ async def check_name_availability( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(principal_assignment_name, 'ClusterPrincipalAssignmentCheckNameRequest') @@ -84,6 +84,7 @@ async def check_name_availability( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self.check_name_availability.metadata['url'], @@ -91,7 +92,11 @@ async def check_name_availability( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -105,7 +110,7 @@ async def check_name_availability( return deserialized - check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/checkPrincipalAssignmentNameAvailability'} # type: ignore + check_name_availability.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/checkPrincipalAssignmentNameAvailability"} # type: ignore @distributed_trace_async @@ -126,7 +131,7 @@ async def get( :type principal_assignment_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ClusterPrincipalAssignment, or the result of cls(response) - :rtype: ~kusto_management_client.models.ClusterPrincipalAssignment + :rtype: ~azure.mgmt.kusto.models.ClusterPrincipalAssignment :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ClusterPrincipalAssignment"] @@ -135,18 +140,25 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, cluster_name=cluster_name, principal_assignment_name=principal_assignment_name, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -160,7 +172,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}"} # type: ignore async def _create_or_update_initial( @@ -177,6 +189,7 @@ async def _create_or_update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'ClusterPrincipalAssignment') @@ -186,6 +199,7 @@ async def _create_or_update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, principal_assignment_name=principal_assignment_name, + api_version=api_version, content_type=content_type, json=_json, template_url=self._create_or_update_initial.metadata['url'], @@ -193,7 +207,11 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -211,7 +229,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}"} # type: ignore @distributed_trace_async @@ -233,7 +251,7 @@ async def begin_create_or_update( :type principal_assignment_name: str :param parameters: The Kusto cluster principalAssignment's parameters supplied for the operation. - :type parameters: ~kusto_management_client.models.ClusterPrincipalAssignment + :type parameters: ~azure.mgmt.kusto.models.ClusterPrincipalAssignment :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -244,12 +262,12 @@ async def begin_create_or_update( Retry-After header is present. :return: An instance of AsyncLROPoller that returns either ClusterPrincipalAssignment or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~kusto_management_client.models.ClusterPrincipalAssignment] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kusto.models.ClusterPrincipalAssignment] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ClusterPrincipalAssignment"] lro_delay = kwargs.pop( 'polling_interval', @@ -262,6 +280,7 @@ async def begin_create_or_update( cluster_name=cluster_name, principal_assignment_name=principal_assignment_name, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -286,12 +305,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}"} # type: ignore - async def _delete_initial( + async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -304,18 +322,25 @@ async def _delete_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, cluster_name=cluster_name, principal_assignment_name=principal_assignment_name, + api_version=api_version, template_url=self._delete_initial.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -325,11 +350,11 @@ async def _delete_initial( if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}"} # type: ignore @distributed_trace_async - async def begin_delete( + async def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -356,7 +381,8 @@ async def begin_delete( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -368,6 +394,7 @@ async def begin_delete( resource_group_name=resource_group_name, cluster_name=cluster_name, principal_assignment_name=principal_assignment_name, + api_version=api_version, cls=lambda x,y,z: x, **kwargs ) @@ -388,10 +415,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}"} # type: ignore @distributed_trace def list( @@ -410,9 +436,11 @@ def list( :return: An iterator like instance of either ClusterPrincipalAssignmentListResult or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~kusto_management_client.models.ClusterPrincipalAssignmentListResult] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kusto.models.ClusterPrincipalAssignmentListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ClusterPrincipalAssignmentListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -425,6 +453,7 @@ def prepare_request(next_link=None): subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, cluster_name=cluster_name, + api_version=api_version, template_url=self.list.metadata['url'], ) request = _convert_request(request) @@ -436,6 +465,7 @@ def prepare_request(next_link=None): subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, cluster_name=cluster_name, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -453,7 +483,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -466,4 +500,4 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments"} # type: ignore diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_clusters_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_clusters_operations.py index 64eeac6d6c30..ba30ee856720 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_clusters_operations.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_clusters_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -26,14 +25,14 @@ T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] -class ClustersOperations: +class ClustersOperations: # pylint: disable=too-many-public-methods """ClustersOperations async operations. You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~kusto_management_client.models + :type models: ~azure.mgmt.kusto.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -63,7 +62,7 @@ async def get( :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Cluster, or the result of cls(response) - :rtype: ~kusto_management_client.models.Cluster + :rtype: ~azure.mgmt.kusto.models.Cluster :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Cluster"] @@ -72,17 +71,24 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -96,7 +102,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}"} # type: ignore async def _create_or_update_initial( @@ -114,6 +120,7 @@ async def _create_or_update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'Cluster') @@ -122,6 +129,7 @@ async def _create_or_update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -131,7 +139,11 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -149,7 +161,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}"} # type: ignore @distributed_trace_async @@ -169,13 +181,14 @@ async def begin_create_or_update( :param cluster_name: The name of the Kusto cluster. :type cluster_name: str :param parameters: The Kusto cluster parameters supplied to the CreateOrUpdate operation. - :type parameters: ~kusto_management_client.models.Cluster + :type parameters: ~azure.mgmt.kusto.models.Cluster :param if_match: The ETag of the cluster. Omit this value to always overwrite the current cluster. Specify the last-seen ETag value to prevent accidentally overwriting concurrent - changes. + changes. Default value is None. :type if_match: str :param if_none_match: Set to '*' to allow a new cluster to be created, but to prevent updating - an existing cluster. Other values will result in a 412 Pre-condition Failed response. + an existing cluster. Other values will result in a 412 Pre-condition Failed response. Default + value is None. :type if_none_match: 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. @@ -187,11 +200,12 @@ async def begin_create_or_update( Retry-After header is present. :return: An instance of AsyncLROPoller that returns either Cluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~kusto_management_client.models.Cluster] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kusto.models.Cluster] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Cluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -205,6 +219,7 @@ async def begin_create_or_update( parameters=parameters, if_match=if_match, if_none_match=if_none_match, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -229,10 +244,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}"} # type: ignore async def _update_initial( self, @@ -248,6 +262,7 @@ async def _update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'ClusterUpdate') @@ -256,6 +271,7 @@ async def _update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -264,7 +280,11 @@ async def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201, 202]: @@ -290,7 +310,7 @@ async def _update_initial( return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} # type: ignore + _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}"} # type: ignore @distributed_trace_async @@ -309,10 +329,10 @@ async def begin_update( :param cluster_name: The name of the Kusto cluster. :type cluster_name: str :param parameters: The Kusto cluster parameters supplied to the Update operation. - :type parameters: ~kusto_management_client.models.ClusterUpdate + :type parameters: ~azure.mgmt.kusto.models.ClusterUpdate :param if_match: The ETag of the cluster. Omit this value to always overwrite the current cluster. Specify the last-seen ETag value to prevent accidentally overwriting concurrent - changes. + changes. Default value is None. :type if_match: 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. @@ -324,11 +344,12 @@ async def begin_update( Retry-After header is present. :return: An instance of AsyncLROPoller that returns either Cluster or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~kusto_management_client.models.Cluster] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kusto.models.Cluster] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Cluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -341,6 +362,7 @@ async def begin_update( cluster_name=cluster_name, parameters=parameters, if_match=if_match, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -365,12 +387,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} # type: ignore + begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}"} # type: ignore - async def _delete_initial( + async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -382,17 +403,24 @@ async def _delete_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + request = build_delete_request_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self._delete_initial.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -402,11 +430,11 @@ async def _delete_initial( if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}"} # type: ignore @distributed_trace_async - async def begin_delete( + async def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -430,7 +458,8 @@ async def begin_delete( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -441,6 +470,7 @@ async def begin_delete( raw_result = await self._delete_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, + api_version=api_version, cls=lambda x,y,z: x, **kwargs ) @@ -461,12 +491,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}"} # type: ignore - async def _stop_initial( + async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -478,17 +507,24 @@ async def _stop_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + request = build_stop_request_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self._stop_initial.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -498,11 +534,11 @@ async def _stop_initial( if cls: return cls(pipeline_response, None, {}) - _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/stop'} # type: ignore + _stop_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/stop"} # type: ignore @distributed_trace_async - async def begin_stop( + async def begin_stop( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -526,7 +562,8 @@ async def begin_stop( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -537,6 +574,7 @@ async def begin_stop( raw_result = await self._stop_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, + api_version=api_version, cls=lambda x,y,z: x, **kwargs ) @@ -557,12 +595,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/stop'} # type: ignore + begin_stop.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/stop"} # type: ignore - async def _start_initial( + async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -574,17 +611,24 @@ async def _start_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + request = build_start_request_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self._start_initial.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -594,11 +638,11 @@ async def _start_initial( if cls: return cls(pipeline_response, None, {}) - _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/start'} # type: ignore + _start_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/start"} # type: ignore @distributed_trace_async - async def begin_start( + async def begin_start( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -622,7 +666,8 @@ async def begin_start( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -633,6 +678,7 @@ async def begin_start( raw_result = await self._start_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, + api_version=api_version, cls=lambda x,y,z: x, **kwargs ) @@ -653,10 +699,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/start'} # type: ignore + begin_start.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/start"} # type: ignore @distributed_trace def list_follower_databases( @@ -676,9 +721,11 @@ def list_follower_databases( :return: An iterator like instance of either FollowerDatabaseListResult or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~kusto_management_client.models.FollowerDatabaseListResult] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kusto.models.FollowerDatabaseListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.FollowerDatabaseListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -691,6 +738,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_follower_databases.metadata['url'], ) request = _convert_request(request) @@ -702,6 +750,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -719,7 +768,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -732,9 +785,9 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_follower_databases.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/listFollowerDatabases'} # type: ignore + list_follower_databases.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/listFollowerDatabases"} # type: ignore - async def _detach_follower_databases_initial( + async def _detach_follower_databases_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -747,6 +800,7 @@ async def _detach_follower_databases_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(follower_database_to_remove, 'FollowerDatabaseDefinition') @@ -755,6 +809,7 @@ async def _detach_follower_databases_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self._detach_follower_databases_initial.metadata['url'], @@ -762,7 +817,11 @@ async def _detach_follower_databases_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -772,11 +831,11 @@ async def _detach_follower_databases_initial( if cls: return cls(pipeline_response, None, {}) - _detach_follower_databases_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/detachFollowerDatabases'} # type: ignore + _detach_follower_databases_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/detachFollowerDatabases"} # type: ignore @distributed_trace_async - async def begin_detach_follower_databases( + async def begin_detach_follower_databases( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -790,7 +849,7 @@ async def begin_detach_follower_databases( :param cluster_name: The name of the Kusto cluster. :type cluster_name: str :param follower_database_to_remove: The follower databases properties to remove. - :type follower_database_to_remove: ~kusto_management_client.models.FollowerDatabaseDefinition + :type follower_database_to_remove: ~azure.mgmt.kusto.models.FollowerDatabaseDefinition :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -803,8 +862,9 @@ async def begin_detach_follower_databases( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -816,6 +876,7 @@ async def begin_detach_follower_databases( resource_group_name=resource_group_name, cluster_name=cluster_name, follower_database_to_remove=follower_database_to_remove, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -837,10 +898,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_detach_follower_databases.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/detachFollowerDatabases'} # type: ignore + begin_detach_follower_databases.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/detachFollowerDatabases"} # type: ignore async def _diagnose_virtual_network_initial( self, @@ -854,17 +914,24 @@ async def _diagnose_virtual_network_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + request = build_diagnose_virtual_network_request_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self._diagnose_virtual_network_initial.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -880,7 +947,7 @@ async def _diagnose_virtual_network_initial( return deserialized - _diagnose_virtual_network_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/diagnoseVirtualNetwork'} # type: ignore + _diagnose_virtual_network_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/diagnoseVirtualNetwork"} # type: ignore @distributed_trace_async @@ -908,10 +975,11 @@ async def begin_diagnose_virtual_network( :return: An instance of AsyncLROPoller that returns either DiagnoseVirtualNetworkResult or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~kusto_management_client.models.DiagnoseVirtualNetworkResult] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kusto.models.DiagnoseVirtualNetworkResult] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnoseVirtualNetworkResult"] lro_delay = kwargs.pop( 'polling_interval', @@ -922,6 +990,7 @@ async def begin_diagnose_virtual_network( raw_result = await self._diagnose_virtual_network_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, + api_version=api_version, cls=lambda x,y,z: x, **kwargs ) @@ -945,10 +1014,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_diagnose_virtual_network.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/diagnoseVirtualNetwork'} # type: ignore + begin_diagnose_virtual_network.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/diagnoseVirtualNetwork"} # type: ignore @distributed_trace def list_by_resource_group( @@ -962,10 +1030,11 @@ 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 ClusterListResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~kusto_management_client.models.ClusterListResult] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kusto.models.ClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ClusterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -977,6 +1046,7 @@ def prepare_request(next_link=None): request = build_list_by_resource_group_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_by_resource_group.metadata['url'], ) request = _convert_request(request) @@ -987,6 +1057,7 @@ def prepare_request(next_link=None): request = build_list_by_resource_group_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -1004,7 +1075,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1017,7 +1092,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters'} # type: ignore + list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters"} # type: ignore @distributed_trace def list( @@ -1028,10 +1103,11 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ClusterListResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~kusto_management_client.models.ClusterListResult] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kusto.models.ClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ClusterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -1042,6 +1118,7 @@ def prepare_request(next_link=None): request = build_list_request( subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list.metadata['url'], ) request = _convert_request(request) @@ -1051,6 +1128,7 @@ def prepare_request(next_link=None): request = build_list_request( subscription_id=self._config.subscription_id, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -1068,7 +1146,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1081,7 +1163,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/clusters'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/clusters"} # type: ignore @distributed_trace def list_skus( @@ -1092,10 +1174,11 @@ def list_skus( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SkuDescriptionList or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~kusto_management_client.models.SkuDescriptionList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kusto.models.SkuDescriptionList] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuDescriptionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -1106,6 +1189,7 @@ def prepare_request(next_link=None): request = build_list_skus_request( subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_skus.metadata['url'], ) request = _convert_request(request) @@ -1115,6 +1199,7 @@ def prepare_request(next_link=None): request = build_list_skus_request( subscription_id=self._config.subscription_id, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -1132,7 +1217,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1145,7 +1234,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_skus.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/skus'} # type: ignore + list_skus.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/skus"} # type: ignore @distributed_trace_async async def check_name_availability( @@ -1159,10 +1248,10 @@ async def check_name_availability( :param location: Azure location (region) name. :type location: str :param cluster_name: The name of the cluster. - :type cluster_name: ~kusto_management_client.models.ClusterCheckNameRequest + :type cluster_name: ~azure.mgmt.kusto.models.ClusterCheckNameRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: CheckNameResult, or the result of cls(response) - :rtype: ~kusto_management_client.models.CheckNameResult + :rtype: ~azure.mgmt.kusto.models.CheckNameResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameResult"] @@ -1171,6 +1260,7 @@ async def check_name_availability( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(cluster_name, 'ClusterCheckNameRequest') @@ -1178,6 +1268,7 @@ async def check_name_availability( request = build_check_name_availability_request( subscription_id=self._config.subscription_id, location=location, + api_version=api_version, content_type=content_type, json=_json, template_url=self.check_name_availability.metadata['url'], @@ -1185,7 +1276,11 @@ async def check_name_availability( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1199,7 +1294,7 @@ async def check_name_availability( return deserialized - check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/locations/{location}/checkNameAvailability'} # type: ignore + check_name_availability.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/locations/{location}/checkNameAvailability"} # type: ignore @distributed_trace @@ -1219,9 +1314,11 @@ def list_skus_by_resource( :return: An iterator like instance of either ListResourceSkusResult or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~kusto_management_client.models.ListResourceSkusResult] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kusto.models.ListResourceSkusResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListResourceSkusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -1234,6 +1331,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_skus_by_resource.metadata['url'], ) request = _convert_request(request) @@ -1245,6 +1343,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -1262,7 +1361,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1275,7 +1378,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_skus_by_resource.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/skus'} # type: ignore + list_skus_by_resource.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/skus"} # type: ignore @distributed_trace def list_outbound_network_dependencies_endpoints( @@ -1294,9 +1397,11 @@ def list_outbound_network_dependencies_endpoints( :return: An iterator like instance of either OutboundNetworkDependenciesEndpointListResult or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~kusto_management_client.models.OutboundNetworkDependenciesEndpointListResult] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kusto.models.OutboundNetworkDependenciesEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundNetworkDependenciesEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -1309,6 +1414,7 @@ def prepare_request(next_link=None): subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, cluster_name=cluster_name, + api_version=api_version, template_url=self.list_outbound_network_dependencies_endpoints.metadata['url'], ) request = _convert_request(request) @@ -1320,6 +1426,7 @@ def prepare_request(next_link=None): subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, cluster_name=cluster_name, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -1337,7 +1444,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1350,7 +1461,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_outbound_network_dependencies_endpoints.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/outboundNetworkDependenciesEndpoints'} # type: ignore + list_outbound_network_dependencies_endpoints.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/outboundNetworkDependenciesEndpoints"} # type: ignore @distributed_trace def list_language_extensions( @@ -1369,9 +1480,11 @@ def list_language_extensions( :return: An iterator like instance of either LanguageExtensionsList or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~kusto_management_client.models.LanguageExtensionsList] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kusto.models.LanguageExtensionsList] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.LanguageExtensionsList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -1384,6 +1497,7 @@ def prepare_request(next_link=None): subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, cluster_name=cluster_name, + api_version=api_version, template_url=self.list_language_extensions.metadata['url'], ) request = _convert_request(request) @@ -1395,6 +1509,7 @@ def prepare_request(next_link=None): subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, cluster_name=cluster_name, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -1412,7 +1527,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1425,9 +1544,9 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_language_extensions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/listLanguageExtensions'} # type: ignore + list_language_extensions.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/listLanguageExtensions"} # type: ignore - async def _add_language_extensions_initial( + async def _add_language_extensions_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -1440,6 +1559,7 @@ async def _add_language_extensions_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(language_extensions_to_add, 'LanguageExtensionsList') @@ -1448,6 +1568,7 @@ async def _add_language_extensions_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, cluster_name=cluster_name, + api_version=api_version, content_type=content_type, json=_json, template_url=self._add_language_extensions_initial.metadata['url'], @@ -1455,7 +1576,11 @@ async def _add_language_extensions_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -1465,11 +1590,11 @@ async def _add_language_extensions_initial( if cls: return cls(pipeline_response, None, {}) - _add_language_extensions_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/addLanguageExtensions'} # type: ignore + _add_language_extensions_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/addLanguageExtensions"} # type: ignore @distributed_trace_async - async def begin_add_language_extensions( + async def begin_add_language_extensions( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -1483,7 +1608,7 @@ async def begin_add_language_extensions( :param cluster_name: The name of the Kusto cluster. :type cluster_name: str :param language_extensions_to_add: The language extensions to add. - :type language_extensions_to_add: ~kusto_management_client.models.LanguageExtensionsList + :type language_extensions_to_add: ~azure.mgmt.kusto.models.LanguageExtensionsList :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -1496,8 +1621,9 @@ async def begin_add_language_extensions( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1509,6 +1635,7 @@ async def begin_add_language_extensions( resource_group_name=resource_group_name, cluster_name=cluster_name, language_extensions_to_add=language_extensions_to_add, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -1530,12 +1657,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_add_language_extensions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/addLanguageExtensions'} # type: ignore + begin_add_language_extensions.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/addLanguageExtensions"} # type: ignore - async def _remove_language_extensions_initial( + async def _remove_language_extensions_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -1548,6 +1674,7 @@ async def _remove_language_extensions_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(language_extensions_to_remove, 'LanguageExtensionsList') @@ -1556,6 +1683,7 @@ async def _remove_language_extensions_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, cluster_name=cluster_name, + api_version=api_version, content_type=content_type, json=_json, template_url=self._remove_language_extensions_initial.metadata['url'], @@ -1563,7 +1691,11 @@ async def _remove_language_extensions_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -1573,11 +1705,11 @@ async def _remove_language_extensions_initial( if cls: return cls(pipeline_response, None, {}) - _remove_language_extensions_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/removeLanguageExtensions'} # type: ignore + _remove_language_extensions_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/removeLanguageExtensions"} # type: ignore @distributed_trace_async - async def begin_remove_language_extensions( + async def begin_remove_language_extensions( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -1591,7 +1723,7 @@ async def begin_remove_language_extensions( :param cluster_name: The name of the Kusto cluster. :type cluster_name: str :param language_extensions_to_remove: The language extensions to remove. - :type language_extensions_to_remove: ~kusto_management_client.models.LanguageExtensionsList + :type language_extensions_to_remove: ~azure.mgmt.kusto.models.LanguageExtensionsList :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -1604,8 +1736,9 @@ async def begin_remove_language_extensions( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1617,6 +1750,7 @@ async def begin_remove_language_extensions( resource_group_name=resource_group_name, cluster_name=cluster_name, language_extensions_to_remove=language_extensions_to_remove, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -1638,7 +1772,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_remove_language_extensions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/removeLanguageExtensions'} # type: ignore + begin_remove_language_extensions.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/removeLanguageExtensions"} # type: ignore diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_data_connections_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_data_connections_operations.py index f67b082ac521..589bca6aaac1 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_data_connections_operations.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_data_connections_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -33,7 +32,7 @@ class DataConnectionsOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~kusto_management_client.models + :type models: ~azure.mgmt.kusto.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -68,9 +67,11 @@ def list_by_database( :return: An iterator like instance of either DataConnectionListResult or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~kusto_management_client.models.DataConnectionListResult] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kusto.models.DataConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.DataConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -84,6 +85,7 @@ def prepare_request(next_link=None): cluster_name=cluster_name, database_name=database_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_by_database.metadata['url'], ) request = _convert_request(request) @@ -96,6 +98,7 @@ def prepare_request(next_link=None): cluster_name=cluster_name, database_name=database_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -113,7 +116,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -126,7 +133,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections'} # type: ignore + list_by_database.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections"} # type: ignore async def _data_connection_validation_initial( self, @@ -142,6 +149,7 @@ async def _data_connection_validation_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'DataConnectionValidation') @@ -151,6 +159,7 @@ async def _data_connection_validation_initial( cluster_name=cluster_name, database_name=database_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self._data_connection_validation_initial.metadata['url'], @@ -158,7 +167,11 @@ async def _data_connection_validation_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -174,7 +187,7 @@ async def _data_connection_validation_initial( return deserialized - _data_connection_validation_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnectionValidation'} # type: ignore + _data_connection_validation_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnectionValidation"} # type: ignore @distributed_trace_async @@ -195,7 +208,7 @@ async def begin_data_connection_validation( :param database_name: The name of the database in the Kusto cluster. :type database_name: str :param parameters: The data connection parameters supplied to the CreateOrUpdate operation. - :type parameters: ~kusto_management_client.models.DataConnectionValidation + :type parameters: ~azure.mgmt.kusto.models.DataConnectionValidation :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -207,11 +220,12 @@ async def begin_data_connection_validation( :return: An instance of AsyncLROPoller that returns either DataConnectionValidationListResult or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~kusto_management_client.models.DataConnectionValidationListResult] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kusto.models.DataConnectionValidationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.DataConnectionValidationListResult"] lro_delay = kwargs.pop( 'polling_interval', @@ -224,6 +238,7 @@ async def begin_data_connection_validation( cluster_name=cluster_name, database_name=database_name, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -248,10 +263,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_data_connection_validation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnectionValidation'} # type: ignore + begin_data_connection_validation.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnectionValidation"} # type: ignore @distributed_trace_async async def check_name_availability( @@ -271,10 +285,10 @@ async def check_name_availability( :param database_name: The name of the database in the Kusto cluster. :type database_name: str :param data_connection_name: The name of the data connection. - :type data_connection_name: ~kusto_management_client.models.DataConnectionCheckNameRequest + :type data_connection_name: ~azure.mgmt.kusto.models.DataConnectionCheckNameRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: CheckNameResult, or the result of cls(response) - :rtype: ~kusto_management_client.models.CheckNameResult + :rtype: ~azure.mgmt.kusto.models.CheckNameResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameResult"] @@ -283,6 +297,7 @@ async def check_name_availability( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(data_connection_name, 'DataConnectionCheckNameRequest') @@ -292,6 +307,7 @@ async def check_name_availability( cluster_name=cluster_name, database_name=database_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self.check_name_availability.metadata['url'], @@ -299,7 +315,11 @@ async def check_name_availability( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -313,7 +333,7 @@ async def check_name_availability( return deserialized - check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/checkNameAvailability'} # type: ignore + check_name_availability.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/checkNameAvailability"} # type: ignore @distributed_trace_async @@ -337,7 +357,7 @@ async def get( :type data_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DataConnection, or the result of cls(response) - :rtype: ~kusto_management_client.models.DataConnection + :rtype: ~azure.mgmt.kusto.models.DataConnection :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DataConnection"] @@ -346,6 +366,8 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, @@ -353,12 +375,17 @@ async def get( database_name=database_name, data_connection_name=data_connection_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -372,7 +399,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}"} # type: ignore async def _create_or_update_initial( @@ -390,6 +417,7 @@ async def _create_or_update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'DataConnection') @@ -400,6 +428,7 @@ async def _create_or_update_initial( database_name=database_name, data_connection_name=data_connection_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self._create_or_update_initial.metadata['url'], @@ -407,7 +436,11 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201, 202]: @@ -428,7 +461,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}"} # type: ignore @distributed_trace_async @@ -452,7 +485,7 @@ async def begin_create_or_update( :param data_connection_name: The name of the data connection. :type data_connection_name: str :param parameters: The data connection parameters supplied to the CreateOrUpdate operation. - :type parameters: ~kusto_management_client.models.DataConnection + :type parameters: ~azure.mgmt.kusto.models.DataConnection :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -463,11 +496,12 @@ async def begin_create_or_update( Retry-After header is present. :return: An instance of AsyncLROPoller that returns either DataConnection or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~kusto_management_client.models.DataConnection] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kusto.models.DataConnection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.DataConnection"] lro_delay = kwargs.pop( 'polling_interval', @@ -481,6 +515,7 @@ async def begin_create_or_update( database_name=database_name, data_connection_name=data_connection_name, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -505,10 +540,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}"} # type: ignore async def _update_initial( self, @@ -525,6 +559,7 @@ async def _update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'DataConnection') @@ -535,6 +570,7 @@ async def _update_initial( database_name=database_name, data_connection_name=data_connection_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self._update_initial.metadata['url'], @@ -542,7 +578,11 @@ async def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201, 202]: @@ -568,7 +608,7 @@ async def _update_initial( return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} # type: ignore + _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}"} # type: ignore @distributed_trace_async @@ -592,7 +632,7 @@ async def begin_update( :param data_connection_name: The name of the data connection. :type data_connection_name: str :param parameters: The data connection parameters supplied to the Update operation. - :type parameters: ~kusto_management_client.models.DataConnection + :type parameters: ~azure.mgmt.kusto.models.DataConnection :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -603,11 +643,12 @@ async def begin_update( Retry-After header is present. :return: An instance of AsyncLROPoller that returns either DataConnection or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~kusto_management_client.models.DataConnection] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kusto.models.DataConnection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.DataConnection"] lro_delay = kwargs.pop( 'polling_interval', @@ -621,6 +662,7 @@ async def begin_update( database_name=database_name, data_connection_name=data_connection_name, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -645,12 +687,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} # type: ignore + begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}"} # type: ignore - async def _delete_initial( + async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -664,6 +705,8 @@ async def _delete_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + request = build_delete_request_initial( resource_group_name=resource_group_name, @@ -671,12 +714,17 @@ async def _delete_initial( database_name=database_name, data_connection_name=data_connection_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self._delete_initial.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -686,11 +734,11 @@ async def _delete_initial( if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}"} # type: ignore @distributed_trace_async - async def begin_delete( + async def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -720,7 +768,8 @@ async def begin_delete( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -733,6 +782,7 @@ async def begin_delete( cluster_name=cluster_name, database_name=database_name, data_connection_name=data_connection_name, + api_version=api_version, cls=lambda x,y,z: x, **kwargs ) @@ -753,7 +803,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}"} # type: ignore diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_database_principal_assignments_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_database_principal_assignments_operations.py index 094d8831fdcc..9ca054a74662 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_database_principal_assignments_operations.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_database_principal_assignments_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -33,7 +32,7 @@ class DatabasePrincipalAssignmentsOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~kusto_management_client.models + :type models: ~azure.mgmt.kusto.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -67,10 +66,10 @@ async def check_name_availability( :type database_name: str :param principal_assignment_name: The name of the resource. :type principal_assignment_name: - ~kusto_management_client.models.DatabasePrincipalAssignmentCheckNameRequest + ~azure.mgmt.kusto.models.DatabasePrincipalAssignmentCheckNameRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: CheckNameResult, or the result of cls(response) - :rtype: ~kusto_management_client.models.CheckNameResult + :rtype: ~azure.mgmt.kusto.models.CheckNameResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameResult"] @@ -79,6 +78,7 @@ async def check_name_availability( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(principal_assignment_name, 'DatabasePrincipalAssignmentCheckNameRequest') @@ -88,6 +88,7 @@ async def check_name_availability( cluster_name=cluster_name, database_name=database_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self.check_name_availability.metadata['url'], @@ -95,7 +96,11 @@ async def check_name_availability( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -109,7 +114,7 @@ async def check_name_availability( return deserialized - check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/checkPrincipalAssignmentNameAvailability'} # type: ignore + check_name_availability.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/checkPrincipalAssignmentNameAvailability"} # type: ignore @distributed_trace_async @@ -133,7 +138,7 @@ async def get( :type principal_assignment_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DatabasePrincipalAssignment, or the result of cls(response) - :rtype: ~kusto_management_client.models.DatabasePrincipalAssignment + :rtype: ~azure.mgmt.kusto.models.DatabasePrincipalAssignment :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DatabasePrincipalAssignment"] @@ -142,6 +147,8 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + request = build_get_request( subscription_id=self._config.subscription_id, @@ -149,12 +156,17 @@ async def get( cluster_name=cluster_name, database_name=database_name, principal_assignment_name=principal_assignment_name, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -168,7 +180,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}"} # type: ignore async def _create_or_update_initial( @@ -186,6 +198,7 @@ async def _create_or_update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'DatabasePrincipalAssignment') @@ -196,6 +209,7 @@ async def _create_or_update_initial( cluster_name=cluster_name, database_name=database_name, principal_assignment_name=principal_assignment_name, + api_version=api_version, content_type=content_type, json=_json, template_url=self._create_or_update_initial.metadata['url'], @@ -203,7 +217,11 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -221,7 +239,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}"} # type: ignore @distributed_trace_async @@ -245,7 +263,7 @@ async def begin_create_or_update( :param principal_assignment_name: The name of the Kusto principalAssignment. :type principal_assignment_name: str :param parameters: The Kusto principalAssignments parameters supplied for the operation. - :type parameters: ~kusto_management_client.models.DatabasePrincipalAssignment + :type parameters: ~azure.mgmt.kusto.models.DatabasePrincipalAssignment :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -257,11 +275,12 @@ async def begin_create_or_update( :return: An instance of AsyncLROPoller that returns either DatabasePrincipalAssignment or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~kusto_management_client.models.DatabasePrincipalAssignment] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kusto.models.DatabasePrincipalAssignment] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.DatabasePrincipalAssignment"] lro_delay = kwargs.pop( 'polling_interval', @@ -275,6 +294,7 @@ async def begin_create_or_update( database_name=database_name, principal_assignment_name=principal_assignment_name, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -299,12 +319,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}"} # type: ignore - async def _delete_initial( + async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -318,6 +337,8 @@ async def _delete_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -325,12 +346,17 @@ async def _delete_initial( cluster_name=cluster_name, database_name=database_name, principal_assignment_name=principal_assignment_name, + api_version=api_version, template_url=self._delete_initial.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -340,11 +366,11 @@ async def _delete_initial( if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}"} # type: ignore @distributed_trace_async - async def begin_delete( + async def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -374,7 +400,8 @@ async def begin_delete( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -387,6 +414,7 @@ async def begin_delete( cluster_name=cluster_name, database_name=database_name, principal_assignment_name=principal_assignment_name, + api_version=api_version, cls=lambda x,y,z: x, **kwargs ) @@ -407,10 +435,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}"} # type: ignore @distributed_trace def list( @@ -432,9 +459,11 @@ def list( :return: An iterator like instance of either DatabasePrincipalAssignmentListResult or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~kusto_management_client.models.DatabasePrincipalAssignmentListResult] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kusto.models.DatabasePrincipalAssignmentListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.DatabasePrincipalAssignmentListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -448,6 +477,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, cluster_name=cluster_name, database_name=database_name, + api_version=api_version, template_url=self.list.metadata['url'], ) request = _convert_request(request) @@ -460,6 +490,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, cluster_name=cluster_name, database_name=database_name, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -477,7 +508,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -490,4 +525,4 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments"} # type: ignore diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_databases_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_databases_operations.py index 3843207a8421..8a586ee285bc 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_databases_operations.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_databases_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -33,7 +32,7 @@ class DatabasesOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~kusto_management_client.models + :type models: ~azure.mgmt.kusto.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -63,10 +62,10 @@ async def check_name_availability( :param cluster_name: The name of the Kusto cluster. :type cluster_name: str :param resource_name: The name of the resource. - :type resource_name: ~kusto_management_client.models.CheckNameRequest + :type resource_name: ~azure.mgmt.kusto.models.CheckNameRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: CheckNameResult, or the result of cls(response) - :rtype: ~kusto_management_client.models.CheckNameResult + :rtype: ~azure.mgmt.kusto.models.CheckNameResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameResult"] @@ -75,6 +74,7 @@ async def check_name_availability( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(resource_name, 'CheckNameRequest') @@ -83,6 +83,7 @@ async def check_name_availability( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self.check_name_availability.metadata['url'], @@ -90,7 +91,11 @@ async def check_name_availability( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -104,7 +109,7 @@ async def check_name_availability( return deserialized - check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/checkNameAvailability'} # type: ignore + check_name_availability.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/checkNameAvailability"} # type: ignore @distributed_trace @@ -122,10 +127,11 @@ def list_by_cluster( :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DatabaseListResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~kusto_management_client.models.DatabaseListResult] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kusto.models.DatabaseListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.DatabaseListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -138,6 +144,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_by_cluster.metadata['url'], ) request = _convert_request(request) @@ -149,6 +156,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -166,7 +174,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -179,7 +191,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_cluster.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases'} # type: ignore + list_by_cluster.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases"} # type: ignore @distributed_trace_async async def get( @@ -199,7 +211,7 @@ async def get( :type database_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Database, or the result of cls(response) - :rtype: ~kusto_management_client.models.Database + :rtype: ~azure.mgmt.kusto.models.Database :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Database"] @@ -208,18 +220,25 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, cluster_name=cluster_name, database_name=database_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -233,7 +252,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}"} # type: ignore async def _create_or_update_initial( @@ -250,6 +269,7 @@ async def _create_or_update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'Database') @@ -259,6 +279,7 @@ async def _create_or_update_initial( cluster_name=cluster_name, database_name=database_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self._create_or_update_initial.metadata['url'], @@ -266,7 +287,11 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201, 202]: @@ -287,7 +312,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}"} # type: ignore @distributed_trace_async @@ -308,7 +333,7 @@ async def begin_create_or_update( :param database_name: The name of the database in the Kusto cluster. :type database_name: str :param parameters: The database parameters supplied to the CreateOrUpdate operation. - :type parameters: ~kusto_management_client.models.Database + :type parameters: ~azure.mgmt.kusto.models.Database :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -319,11 +344,12 @@ async def begin_create_or_update( Retry-After header is present. :return: An instance of AsyncLROPoller that returns either Database or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~kusto_management_client.models.Database] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kusto.models.Database] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Database"] lro_delay = kwargs.pop( 'polling_interval', @@ -336,6 +362,7 @@ async def begin_create_or_update( cluster_name=cluster_name, database_name=database_name, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -360,10 +387,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}"} # type: ignore async def _update_initial( self, @@ -379,6 +405,7 @@ async def _update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'Database') @@ -388,6 +415,7 @@ async def _update_initial( cluster_name=cluster_name, database_name=database_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self._update_initial.metadata['url'], @@ -395,7 +423,11 @@ async def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201, 202]: @@ -421,7 +453,7 @@ async def _update_initial( return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} # type: ignore + _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}"} # type: ignore @distributed_trace_async @@ -442,7 +474,7 @@ async def begin_update( :param database_name: The name of the database in the Kusto cluster. :type database_name: str :param parameters: The database parameters supplied to the Update operation. - :type parameters: ~kusto_management_client.models.Database + :type parameters: ~azure.mgmt.kusto.models.Database :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -453,11 +485,12 @@ async def begin_update( Retry-After header is present. :return: An instance of AsyncLROPoller that returns either Database or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~kusto_management_client.models.Database] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kusto.models.Database] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Database"] lro_delay = kwargs.pop( 'polling_interval', @@ -470,6 +503,7 @@ async def begin_update( cluster_name=cluster_name, database_name=database_name, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -494,12 +528,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} # type: ignore + begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}"} # type: ignore - async def _delete_initial( + async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -512,18 +545,25 @@ async def _delete_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + request = build_delete_request_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, database_name=database_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self._delete_initial.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -533,11 +573,11 @@ async def _delete_initial( if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}"} # type: ignore @distributed_trace_async - async def begin_delete( + async def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -564,7 +604,8 @@ async def begin_delete( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -576,6 +617,7 @@ async def begin_delete( resource_group_name=resource_group_name, cluster_name=cluster_name, database_name=database_name, + api_version=api_version, cls=lambda x,y,z: x, **kwargs ) @@ -596,10 +638,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}"} # type: ignore @distributed_trace def list_principals( @@ -621,9 +662,11 @@ def list_principals( :return: An iterator like instance of either DatabasePrincipalListResult or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~kusto_management_client.models.DatabasePrincipalListResult] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kusto.models.DatabasePrincipalListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.DatabasePrincipalListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -637,6 +680,7 @@ def prepare_request(next_link=None): cluster_name=cluster_name, database_name=database_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_principals.metadata['url'], ) request = _convert_request(request) @@ -649,6 +693,7 @@ def prepare_request(next_link=None): cluster_name=cluster_name, database_name=database_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -666,7 +711,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -679,7 +728,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_principals.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/listPrincipals'} # type: ignore + list_principals.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/listPrincipals"} # type: ignore @distributed_trace_async async def add_principals( @@ -699,10 +748,10 @@ async def add_principals( :param database_name: The name of the database in the Kusto cluster. :type database_name: str :param database_principals_to_add: List of database principals to add. - :type database_principals_to_add: ~kusto_management_client.models.DatabasePrincipalListRequest + :type database_principals_to_add: ~azure.mgmt.kusto.models.DatabasePrincipalListRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: DatabasePrincipalListResult, or the result of cls(response) - :rtype: ~kusto_management_client.models.DatabasePrincipalListResult + :rtype: ~azure.mgmt.kusto.models.DatabasePrincipalListResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DatabasePrincipalListResult"] @@ -711,6 +760,7 @@ async def add_principals( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(database_principals_to_add, 'DatabasePrincipalListRequest') @@ -720,6 +770,7 @@ async def add_principals( cluster_name=cluster_name, database_name=database_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self.add_principals.metadata['url'], @@ -727,7 +778,11 @@ async def add_principals( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -741,7 +796,7 @@ async def add_principals( return deserialized - add_principals.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/addPrincipals'} # type: ignore + add_principals.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/addPrincipals"} # type: ignore @distributed_trace_async @@ -762,11 +817,10 @@ async def remove_principals( :param database_name: The name of the database in the Kusto cluster. :type database_name: str :param database_principals_to_remove: List of database principals to remove. - :type database_principals_to_remove: - ~kusto_management_client.models.DatabasePrincipalListRequest + :type database_principals_to_remove: ~azure.mgmt.kusto.models.DatabasePrincipalListRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: DatabasePrincipalListResult, or the result of cls(response) - :rtype: ~kusto_management_client.models.DatabasePrincipalListResult + :rtype: ~azure.mgmt.kusto.models.DatabasePrincipalListResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DatabasePrincipalListResult"] @@ -775,6 +829,7 @@ async def remove_principals( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(database_principals_to_remove, 'DatabasePrincipalListRequest') @@ -784,6 +839,7 @@ async def remove_principals( cluster_name=cluster_name, database_name=database_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self.remove_principals.metadata['url'], @@ -791,7 +847,11 @@ async def remove_principals( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -805,5 +865,5 @@ async def remove_principals( return deserialized - remove_principals.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/removePrincipals'} # type: ignore + remove_principals.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/removePrincipals"} # type: ignore diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_managed_private_endpoints_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_managed_private_endpoints_operations.py index f561fc0f1bd7..21db0ccd691a 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_managed_private_endpoints_operations.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_managed_private_endpoints_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -33,7 +32,7 @@ class ManagedPrivateEndpointsOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~kusto_management_client.models + :type models: ~azure.mgmt.kusto.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -63,10 +62,10 @@ async def check_name_availability( :param cluster_name: The name of the Kusto cluster. :type cluster_name: str :param resource_name: The name of the resource. - :type resource_name: ~kusto_management_client.models.ManagedPrivateEndpointsCheckNameRequest + :type resource_name: ~azure.mgmt.kusto.models.ManagedPrivateEndpointsCheckNameRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: CheckNameResult, or the result of cls(response) - :rtype: ~kusto_management_client.models.CheckNameResult + :rtype: ~azure.mgmt.kusto.models.CheckNameResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameResult"] @@ -75,6 +74,7 @@ async def check_name_availability( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(resource_name, 'ManagedPrivateEndpointsCheckNameRequest') @@ -83,6 +83,7 @@ async def check_name_availability( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self.check_name_availability.metadata['url'], @@ -90,7 +91,11 @@ async def check_name_availability( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -104,7 +109,7 @@ async def check_name_availability( return deserialized - check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpointsCheckNameAvailability'} # type: ignore + check_name_availability.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpointsCheckNameAvailability"} # type: ignore @distributed_trace @@ -124,9 +129,11 @@ def list( :return: An iterator like instance of either ManagedPrivateEndpointListResult or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~kusto_management_client.models.ManagedPrivateEndpointListResult] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kusto.models.ManagedPrivateEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedPrivateEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -139,6 +146,7 @@ def prepare_request(next_link=None): subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, cluster_name=cluster_name, + api_version=api_version, template_url=self.list.metadata['url'], ) request = _convert_request(request) @@ -150,6 +158,7 @@ def prepare_request(next_link=None): subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, cluster_name=cluster_name, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -167,7 +176,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -180,7 +193,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpoints'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpoints"} # type: ignore @distributed_trace_async async def get( @@ -200,7 +213,7 @@ async def get( :type managed_private_endpoint_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ManagedPrivateEndpoint, or the result of cls(response) - :rtype: ~kusto_management_client.models.ManagedPrivateEndpoint + :rtype: ~azure.mgmt.kusto.models.ManagedPrivateEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedPrivateEndpoint"] @@ -209,18 +222,25 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, cluster_name=cluster_name, managed_private_endpoint_name=managed_private_endpoint_name, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -234,7 +254,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpoints/{managedPrivateEndpointName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpoints/{managedPrivateEndpointName}"} # type: ignore async def _create_or_update_initial( @@ -251,6 +271,7 @@ async def _create_or_update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'ManagedPrivateEndpoint') @@ -260,6 +281,7 @@ async def _create_or_update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, managed_private_endpoint_name=managed_private_endpoint_name, + api_version=api_version, content_type=content_type, json=_json, template_url=self._create_or_update_initial.metadata['url'], @@ -267,7 +289,11 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201, 202]: @@ -288,7 +314,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpoints/{managedPrivateEndpointName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpoints/{managedPrivateEndpointName}"} # type: ignore @distributed_trace_async @@ -309,7 +335,7 @@ async def begin_create_or_update( :param managed_private_endpoint_name: The name of the managed private endpoint. :type managed_private_endpoint_name: str :param parameters: The managed private endpoint parameters. - :type parameters: ~kusto_management_client.models.ManagedPrivateEndpoint + :type parameters: ~azure.mgmt.kusto.models.ManagedPrivateEndpoint :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -320,12 +346,12 @@ async def begin_create_or_update( Retry-After header is present. :return: An instance of AsyncLROPoller that returns either ManagedPrivateEndpoint or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~kusto_management_client.models.ManagedPrivateEndpoint] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kusto.models.ManagedPrivateEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedPrivateEndpoint"] lro_delay = kwargs.pop( 'polling_interval', @@ -338,6 +364,7 @@ async def begin_create_or_update( cluster_name=cluster_name, managed_private_endpoint_name=managed_private_endpoint_name, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -362,10 +389,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpoints/{managedPrivateEndpointName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpoints/{managedPrivateEndpointName}"} # type: ignore async def _update_initial( self, @@ -381,6 +407,7 @@ async def _update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'ManagedPrivateEndpoint') @@ -390,6 +417,7 @@ async def _update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, managed_private_endpoint_name=managed_private_endpoint_name, + api_version=api_version, content_type=content_type, json=_json, template_url=self._update_initial.metadata['url'], @@ -397,7 +425,11 @@ async def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -418,7 +450,7 @@ async def _update_initial( return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpoints/{managedPrivateEndpointName}'} # type: ignore + _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpoints/{managedPrivateEndpointName}"} # type: ignore @distributed_trace_async @@ -439,7 +471,7 @@ async def begin_update( :param managed_private_endpoint_name: The name of the managed private endpoint. :type managed_private_endpoint_name: str :param parameters: The managed private endpoint parameters. - :type parameters: ~kusto_management_client.models.ManagedPrivateEndpoint + :type parameters: ~azure.mgmt.kusto.models.ManagedPrivateEndpoint :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -450,12 +482,12 @@ async def begin_update( Retry-After header is present. :return: An instance of AsyncLROPoller that returns either ManagedPrivateEndpoint or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~kusto_management_client.models.ManagedPrivateEndpoint] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kusto.models.ManagedPrivateEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedPrivateEndpoint"] lro_delay = kwargs.pop( 'polling_interval', @@ -468,6 +500,7 @@ async def begin_update( cluster_name=cluster_name, managed_private_endpoint_name=managed_private_endpoint_name, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -492,12 +525,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpoints/{managedPrivateEndpointName}'} # type: ignore + begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpoints/{managedPrivateEndpointName}"} # type: ignore - async def _delete_initial( + async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -510,18 +542,25 @@ async def _delete_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, cluster_name=cluster_name, managed_private_endpoint_name=managed_private_endpoint_name, + api_version=api_version, template_url=self._delete_initial.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -531,11 +570,11 @@ async def _delete_initial( if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpoints/{managedPrivateEndpointName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpoints/{managedPrivateEndpointName}"} # type: ignore @distributed_trace_async - async def begin_delete( + async def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -562,7 +601,8 @@ async def begin_delete( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -574,6 +614,7 @@ async def begin_delete( resource_group_name=resource_group_name, cluster_name=cluster_name, managed_private_endpoint_name=managed_private_endpoint_name, + api_version=api_version, cls=lambda x,y,z: x, **kwargs ) @@ -594,7 +635,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpoints/{managedPrivateEndpointName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpoints/{managedPrivateEndpointName}"} # type: ignore diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_operations.py index 86419f8297e4..6d5e46ee96dc 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_operations.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -15,7 +14,6 @@ from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models @@ -31,7 +29,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: ~kusto_management_client.models + :type models: ~azure.mgmt.kusto.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -55,10 +53,11 @@ 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.async_paging.AsyncItemPaged[~kusto_management_client.models.OperationListResult] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kusto.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -68,6 +67,7 @@ def prepare_request(next_link=None): if not next_link: request = build_list_request( + api_version=api_version, template_url=self.list.metadata['url'], ) request = _convert_request(request) @@ -76,6 +76,7 @@ def prepare_request(next_link=None): else: request = build_list_request( + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -93,7 +94,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -106,4 +111,4 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/providers/Microsoft.Kusto/operations'} # type: ignore + list.metadata = {'url': "/providers/Microsoft.Kusto/operations"} # type: ignore diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_operations_results_location_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_operations_results_location_operations.py index bff9af7d72b2..958f12e556b9 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_operations_results_location_operations.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_operations_results_location_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -29,7 +28,7 @@ class OperationsResultsLocationOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~kusto_management_client.models + :type models: ~azure.mgmt.kusto.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -45,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._config = config @distributed_trace_async - async def get( + async def get( # pylint: disable=inconsistent-return-statements self, location: str, operation_id: str, @@ -68,17 +67,24 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + request = build_get_request( subscription_id=self._config.subscription_id, location=location, operation_id=operation_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -88,5 +94,5 @@ async def get( if cls: return cls(pipeline_response, None, {}) - get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/locations/{location}/operationResults/{operationId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/locations/{location}/operationResults/{operationId}"} # type: ignore diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_operations_results_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_operations_results_operations.py index e8b54d3fb168..d3b1012dc7a1 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_operations_results_operations.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_operations_results_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -29,7 +28,7 @@ class OperationsResultsOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~kusto_management_client.models + :type models: ~azure.mgmt.kusto.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -59,7 +58,7 @@ async def get( :type operation_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: OperationResult, or the result of cls(response) - :rtype: ~kusto_management_client.models.OperationResult + :rtype: ~azure.mgmt.kusto.models.OperationResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationResult"] @@ -68,17 +67,24 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + request = build_get_request( subscription_id=self._config.subscription_id, location=location, operation_id=operation_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -92,5 +98,5 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/locations/{location}/operationResults/{operationId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/locations/{location}/operationResults/{operationId}"} # type: ignore diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_private_endpoint_connections_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_private_endpoint_connections_operations.py index 6ca8901bdc6a..abd5b8aaba0b 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_private_endpoint_connections_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -33,7 +32,7 @@ class PrivateEndpointConnectionsOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~kusto_management_client.models + :type models: ~azure.mgmt.kusto.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -65,9 +64,11 @@ def list( :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~kusto_management_client.models.PrivateEndpointConnectionListResult] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kusto.models.PrivateEndpointConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -80,6 +81,7 @@ def prepare_request(next_link=None): subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, cluster_name=cluster_name, + api_version=api_version, template_url=self.list.metadata['url'], ) request = _convert_request(request) @@ -91,6 +93,7 @@ def prepare_request(next_link=None): subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, cluster_name=cluster_name, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -108,7 +111,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -121,7 +128,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/privateEndpointConnections'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/privateEndpointConnections"} # type: ignore @distributed_trace_async async def get( @@ -141,7 +148,7 @@ async def get( :type private_endpoint_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PrivateEndpointConnection, or the result of cls(response) - :rtype: ~kusto_management_client.models.PrivateEndpointConnection + :rtype: ~azure.mgmt.kusto.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] @@ -150,18 +157,25 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, cluster_name=cluster_name, private_endpoint_connection_name=private_endpoint_connection_name, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -175,7 +189,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore async def _create_or_update_initial( @@ -192,6 +206,7 @@ async def _create_or_update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'PrivateEndpointConnection') @@ -201,6 +216,7 @@ async def _create_or_update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, private_endpoint_connection_name=private_endpoint_connection_name, + api_version=api_version, content_type=content_type, json=_json, template_url=self._create_or_update_initial.metadata['url'], @@ -208,7 +224,11 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -226,7 +246,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace_async @@ -247,7 +267,7 @@ async def begin_create_or_update( :param private_endpoint_connection_name: The name of the private endpoint connection. :type private_endpoint_connection_name: str :param parameters: - :type parameters: ~kusto_management_client.models.PrivateEndpointConnection + :type parameters: ~azure.mgmt.kusto.models.PrivateEndpointConnection :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -258,12 +278,12 @@ async def begin_create_or_update( Retry-After header is present. :return: An instance of AsyncLROPoller that returns either PrivateEndpointConnection or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~kusto_management_client.models.PrivateEndpointConnection] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kusto.models.PrivateEndpointConnection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] lro_delay = kwargs.pop( 'polling_interval', @@ -276,6 +296,7 @@ async def begin_create_or_update( cluster_name=cluster_name, private_endpoint_connection_name=private_endpoint_connection_name, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -300,12 +321,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - async def _delete_initial( + async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -318,18 +338,25 @@ async def _delete_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, cluster_name=cluster_name, private_endpoint_connection_name=private_endpoint_connection_name, + api_version=api_version, template_url=self._delete_initial.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -339,11 +366,11 @@ async def _delete_initial( if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace_async - async def begin_delete( + async def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -370,7 +397,8 @@ async def begin_delete( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -382,6 +410,7 @@ async def begin_delete( resource_group_name=resource_group_name, cluster_name=cluster_name, private_endpoint_connection_name=private_endpoint_connection_name, + api_version=api_version, cls=lambda x,y,z: x, **kwargs ) @@ -402,7 +431,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_private_link_resources_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_private_link_resources_operations.py index 297124acdbde..70319159e606 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_private_link_resources_operations.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_private_link_resources_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -31,7 +30,7 @@ class PrivateLinkResourcesOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~kusto_management_client.models + :type models: ~azure.mgmt.kusto.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -63,9 +62,11 @@ def list( :return: An iterator like instance of either PrivateLinkResourceListResult or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~kusto_management_client.models.PrivateLinkResourceListResult] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kusto.models.PrivateLinkResourceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -78,6 +79,7 @@ def prepare_request(next_link=None): subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, cluster_name=cluster_name, + api_version=api_version, template_url=self.list.metadata['url'], ) request = _convert_request(request) @@ -89,6 +91,7 @@ def prepare_request(next_link=None): subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, cluster_name=cluster_name, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -106,7 +109,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -119,7 +126,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/privateLinkResources'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/privateLinkResources"} # type: ignore @distributed_trace_async async def get( @@ -139,7 +146,7 @@ async def get( :type private_link_resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PrivateLinkResource, or the result of cls(response) - :rtype: ~kusto_management_client.models.PrivateLinkResource + :rtype: ~azure.mgmt.kusto.models.PrivateLinkResource :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResource"] @@ -148,18 +155,25 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, cluster_name=cluster_name, private_link_resource_name=private_link_resource_name, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -173,5 +187,5 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/privateLinkResources/{privateLinkResourceName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/privateLinkResources/{privateLinkResourceName}"} # type: ignore diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_scripts_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_scripts_operations.py index 799466e1662a..5fe52fb5a953 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_scripts_operations.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_scripts_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -33,7 +32,7 @@ class ScriptsOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~kusto_management_client.models + :type models: ~azure.mgmt.kusto.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -66,10 +65,11 @@ def list_by_database( :type database_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ScriptListResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~kusto_management_client.models.ScriptListResult] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kusto.models.ScriptListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ScriptListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -83,6 +83,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, cluster_name=cluster_name, database_name=database_name, + api_version=api_version, template_url=self.list_by_database.metadata['url'], ) request = _convert_request(request) @@ -95,6 +96,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, cluster_name=cluster_name, database_name=database_name, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -112,7 +114,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -125,7 +131,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts'} # type: ignore + list_by_database.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts"} # type: ignore @distributed_trace_async async def get( @@ -148,7 +154,7 @@ async def get( :type script_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Script, or the result of cls(response) - :rtype: ~kusto_management_client.models.Script + :rtype: ~azure.mgmt.kusto.models.Script :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Script"] @@ -157,6 +163,8 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + request = build_get_request( subscription_id=self._config.subscription_id, @@ -164,12 +172,17 @@ async def get( cluster_name=cluster_name, database_name=database_name, script_name=script_name, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -183,7 +196,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}"} # type: ignore async def _create_or_update_initial( @@ -201,6 +214,7 @@ async def _create_or_update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'Script') @@ -211,6 +225,7 @@ async def _create_or_update_initial( cluster_name=cluster_name, database_name=database_name, script_name=script_name, + api_version=api_version, content_type=content_type, json=_json, template_url=self._create_or_update_initial.metadata['url'], @@ -218,7 +233,11 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201, 202]: @@ -239,7 +258,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}"} # type: ignore @distributed_trace_async @@ -263,7 +282,7 @@ async def begin_create_or_update( :param script_name: The name of the Kusto database script. :type script_name: str :param parameters: The Kusto Script parameters contains the KQL to run. - :type parameters: ~kusto_management_client.models.Script + :type parameters: ~azure.mgmt.kusto.models.Script :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -274,11 +293,12 @@ async def begin_create_or_update( Retry-After header is present. :return: An instance of AsyncLROPoller that returns either Script or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~kusto_management_client.models.Script] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kusto.models.Script] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Script"] lro_delay = kwargs.pop( 'polling_interval', @@ -292,6 +312,7 @@ async def begin_create_or_update( database_name=database_name, script_name=script_name, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -316,10 +337,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}"} # type: ignore async def _update_initial( self, @@ -336,6 +356,7 @@ async def _update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'Script') @@ -346,6 +367,7 @@ async def _update_initial( cluster_name=cluster_name, database_name=database_name, script_name=script_name, + api_version=api_version, content_type=content_type, json=_json, template_url=self._update_initial.metadata['url'], @@ -353,7 +375,11 @@ async def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -374,7 +400,7 @@ async def _update_initial( return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}'} # type: ignore + _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}"} # type: ignore @distributed_trace_async @@ -398,7 +424,7 @@ async def begin_update( :param script_name: The name of the Kusto database script. :type script_name: str :param parameters: The Kusto Script parameters contains to the KQL to run. - :type parameters: ~kusto_management_client.models.Script + :type parameters: ~azure.mgmt.kusto.models.Script :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -409,11 +435,12 @@ async def begin_update( Retry-After header is present. :return: An instance of AsyncLROPoller that returns either Script or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~kusto_management_client.models.Script] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kusto.models.Script] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Script"] lro_delay = kwargs.pop( 'polling_interval', @@ -427,6 +454,7 @@ async def begin_update( database_name=database_name, script_name=script_name, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -451,12 +479,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}'} # type: ignore + begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}"} # type: ignore - async def _delete_initial( + async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -470,6 +497,8 @@ async def _delete_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -477,12 +506,17 @@ async def _delete_initial( cluster_name=cluster_name, database_name=database_name, script_name=script_name, + api_version=api_version, template_url=self._delete_initial.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -492,11 +526,11 @@ async def _delete_initial( if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}"} # type: ignore @distributed_trace_async - async def begin_delete( + async def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -526,7 +560,8 @@ async def begin_delete( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -539,6 +574,7 @@ async def begin_delete( cluster_name=cluster_name, database_name=database_name, script_name=script_name, + api_version=api_version, cls=lambda x,y,z: x, **kwargs ) @@ -559,10 +595,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}"} # type: ignore @distributed_trace_async async def check_name_availability( @@ -582,10 +617,10 @@ async def check_name_availability( :param database_name: The name of the database in the Kusto cluster. :type database_name: str :param script_name: The name of the script. - :type script_name: ~kusto_management_client.models.ScriptCheckNameRequest + :type script_name: ~azure.mgmt.kusto.models.ScriptCheckNameRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: CheckNameResult, or the result of cls(response) - :rtype: ~kusto_management_client.models.CheckNameResult + :rtype: ~azure.mgmt.kusto.models.CheckNameResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameResult"] @@ -594,6 +629,7 @@ async def check_name_availability( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(script_name, 'ScriptCheckNameRequest') @@ -603,6 +639,7 @@ async def check_name_availability( cluster_name=cluster_name, database_name=database_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self.check_name_availability.metadata['url'], @@ -610,7 +647,11 @@ async def check_name_availability( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -624,5 +665,5 @@ async def check_name_availability( return deserialized - check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scriptsCheckNameAvailability'} # type: ignore + check_name_availability.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scriptsCheckNameAvailability"} # type: ignore diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/models/_models_py3.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/models/_models_py3.py index fdaf0a6510db..5a478d39b9b9 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/models/_models_py3.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/models/_models_py3.py @@ -131,7 +131,7 @@ class AttachedDatabaseConfiguration(ProxyResource): :vartype location: str :ivar provisioning_state: The provisioned state of the resource. Possible values include: "Running", "Creating", "Deleting", "Succeeded", "Failed", "Moving". - :vartype provisioning_state: str or ~kusto_management_client.models.ProvisioningState + :vartype provisioning_state: str or ~azure.mgmt.kusto.models.ProvisioningState :ivar database_name: The name of the database which you would like to attach, use * if you want to follow all current and future databases. :vartype database_name: str @@ -144,10 +144,9 @@ class AttachedDatabaseConfiguration(ProxyResource): :ivar default_principals_modification_kind: The default principals modification kind. Possible values include: "Union", "Replace", "None". :vartype default_principals_modification_kind: str or - ~kusto_management_client.models.DefaultPrincipalsModificationKind + ~azure.mgmt.kusto.models.DefaultPrincipalsModificationKind :ivar table_level_sharing_properties: Table level sharing specifications. - :vartype table_level_sharing_properties: - ~kusto_management_client.models.TableLevelSharingProperties + :vartype table_level_sharing_properties: ~azure.mgmt.kusto.models.TableLevelSharingProperties """ _validation = { @@ -193,10 +192,9 @@ def __init__( :keyword default_principals_modification_kind: The default principals modification kind. Possible values include: "Union", "Replace", "None". :paramtype default_principals_modification_kind: str or - ~kusto_management_client.models.DefaultPrincipalsModificationKind + ~azure.mgmt.kusto.models.DefaultPrincipalsModificationKind :keyword table_level_sharing_properties: Table level sharing specifications. - :paramtype table_level_sharing_properties: - ~kusto_management_client.models.TableLevelSharingProperties + :paramtype table_level_sharing_properties: ~azure.mgmt.kusto.models.TableLevelSharingProperties """ super(AttachedDatabaseConfiguration, self).__init__(**kwargs) self.location = location @@ -212,7 +210,7 @@ class AttachedDatabaseConfigurationListResult(msrest.serialization.Model): """The list attached database configurations operation response. :ivar value: The list of attached database configurations. - :vartype value: list[~kusto_management_client.models.AttachedDatabaseConfiguration] + :vartype value: list[~azure.mgmt.kusto.models.AttachedDatabaseConfiguration] """ _attribute_map = { @@ -227,7 +225,7 @@ def __init__( ): """ :keyword value: The list of attached database configurations. - :paramtype value: list[~kusto_management_client.models.AttachedDatabaseConfiguration] + :paramtype value: list[~azure.mgmt.kusto.models.AttachedDatabaseConfiguration] """ super(AttachedDatabaseConfigurationListResult, self).__init__(**kwargs) self.value = value @@ -280,7 +278,7 @@ class AzureCapacity(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :ivar scale_type: Required. Scale type. Possible values include: "automatic", "manual", "none". - :vartype scale_type: str or ~kusto_management_client.models.AzureScaleType + :vartype scale_type: str or ~azure.mgmt.kusto.models.AzureScaleType :ivar minimum: Required. Minimum allowed capacity. :vartype minimum: int :ivar maximum: Required. Maximum allowed capacity. @@ -315,7 +313,7 @@ def __init__( """ :keyword scale_type: Required. Scale type. Possible values include: "automatic", "manual", "none". - :paramtype scale_type: str or ~kusto_management_client.models.AzureScaleType + :paramtype scale_type: str or ~azure.mgmt.kusto.models.AzureScaleType :keyword minimum: Required. Minimum allowed capacity. :paramtype minimum: int :keyword maximum: Required. Maximum allowed capacity. @@ -336,9 +334,9 @@ class AzureResourceSku(msrest.serialization.Model): :ivar resource_type: Resource Namespace and Type. :vartype resource_type: str :ivar sku: The SKU details. - :vartype sku: ~kusto_management_client.models.AzureSku + :vartype sku: ~azure.mgmt.kusto.models.AzureSku :ivar capacity: The number of instances of the cluster. - :vartype capacity: ~kusto_management_client.models.AzureCapacity + :vartype capacity: ~azure.mgmt.kusto.models.AzureCapacity """ _attribute_map = { @@ -359,9 +357,9 @@ def __init__( :keyword resource_type: Resource Namespace and Type. :paramtype resource_type: str :keyword sku: The SKU details. - :paramtype sku: ~kusto_management_client.models.AzureSku + :paramtype sku: ~azure.mgmt.kusto.models.AzureSku :keyword capacity: The number of instances of the cluster. - :paramtype capacity: ~kusto_management_client.models.AzureCapacity + :paramtype capacity: ~azure.mgmt.kusto.models.AzureCapacity """ super(AzureResourceSku, self).__init__(**kwargs) self.resource_type = resource_type @@ -387,11 +385,11 @@ class AzureSku(msrest.serialization.Model): "Standard_E16ads_v5", "Standard_E8s_v4+1TB_PS", "Standard_E8s_v4+2TB_PS", "Standard_E16s_v4+3TB_PS", "Standard_E16s_v4+4TB_PS", "Standard_E8s_v5+1TB_PS", "Standard_E8s_v5+2TB_PS", "Standard_E16s_v5+3TB_PS", "Standard_E16s_v5+4TB_PS". - :vartype name: str or ~kusto_management_client.models.AzureSkuName + :vartype name: str or ~azure.mgmt.kusto.models.AzureSkuName :ivar capacity: The number of instances of the cluster. :vartype capacity: int :ivar tier: Required. SKU tier. Possible values include: "Basic", "Standard". - :vartype tier: str or ~kusto_management_client.models.AzureSkuTier + :vartype tier: str or ~azure.mgmt.kusto.models.AzureSkuTier """ _validation = { @@ -427,11 +425,11 @@ def __init__( "Standard_E16ads_v5", "Standard_E8s_v4+1TB_PS", "Standard_E8s_v4+2TB_PS", "Standard_E16s_v4+3TB_PS", "Standard_E16s_v4+4TB_PS", "Standard_E8s_v5+1TB_PS", "Standard_E8s_v5+2TB_PS", "Standard_E16s_v5+3TB_PS", "Standard_E16s_v5+4TB_PS". - :paramtype name: str or ~kusto_management_client.models.AzureSkuName + :paramtype name: str or ~azure.mgmt.kusto.models.AzureSkuName :keyword capacity: The number of instances of the cluster. :paramtype capacity: int :keyword tier: Required. SKU tier. Possible values include: "Basic", "Standard". - :paramtype tier: str or ~kusto_management_client.models.AzureSkuTier + :paramtype tier: str or ~azure.mgmt.kusto.models.AzureSkuTier """ super(AzureSku, self).__init__(**kwargs) self.name = name @@ -449,7 +447,7 @@ class CheckNameRequest(msrest.serialization.Model): :ivar type: Required. The type of resource, for instance Microsoft.Kusto/clusters/databases. Possible values include: "Microsoft.Kusto/clusters/databases", "Microsoft.Kusto/clusters/attachedDatabaseConfigurations". - :vartype type: str or ~kusto_management_client.models.Type + :vartype type: str or ~azure.mgmt.kusto.models.Type """ _validation = { @@ -475,7 +473,7 @@ def __init__( :keyword type: Required. The type of resource, for instance Microsoft.Kusto/clusters/databases. Possible values include: "Microsoft.Kusto/clusters/databases", "Microsoft.Kusto/clusters/attachedDatabaseConfigurations". - :paramtype type: str or ~kusto_management_client.models.Type + :paramtype type: str or ~azure.mgmt.kusto.models.Type """ super(CheckNameRequest, self).__init__(**kwargs) self.name = name @@ -494,7 +492,7 @@ class CheckNameResult(msrest.serialization.Model): :vartype message: str :ivar reason: Message providing the reason why the given name is invalid. Possible values include: "Invalid", "AlreadyExists". - :vartype reason: str or ~kusto_management_client.models.Reason + :vartype reason: str or ~azure.mgmt.kusto.models.Reason """ _attribute_map = { @@ -523,7 +521,7 @@ def __init__( :paramtype message: str :keyword reason: Message providing the reason why the given name is invalid. Possible values include: "Invalid", "AlreadyExists". - :paramtype reason: str or ~kusto_management_client.models.Reason + :paramtype reason: str or ~azure.mgmt.kusto.models.Reason """ super(CheckNameResult, self).__init__(**kwargs) self.name_available = name_available @@ -545,7 +543,7 @@ class CloudErrorBody(msrest.serialization.Model): error. :vartype target: str :ivar details: A list of additional details about the error. - :vartype details: list[~kusto_management_client.models.CloudErrorBody] + :vartype details: list[~azure.mgmt.kusto.models.CloudErrorBody] """ _attribute_map = { @@ -575,7 +573,7 @@ def __init__( error. :paramtype target: str :keyword details: A list of additional details about the error. - :paramtype details: list[~kusto_management_client.models.CloudErrorBody] + :paramtype details: list[~azure.mgmt.kusto.models.CloudErrorBody] """ super(CloudErrorBody, self).__init__(**kwargs) self.code = code @@ -658,21 +656,21 @@ class Cluster(TrackedResource): :ivar location: Required. The geo-location where the resource lives. :vartype location: str :ivar sku: Required. The SKU of the cluster. - :vartype sku: ~kusto_management_client.models.AzureSku + :vartype sku: ~azure.mgmt.kusto.models.AzureSku :ivar system_data: Metadata pertaining to creation and last modification of the resource. - :vartype system_data: ~kusto_management_client.models.SystemData + :vartype system_data: ~azure.mgmt.kusto.models.SystemData :ivar zones: The availability zones of the cluster. :vartype zones: list[str] :ivar identity: The identity of the cluster, if configured. - :vartype identity: ~kusto_management_client.models.Identity + :vartype identity: ~azure.mgmt.kusto.models.Identity :ivar etag: A unique read-only string that changes whenever the resource is updated. :vartype etag: str :ivar state: The state of the resource. Possible values include: "Creating", "Unavailable", "Running", "Deleting", "Deleted", "Stopping", "Stopped", "Starting", "Updating". - :vartype state: str or ~kusto_management_client.models.State + :vartype state: str or ~azure.mgmt.kusto.models.State :ivar provisioning_state: The provisioned state of the resource. Possible values include: "Running", "Creating", "Deleting", "Succeeded", "Failed", "Moving". - :vartype provisioning_state: str or ~kusto_management_client.models.ProvisioningState + :vartype provisioning_state: str or ~azure.mgmt.kusto.models.ProvisioningState :ivar uri: The cluster URI. :vartype uri: str :ivar data_ingestion_uri: The cluster data ingestion URI. @@ -680,9 +678,9 @@ class Cluster(TrackedResource): :ivar state_reason: The reason for the cluster's current state. :vartype state_reason: str :ivar trusted_external_tenants: The cluster's external tenants. - :vartype trusted_external_tenants: list[~kusto_management_client.models.TrustedExternalTenant] + :vartype trusted_external_tenants: list[~azure.mgmt.kusto.models.TrustedExternalTenant] :ivar optimized_autoscale: Optimized auto scale definition. - :vartype optimized_autoscale: ~kusto_management_client.models.OptimizedAutoscale + :vartype optimized_autoscale: ~azure.mgmt.kusto.models.OptimizedAutoscale :ivar enable_disk_encryption: A boolean value that indicates if the cluster's disks are encrypted. :vartype enable_disk_encryption: bool @@ -690,27 +688,26 @@ class Cluster(TrackedResource): enabled. :vartype enable_streaming_ingest: bool :ivar virtual_network_configuration: Virtual network definition. - :vartype virtual_network_configuration: - ~kusto_management_client.models.VirtualNetworkConfiguration + :vartype virtual_network_configuration: ~azure.mgmt.kusto.models.VirtualNetworkConfiguration :ivar key_vault_properties: KeyVault properties for the cluster encryption. - :vartype key_vault_properties: ~kusto_management_client.models.KeyVaultProperties + :vartype key_vault_properties: ~azure.mgmt.kusto.models.KeyVaultProperties :ivar enable_purge: A boolean value that indicates if the purge operations are enabled. :vartype enable_purge: bool :ivar language_extensions: List of the cluster's language extensions. - :vartype language_extensions: ~kusto_management_client.models.LanguageExtensionsList + :vartype language_extensions: ~azure.mgmt.kusto.models.LanguageExtensionsList :ivar enable_double_encryption: A boolean value that indicates if double encryption is enabled. :vartype enable_double_encryption: bool :ivar public_network_access: Public network access to the cluster is enabled by default. When disabled, only private endpoint connection to the cluster is allowed. Possible values include: "Enabled", "Disabled". Default value: "Enabled". - :vartype public_network_access: str or ~kusto_management_client.models.PublicNetworkAccess + :vartype public_network_access: str or ~azure.mgmt.kusto.models.PublicNetworkAccess :ivar allowed_ip_range_list: The list of ips in the format of CIDR allowed to connect to the cluster. :vartype allowed_ip_range_list: list[str] :ivar engine_type: The engine type. Possible values include: "V2", "V3". Default value: "V3". - :vartype engine_type: str or ~kusto_management_client.models.EngineType + :vartype engine_type: str or ~azure.mgmt.kusto.models.EngineType :ivar accepted_audiences: The cluster's accepted audiences. - :vartype accepted_audiences: list[~kusto_management_client.models.AcceptedAudiences] + :vartype accepted_audiences: list[~azure.mgmt.kusto.models.AcceptedAudiences] :ivar enable_auto_stop: A boolean value that indicates if the cluster could be automatically stopped (due to lack of data or no activity for many days). :vartype enable_auto_stop: bool @@ -718,18 +715,17 @@ class Cluster(TrackedResource): Value is optional but if passed in, must be 'Enabled' or 'Disabled'. Possible values include: "Enabled", "Disabled". Default value: "Disabled". :vartype restrict_outbound_network_access: str or - ~kusto_management_client.models.ClusterNetworkAccessFlag + ~azure.mgmt.kusto.models.ClusterNetworkAccessFlag :ivar allowed_fqdn_list: List of allowed FQDNs(Fully Qualified Domain Name) for egress from Cluster. :vartype allowed_fqdn_list: list[str] :ivar public_ip_type: Indicates what public IP type to create - IPv4 (default), or DualStack (both IPv4 and IPv6). Possible values include: "IPv4", "DualStack". Default value: "IPv4". - :vartype public_ip_type: str or ~kusto_management_client.models.PublicIPType + :vartype public_ip_type: str or ~azure.mgmt.kusto.models.PublicIPType :ivar virtual_cluster_graduation_properties: Virtual Cluster graduation properties. :vartype virtual_cluster_graduation_properties: str :ivar private_endpoint_connections: A list of private endpoint connections. - :vartype private_endpoint_connections: - list[~kusto_management_client.models.PrivateEndpointConnection] + :vartype private_endpoint_connections: list[~azure.mgmt.kusto.models.PrivateEndpointConnection] """ _validation = { @@ -819,16 +815,15 @@ def __init__( :keyword location: Required. The geo-location where the resource lives. :paramtype location: str :keyword sku: Required. The SKU of the cluster. - :paramtype sku: ~kusto_management_client.models.AzureSku + :paramtype sku: ~azure.mgmt.kusto.models.AzureSku :keyword zones: The availability zones of the cluster. :paramtype zones: list[str] :keyword identity: The identity of the cluster, if configured. - :paramtype identity: ~kusto_management_client.models.Identity + :paramtype identity: ~azure.mgmt.kusto.models.Identity :keyword trusted_external_tenants: The cluster's external tenants. - :paramtype trusted_external_tenants: - list[~kusto_management_client.models.TrustedExternalTenant] + :paramtype trusted_external_tenants: list[~azure.mgmt.kusto.models.TrustedExternalTenant] :keyword optimized_autoscale: Optimized auto scale definition. - :paramtype optimized_autoscale: ~kusto_management_client.models.OptimizedAutoscale + :paramtype optimized_autoscale: ~azure.mgmt.kusto.models.OptimizedAutoscale :keyword enable_disk_encryption: A boolean value that indicates if the cluster's disks are encrypted. :paramtype enable_disk_encryption: bool @@ -836,10 +831,9 @@ def __init__( enabled. :paramtype enable_streaming_ingest: bool :keyword virtual_network_configuration: Virtual network definition. - :paramtype virtual_network_configuration: - ~kusto_management_client.models.VirtualNetworkConfiguration + :paramtype virtual_network_configuration: ~azure.mgmt.kusto.models.VirtualNetworkConfiguration :keyword key_vault_properties: KeyVault properties for the cluster encryption. - :paramtype key_vault_properties: ~kusto_management_client.models.KeyVaultProperties + :paramtype key_vault_properties: ~azure.mgmt.kusto.models.KeyVaultProperties :keyword enable_purge: A boolean value that indicates if the purge operations are enabled. :paramtype enable_purge: bool :keyword enable_double_encryption: A boolean value that indicates if double encryption is @@ -848,15 +842,15 @@ def __init__( :keyword public_network_access: Public network access to the cluster is enabled by default. When disabled, only private endpoint connection to the cluster is allowed. Possible values include: "Enabled", "Disabled". Default value: "Enabled". - :paramtype public_network_access: str or ~kusto_management_client.models.PublicNetworkAccess + :paramtype public_network_access: str or ~azure.mgmt.kusto.models.PublicNetworkAccess :keyword allowed_ip_range_list: The list of ips in the format of CIDR allowed to connect to the cluster. :paramtype allowed_ip_range_list: list[str] :keyword engine_type: The engine type. Possible values include: "V2", "V3". Default value: "V3". - :paramtype engine_type: str or ~kusto_management_client.models.EngineType + :paramtype engine_type: str or ~azure.mgmt.kusto.models.EngineType :keyword accepted_audiences: The cluster's accepted audiences. - :paramtype accepted_audiences: list[~kusto_management_client.models.AcceptedAudiences] + :paramtype accepted_audiences: list[~azure.mgmt.kusto.models.AcceptedAudiences] :keyword enable_auto_stop: A boolean value that indicates if the cluster could be automatically stopped (due to lack of data or no activity for many days). :paramtype enable_auto_stop: bool @@ -864,13 +858,13 @@ def __init__( Value is optional but if passed in, must be 'Enabled' or 'Disabled'. Possible values include: "Enabled", "Disabled". Default value: "Disabled". :paramtype restrict_outbound_network_access: str or - ~kusto_management_client.models.ClusterNetworkAccessFlag + ~azure.mgmt.kusto.models.ClusterNetworkAccessFlag :keyword allowed_fqdn_list: List of allowed FQDNs(Fully Qualified Domain Name) for egress from Cluster. :paramtype allowed_fqdn_list: list[str] :keyword public_ip_type: Indicates what public IP type to create - IPv4 (default), or DualStack (both IPv4 and IPv6). Possible values include: "IPv4", "DualStack". Default value: "IPv4". - :paramtype public_ip_type: str or ~kusto_management_client.models.PublicIPType + :paramtype public_ip_type: str or ~azure.mgmt.kusto.models.PublicIPType :keyword virtual_cluster_graduation_properties: Virtual Cluster graduation properties. :paramtype virtual_cluster_graduation_properties: str """ @@ -950,7 +944,7 @@ class ClusterListResult(msrest.serialization.Model): """The list Kusto clusters operation response. :ivar value: The list of Kusto clusters. - :vartype value: list[~kusto_management_client.models.Cluster] + :vartype value: list[~azure.mgmt.kusto.models.Cluster] """ _attribute_map = { @@ -965,7 +959,7 @@ def __init__( ): """ :keyword value: The list of Kusto clusters. - :paramtype value: list[~kusto_management_client.models.Cluster] + :paramtype value: list[~azure.mgmt.kusto.models.Cluster] """ super(ClusterListResult, self).__init__(**kwargs) self.value = value @@ -989,18 +983,18 @@ class ClusterPrincipalAssignment(ProxyResource): :vartype principal_id: str :ivar role: Cluster principal role. Possible values include: "AllDatabasesAdmin", "AllDatabasesViewer". - :vartype role: str or ~kusto_management_client.models.ClusterPrincipalRole + :vartype role: str or ~azure.mgmt.kusto.models.ClusterPrincipalRole :ivar tenant_id: The tenant id of the principal. :vartype tenant_id: str :ivar principal_type: Principal type. Possible values include: "App", "Group", "User". - :vartype principal_type: str or ~kusto_management_client.models.PrincipalType + :vartype principal_type: str or ~azure.mgmt.kusto.models.PrincipalType :ivar tenant_name: The tenant name of the principal. :vartype tenant_name: str :ivar principal_name: The principal name. :vartype principal_name: str :ivar provisioning_state: The provisioned state of the resource. Possible values include: "Running", "Creating", "Deleting", "Succeeded", "Failed", "Moving". - :vartype provisioning_state: str or ~kusto_management_client.models.ProvisioningState + :vartype provisioning_state: str or ~azure.mgmt.kusto.models.ProvisioningState :ivar aad_object_id: The service principal object id in AAD (Azure active directory). :vartype aad_object_id: str """ @@ -1044,11 +1038,11 @@ def __init__( :paramtype principal_id: str :keyword role: Cluster principal role. Possible values include: "AllDatabasesAdmin", "AllDatabasesViewer". - :paramtype role: str or ~kusto_management_client.models.ClusterPrincipalRole + :paramtype role: str or ~azure.mgmt.kusto.models.ClusterPrincipalRole :keyword tenant_id: The tenant id of the principal. :paramtype tenant_id: str :keyword principal_type: Principal type. Possible values include: "App", "Group", "User". - :paramtype principal_type: str or ~kusto_management_client.models.PrincipalType + :paramtype principal_type: str or ~azure.mgmt.kusto.models.PrincipalType """ super(ClusterPrincipalAssignment, self).__init__(**kwargs) self.principal_id = principal_id @@ -1105,7 +1099,7 @@ class ClusterPrincipalAssignmentListResult(msrest.serialization.Model): """The list Kusto cluster principal assignments operation response. :ivar value: The list of Kusto cluster principal assignments. - :vartype value: list[~kusto_management_client.models.ClusterPrincipalAssignment] + :vartype value: list[~azure.mgmt.kusto.models.ClusterPrincipalAssignment] """ _attribute_map = { @@ -1120,7 +1114,7 @@ def __init__( ): """ :keyword value: The list of Kusto cluster principal assignments. - :paramtype value: list[~kusto_management_client.models.ClusterPrincipalAssignment] + :paramtype value: list[~azure.mgmt.kusto.models.ClusterPrincipalAssignment] """ super(ClusterPrincipalAssignmentListResult, self).__init__(**kwargs) self.value = value @@ -1144,15 +1138,15 @@ class ClusterUpdate(Resource): :ivar location: Resource location. :vartype location: str :ivar sku: The SKU of the cluster. - :vartype sku: ~kusto_management_client.models.AzureSku + :vartype sku: ~azure.mgmt.kusto.models.AzureSku :ivar identity: The identity of the cluster, if configured. - :vartype identity: ~kusto_management_client.models.Identity + :vartype identity: ~azure.mgmt.kusto.models.Identity :ivar state: The state of the resource. Possible values include: "Creating", "Unavailable", "Running", "Deleting", "Deleted", "Stopping", "Stopped", "Starting", "Updating". - :vartype state: str or ~kusto_management_client.models.State + :vartype state: str or ~azure.mgmt.kusto.models.State :ivar provisioning_state: The provisioned state of the resource. Possible values include: "Running", "Creating", "Deleting", "Succeeded", "Failed", "Moving". - :vartype provisioning_state: str or ~kusto_management_client.models.ProvisioningState + :vartype provisioning_state: str or ~azure.mgmt.kusto.models.ProvisioningState :ivar uri: The cluster URI. :vartype uri: str :ivar data_ingestion_uri: The cluster data ingestion URI. @@ -1160,9 +1154,9 @@ class ClusterUpdate(Resource): :ivar state_reason: The reason for the cluster's current state. :vartype state_reason: str :ivar trusted_external_tenants: The cluster's external tenants. - :vartype trusted_external_tenants: list[~kusto_management_client.models.TrustedExternalTenant] + :vartype trusted_external_tenants: list[~azure.mgmt.kusto.models.TrustedExternalTenant] :ivar optimized_autoscale: Optimized auto scale definition. - :vartype optimized_autoscale: ~kusto_management_client.models.OptimizedAutoscale + :vartype optimized_autoscale: ~azure.mgmt.kusto.models.OptimizedAutoscale :ivar enable_disk_encryption: A boolean value that indicates if the cluster's disks are encrypted. :vartype enable_disk_encryption: bool @@ -1170,27 +1164,26 @@ class ClusterUpdate(Resource): enabled. :vartype enable_streaming_ingest: bool :ivar virtual_network_configuration: Virtual network definition. - :vartype virtual_network_configuration: - ~kusto_management_client.models.VirtualNetworkConfiguration + :vartype virtual_network_configuration: ~azure.mgmt.kusto.models.VirtualNetworkConfiguration :ivar key_vault_properties: KeyVault properties for the cluster encryption. - :vartype key_vault_properties: ~kusto_management_client.models.KeyVaultProperties + :vartype key_vault_properties: ~azure.mgmt.kusto.models.KeyVaultProperties :ivar enable_purge: A boolean value that indicates if the purge operations are enabled. :vartype enable_purge: bool :ivar language_extensions: List of the cluster's language extensions. - :vartype language_extensions: ~kusto_management_client.models.LanguageExtensionsList + :vartype language_extensions: ~azure.mgmt.kusto.models.LanguageExtensionsList :ivar enable_double_encryption: A boolean value that indicates if double encryption is enabled. :vartype enable_double_encryption: bool :ivar public_network_access: Public network access to the cluster is enabled by default. When disabled, only private endpoint connection to the cluster is allowed. Possible values include: "Enabled", "Disabled". Default value: "Enabled". - :vartype public_network_access: str or ~kusto_management_client.models.PublicNetworkAccess + :vartype public_network_access: str or ~azure.mgmt.kusto.models.PublicNetworkAccess :ivar allowed_ip_range_list: The list of ips in the format of CIDR allowed to connect to the cluster. :vartype allowed_ip_range_list: list[str] :ivar engine_type: The engine type. Possible values include: "V2", "V3". Default value: "V3". - :vartype engine_type: str or ~kusto_management_client.models.EngineType + :vartype engine_type: str or ~azure.mgmt.kusto.models.EngineType :ivar accepted_audiences: The cluster's accepted audiences. - :vartype accepted_audiences: list[~kusto_management_client.models.AcceptedAudiences] + :vartype accepted_audiences: list[~azure.mgmt.kusto.models.AcceptedAudiences] :ivar enable_auto_stop: A boolean value that indicates if the cluster could be automatically stopped (due to lack of data or no activity for many days). :vartype enable_auto_stop: bool @@ -1198,18 +1191,17 @@ class ClusterUpdate(Resource): Value is optional but if passed in, must be 'Enabled' or 'Disabled'. Possible values include: "Enabled", "Disabled". Default value: "Disabled". :vartype restrict_outbound_network_access: str or - ~kusto_management_client.models.ClusterNetworkAccessFlag + ~azure.mgmt.kusto.models.ClusterNetworkAccessFlag :ivar allowed_fqdn_list: List of allowed FQDNs(Fully Qualified Domain Name) for egress from Cluster. :vartype allowed_fqdn_list: list[str] :ivar public_ip_type: Indicates what public IP type to create - IPv4 (default), or DualStack (both IPv4 and IPv6). Possible values include: "IPv4", "DualStack". Default value: "IPv4". - :vartype public_ip_type: str or ~kusto_management_client.models.PublicIPType + :vartype public_ip_type: str or ~azure.mgmt.kusto.models.PublicIPType :ivar virtual_cluster_graduation_properties: Virtual Cluster graduation properties. :vartype virtual_cluster_graduation_properties: str :ivar private_endpoint_connections: A list of private endpoint connections. - :vartype private_endpoint_connections: - list[~kusto_management_client.models.PrivateEndpointConnection] + :vartype private_endpoint_connections: list[~azure.mgmt.kusto.models.PrivateEndpointConnection] """ _validation = { @@ -1291,14 +1283,13 @@ def __init__( :keyword location: Resource location. :paramtype location: str :keyword sku: The SKU of the cluster. - :paramtype sku: ~kusto_management_client.models.AzureSku + :paramtype sku: ~azure.mgmt.kusto.models.AzureSku :keyword identity: The identity of the cluster, if configured. - :paramtype identity: ~kusto_management_client.models.Identity + :paramtype identity: ~azure.mgmt.kusto.models.Identity :keyword trusted_external_tenants: The cluster's external tenants. - :paramtype trusted_external_tenants: - list[~kusto_management_client.models.TrustedExternalTenant] + :paramtype trusted_external_tenants: list[~azure.mgmt.kusto.models.TrustedExternalTenant] :keyword optimized_autoscale: Optimized auto scale definition. - :paramtype optimized_autoscale: ~kusto_management_client.models.OptimizedAutoscale + :paramtype optimized_autoscale: ~azure.mgmt.kusto.models.OptimizedAutoscale :keyword enable_disk_encryption: A boolean value that indicates if the cluster's disks are encrypted. :paramtype enable_disk_encryption: bool @@ -1306,10 +1297,9 @@ def __init__( enabled. :paramtype enable_streaming_ingest: bool :keyword virtual_network_configuration: Virtual network definition. - :paramtype virtual_network_configuration: - ~kusto_management_client.models.VirtualNetworkConfiguration + :paramtype virtual_network_configuration: ~azure.mgmt.kusto.models.VirtualNetworkConfiguration :keyword key_vault_properties: KeyVault properties for the cluster encryption. - :paramtype key_vault_properties: ~kusto_management_client.models.KeyVaultProperties + :paramtype key_vault_properties: ~azure.mgmt.kusto.models.KeyVaultProperties :keyword enable_purge: A boolean value that indicates if the purge operations are enabled. :paramtype enable_purge: bool :keyword enable_double_encryption: A boolean value that indicates if double encryption is @@ -1318,15 +1308,15 @@ def __init__( :keyword public_network_access: Public network access to the cluster is enabled by default. When disabled, only private endpoint connection to the cluster is allowed. Possible values include: "Enabled", "Disabled". Default value: "Enabled". - :paramtype public_network_access: str or ~kusto_management_client.models.PublicNetworkAccess + :paramtype public_network_access: str or ~azure.mgmt.kusto.models.PublicNetworkAccess :keyword allowed_ip_range_list: The list of ips in the format of CIDR allowed to connect to the cluster. :paramtype allowed_ip_range_list: list[str] :keyword engine_type: The engine type. Possible values include: "V2", "V3". Default value: "V3". - :paramtype engine_type: str or ~kusto_management_client.models.EngineType + :paramtype engine_type: str or ~azure.mgmt.kusto.models.EngineType :keyword accepted_audiences: The cluster's accepted audiences. - :paramtype accepted_audiences: list[~kusto_management_client.models.AcceptedAudiences] + :paramtype accepted_audiences: list[~azure.mgmt.kusto.models.AcceptedAudiences] :keyword enable_auto_stop: A boolean value that indicates if the cluster could be automatically stopped (due to lack of data or no activity for many days). :paramtype enable_auto_stop: bool @@ -1334,13 +1324,13 @@ def __init__( Value is optional but if passed in, must be 'Enabled' or 'Disabled'. Possible values include: "Enabled", "Disabled". Default value: "Disabled". :paramtype restrict_outbound_network_access: str or - ~kusto_management_client.models.ClusterNetworkAccessFlag + ~azure.mgmt.kusto.models.ClusterNetworkAccessFlag :keyword allowed_fqdn_list: List of allowed FQDNs(Fully Qualified Domain Name) for egress from Cluster. :paramtype allowed_fqdn_list: list[str] :keyword public_ip_type: Indicates what public IP type to create - IPv4 (default), or DualStack (both IPv4 and IPv6). Possible values include: "IPv4", "DualStack". Default value: "IPv4". - :paramtype public_ip_type: str or ~kusto_management_client.models.PublicIPType + :paramtype public_ip_type: str or ~azure.mgmt.kusto.models.PublicIPType :keyword virtual_cluster_graduation_properties: Virtual Cluster graduation properties. :paramtype virtual_cluster_graduation_properties: str """ @@ -1429,7 +1419,7 @@ class Database(ProxyResource): :vartype location: str :ivar kind: Required. Kind of the database.Constant filled by server. Possible values include: "ReadWrite", "ReadOnlyFollowing". - :vartype kind: str or ~kusto_management_client.models.Kind + :vartype kind: str or ~azure.mgmt.kusto.models.Kind """ _validation = { @@ -1470,7 +1460,7 @@ class DatabaseListResult(msrest.serialization.Model): """The list Kusto databases operation response. :ivar value: The list of Kusto databases. - :vartype value: list[~kusto_management_client.models.Database] + :vartype value: list[~azure.mgmt.kusto.models.Database] """ _attribute_map = { @@ -1485,7 +1475,7 @@ def __init__( ): """ :keyword value: The list of Kusto databases. - :paramtype value: list[~kusto_management_client.models.Database] + :paramtype value: list[~azure.mgmt.kusto.models.Database] """ super(DatabaseListResult, self).__init__(**kwargs) self.value = value @@ -1500,11 +1490,11 @@ class DatabasePrincipal(msrest.serialization.Model): :ivar role: Required. Database principal role. Possible values include: "Admin", "Ingestor", "Monitor", "User", "UnrestrictedViewer", "Viewer". - :vartype role: str or ~kusto_management_client.models.DatabasePrincipalRole + :vartype role: str or ~azure.mgmt.kusto.models.DatabasePrincipalRole :ivar name: Required. Database principal name. :vartype name: str :ivar type: Required. Database principal type. Possible values include: "App", "Group", "User". - :vartype type: str or ~kusto_management_client.models.DatabasePrincipalType + :vartype type: str or ~azure.mgmt.kusto.models.DatabasePrincipalType :ivar fqn: Database principal fully qualified name. :vartype fqn: str :ivar email: Database principal email if exists. @@ -1546,12 +1536,12 @@ def __init__( """ :keyword role: Required. Database principal role. Possible values include: "Admin", "Ingestor", "Monitor", "User", "UnrestrictedViewer", "Viewer". - :paramtype role: str or ~kusto_management_client.models.DatabasePrincipalRole + :paramtype role: str or ~azure.mgmt.kusto.models.DatabasePrincipalRole :keyword name: Required. Database principal name. :paramtype name: str :keyword type: Required. Database principal type. Possible values include: "App", "Group", "User". - :paramtype type: str or ~kusto_management_client.models.DatabasePrincipalType + :paramtype type: str or ~azure.mgmt.kusto.models.DatabasePrincipalType :keyword fqn: Database principal fully qualified name. :paramtype fqn: str :keyword email: Database principal email if exists. @@ -1587,18 +1577,18 @@ class DatabasePrincipalAssignment(ProxyResource): :vartype principal_id: str :ivar role: Database principal role. Possible values include: "Admin", "Ingestor", "Monitor", "User", "UnrestrictedViewer", "Viewer". - :vartype role: str or ~kusto_management_client.models.DatabasePrincipalRole + :vartype role: str or ~azure.mgmt.kusto.models.DatabasePrincipalRole :ivar tenant_id: The tenant id of the principal. :vartype tenant_id: str :ivar principal_type: Principal type. Possible values include: "App", "Group", "User". - :vartype principal_type: str or ~kusto_management_client.models.PrincipalType + :vartype principal_type: str or ~azure.mgmt.kusto.models.PrincipalType :ivar tenant_name: The tenant name of the principal. :vartype tenant_name: str :ivar principal_name: The principal name. :vartype principal_name: str :ivar provisioning_state: The provisioned state of the resource. Possible values include: "Running", "Creating", "Deleting", "Succeeded", "Failed", "Moving". - :vartype provisioning_state: str or ~kusto_management_client.models.ProvisioningState + :vartype provisioning_state: str or ~azure.mgmt.kusto.models.ProvisioningState :ivar aad_object_id: The service principal object id in AAD (Azure active directory). :vartype aad_object_id: str """ @@ -1642,11 +1632,11 @@ def __init__( :paramtype principal_id: str :keyword role: Database principal role. Possible values include: "Admin", "Ingestor", "Monitor", "User", "UnrestrictedViewer", "Viewer". - :paramtype role: str or ~kusto_management_client.models.DatabasePrincipalRole + :paramtype role: str or ~azure.mgmt.kusto.models.DatabasePrincipalRole :keyword tenant_id: The tenant id of the principal. :paramtype tenant_id: str :keyword principal_type: Principal type. Possible values include: "App", "Group", "User". - :paramtype principal_type: str or ~kusto_management_client.models.PrincipalType + :paramtype principal_type: str or ~azure.mgmt.kusto.models.PrincipalType """ super(DatabasePrincipalAssignment, self).__init__(**kwargs) self.principal_id = principal_id @@ -1703,7 +1693,7 @@ class DatabasePrincipalAssignmentListResult(msrest.serialization.Model): """The list Kusto database principal assignments operation response. :ivar value: The list of Kusto database principal assignments. - :vartype value: list[~kusto_management_client.models.DatabasePrincipalAssignment] + :vartype value: list[~azure.mgmt.kusto.models.DatabasePrincipalAssignment] """ _attribute_map = { @@ -1718,7 +1708,7 @@ def __init__( ): """ :keyword value: The list of Kusto database principal assignments. - :paramtype value: list[~kusto_management_client.models.DatabasePrincipalAssignment] + :paramtype value: list[~azure.mgmt.kusto.models.DatabasePrincipalAssignment] """ super(DatabasePrincipalAssignmentListResult, self).__init__(**kwargs) self.value = value @@ -1728,7 +1718,7 @@ class DatabasePrincipalListRequest(msrest.serialization.Model): """The list Kusto database principals operation request. :ivar value: The list of Kusto database principals. - :vartype value: list[~kusto_management_client.models.DatabasePrincipal] + :vartype value: list[~azure.mgmt.kusto.models.DatabasePrincipal] """ _attribute_map = { @@ -1743,7 +1733,7 @@ def __init__( ): """ :keyword value: The list of Kusto database principals. - :paramtype value: list[~kusto_management_client.models.DatabasePrincipal] + :paramtype value: list[~azure.mgmt.kusto.models.DatabasePrincipal] """ super(DatabasePrincipalListRequest, self).__init__(**kwargs) self.value = value @@ -1753,7 +1743,7 @@ class DatabasePrincipalListResult(msrest.serialization.Model): """The list Kusto database principals operation response. :ivar value: The list of Kusto database principals. - :vartype value: list[~kusto_management_client.models.DatabasePrincipal] + :vartype value: list[~azure.mgmt.kusto.models.DatabasePrincipal] """ _attribute_map = { @@ -1768,7 +1758,7 @@ def __init__( ): """ :keyword value: The list of Kusto database principals. - :paramtype value: list[~kusto_management_client.models.DatabasePrincipal] + :paramtype value: list[~azure.mgmt.kusto.models.DatabasePrincipal] """ super(DatabasePrincipalListResult, self).__init__(**kwargs) self.value = value @@ -1821,7 +1811,7 @@ class DataConnection(ProxyResource): :vartype location: str :ivar kind: Required. Kind of the endpoint for the data connection.Constant filled by server. Possible values include: "EventHub", "EventGrid", "IotHub". - :vartype kind: str or ~kusto_management_client.models.DataConnectionKind + :vartype kind: str or ~azure.mgmt.kusto.models.DataConnectionKind """ _validation = { @@ -1902,7 +1892,7 @@ class DataConnectionListResult(msrest.serialization.Model): """The list Kusto data connections operation response. :ivar value: The list of Kusto data connections. - :vartype value: list[~kusto_management_client.models.DataConnection] + :vartype value: list[~azure.mgmt.kusto.models.DataConnection] """ _attribute_map = { @@ -1917,7 +1907,7 @@ def __init__( ): """ :keyword value: The list of Kusto data connections. - :paramtype value: list[~kusto_management_client.models.DataConnection] + :paramtype value: list[~azure.mgmt.kusto.models.DataConnection] """ super(DataConnectionListResult, self).__init__(**kwargs) self.value = value @@ -1929,7 +1919,7 @@ class DataConnectionValidation(msrest.serialization.Model): :ivar data_connection_name: The name of the data connection. :vartype data_connection_name: str :ivar properties: The data connection properties to validate. - :vartype properties: ~kusto_management_client.models.DataConnection + :vartype properties: ~azure.mgmt.kusto.models.DataConnection """ _attribute_map = { @@ -1948,7 +1938,7 @@ def __init__( :keyword data_connection_name: The name of the data connection. :paramtype data_connection_name: str :keyword properties: The data connection properties to validate. - :paramtype properties: ~kusto_management_client.models.DataConnection + :paramtype properties: ~azure.mgmt.kusto.models.DataConnection """ super(DataConnectionValidation, self).__init__(**kwargs) self.data_connection_name = data_connection_name @@ -1959,7 +1949,7 @@ class DataConnectionValidationListResult(msrest.serialization.Model): """The list Kusto data connection validation result. :ivar value: The list of Kusto data connection validation errors. - :vartype value: list[~kusto_management_client.models.DataConnectionValidationResult] + :vartype value: list[~azure.mgmt.kusto.models.DataConnectionValidationResult] """ _attribute_map = { @@ -1974,7 +1964,7 @@ def __init__( ): """ :keyword value: The list of Kusto data connection validation errors. - :paramtype value: list[~kusto_management_client.models.DataConnectionValidationResult] + :paramtype value: list[~azure.mgmt.kusto.models.DataConnectionValidationResult] """ super(DataConnectionValidationListResult, self).__init__(**kwargs) self.value = value @@ -2036,7 +2026,7 @@ class EndpointDependency(msrest.serialization.Model): :ivar domain_name: The domain name of the dependency. :vartype domain_name: str :ivar endpoint_details: The ports used when connecting to DomainName. - :vartype endpoint_details: list[~kusto_management_client.models.EndpointDetail] + :vartype endpoint_details: list[~azure.mgmt.kusto.models.EndpointDetail] """ _attribute_map = { @@ -2055,7 +2045,7 @@ def __init__( :keyword domain_name: The domain name of the dependency. :paramtype domain_name: str :keyword endpoint_details: The ports used when connecting to DomainName. - :paramtype endpoint_details: list[~kusto_management_client.models.EndpointDetail] + :paramtype endpoint_details: list[~azure.mgmt.kusto.models.EndpointDetail] """ super(EndpointDependency, self).__init__(**kwargs) self.domain_name = domain_name @@ -2106,7 +2096,7 @@ class EventGridDataConnection(DataConnection): :vartype location: str :ivar kind: Required. Kind of the endpoint for the data connection.Constant filled by server. Possible values include: "EventHub", "EventGrid", "IotHub". - :vartype kind: str or ~kusto_management_client.models.DataConnectionKind + :vartype kind: str or ~azure.mgmt.kusto.models.DataConnectionKind :ivar storage_account_resource_id: The resource ID of the storage account where the data resides. :vartype storage_account_resource_id: str @@ -2127,25 +2117,26 @@ class EventGridDataConnection(DataConnection): each message. Possible values include: "MULTIJSON", "JSON", "CSV", "TSV", "SCSV", "SOHSV", "PSV", "TXT", "RAW", "SINGLEJSON", "AVRO", "TSVE", "PARQUET", "ORC", "APACHEAVRO", "W3CLOGFILE". - :vartype data_format: str or ~kusto_management_client.models.EventGridDataFormat + :vartype data_format: str or ~azure.mgmt.kusto.models.EventGridDataFormat :ivar ignore_first_record: A Boolean value that, if set to true, indicates that ingestion should ignore the first record of every file. :vartype ignore_first_record: bool :ivar blob_storage_event_type: The name of blob storage event type to process. Possible values include: "Microsoft.Storage.BlobCreated", "Microsoft.Storage.BlobRenamed". - :vartype blob_storage_event_type: str or ~kusto_management_client.models.BlobStorageEventType - :ivar managed_identity_resource_id: The resource ID of a managed identity (system or user - assigned) to be used to authenticate with event hub and storage account. + :vartype blob_storage_event_type: str or ~azure.mgmt.kusto.models.BlobStorageEventType + :ivar managed_identity_resource_id: Empty for non-managed identity based data connection. For + system assigned identity, provide cluster resource Id. For user assigned identity (UAI) + provide the UAI resource Id. :vartype managed_identity_resource_id: str :ivar managed_identity_object_id: The object ID of managedIdentityResourceId. :vartype managed_identity_object_id: str :ivar database_routing: Indication for database routing information from the data connection, by default only database routing information is allowed. Possible values include: "Single", "Multi". - :vartype database_routing: str or ~kusto_management_client.models.DatabaseRouting + :vartype database_routing: str or ~azure.mgmt.kusto.models.DatabaseRouting :ivar provisioning_state: The provisioned state of the resource. Possible values include: "Running", "Creating", "Deleting", "Succeeded", "Failed", "Moving". - :vartype provisioning_state: str or ~kusto_management_client.models.ProvisioningState + :vartype provisioning_state: str or ~azure.mgmt.kusto.models.ProvisioningState """ _validation = { @@ -2219,20 +2210,21 @@ def __init__( to each message. Possible values include: "MULTIJSON", "JSON", "CSV", "TSV", "SCSV", "SOHSV", "PSV", "TXT", "RAW", "SINGLEJSON", "AVRO", "TSVE", "PARQUET", "ORC", "APACHEAVRO", "W3CLOGFILE". - :paramtype data_format: str or ~kusto_management_client.models.EventGridDataFormat + :paramtype data_format: str or ~azure.mgmt.kusto.models.EventGridDataFormat :keyword ignore_first_record: A Boolean value that, if set to true, indicates that ingestion should ignore the first record of every file. :paramtype ignore_first_record: bool :keyword blob_storage_event_type: The name of blob storage event type to process. Possible values include: "Microsoft.Storage.BlobCreated", "Microsoft.Storage.BlobRenamed". - :paramtype blob_storage_event_type: str or ~kusto_management_client.models.BlobStorageEventType - :keyword managed_identity_resource_id: The resource ID of a managed identity (system or user - assigned) to be used to authenticate with event hub and storage account. + :paramtype blob_storage_event_type: str or ~azure.mgmt.kusto.models.BlobStorageEventType + :keyword managed_identity_resource_id: Empty for non-managed identity based data connection. + For system assigned identity, provide cluster resource Id. For user assigned identity (UAI) + provide the UAI resource Id. :paramtype managed_identity_resource_id: str :keyword database_routing: Indication for database routing information from the data connection, by default only database routing information is allowed. Possible values include: "Single", "Multi". - :paramtype database_routing: str or ~kusto_management_client.models.DatabaseRouting + :paramtype database_routing: str or ~azure.mgmt.kusto.models.DatabaseRouting """ super(EventGridDataConnection, self).__init__(location=location, **kwargs) self.kind = 'EventGrid' # type: str @@ -2270,7 +2262,7 @@ class EventHubDataConnection(DataConnection): :vartype location: str :ivar kind: Required. Kind of the endpoint for the data connection.Constant filled by server. Possible values include: "EventHub", "EventGrid", "IotHub". - :vartype kind: str or ~kusto_management_client.models.DataConnectionKind + :vartype kind: str or ~azure.mgmt.kusto.models.DataConnectionKind :ivar event_hub_resource_id: The resource ID of the event hub to be used to create a data connection. :vartype event_hub_resource_id: str @@ -2286,24 +2278,25 @@ class EventHubDataConnection(DataConnection): each message. Possible values include: "MULTIJSON", "JSON", "CSV", "TSV", "SCSV", "SOHSV", "PSV", "TXT", "RAW", "SINGLEJSON", "AVRO", "TSVE", "PARQUET", "ORC", "APACHEAVRO", "W3CLOGFILE". - :vartype data_format: str or ~kusto_management_client.models.EventHubDataFormat + :vartype data_format: str or ~azure.mgmt.kusto.models.EventHubDataFormat :ivar event_system_properties: System properties of the event hub. :vartype event_system_properties: list[str] :ivar compression: The event hub messages compression type. Possible values include: "None", "GZip". Default value: "None". - :vartype compression: str or ~kusto_management_client.models.Compression + :vartype compression: str or ~azure.mgmt.kusto.models.Compression :ivar provisioning_state: The provisioned state of the resource. Possible values include: "Running", "Creating", "Deleting", "Succeeded", "Failed", "Moving". - :vartype provisioning_state: str or ~kusto_management_client.models.ProvisioningState - :ivar managed_identity_resource_id: The resource ID of a managed identity (system or user - assigned) to be used to authenticate with event hub. + :vartype provisioning_state: str or ~azure.mgmt.kusto.models.ProvisioningState + :ivar managed_identity_resource_id: Empty for non-managed identity based data connection. For + system assigned identity, provide cluster resource Id. For user assigned identity (UAI) + provide the UAI resource Id. :vartype managed_identity_resource_id: str :ivar managed_identity_object_id: The object ID of the managedIdentityResourceId. :vartype managed_identity_object_id: str :ivar database_routing: Indication for database routing information from the data connection, by default only database routing information is allowed. Possible values include: "Single", "Multi". - :vartype database_routing: str or ~kusto_management_client.models.DatabaseRouting + :vartype database_routing: str or ~azure.mgmt.kusto.models.DatabaseRouting """ _validation = { @@ -2367,19 +2360,20 @@ def __init__( to each message. Possible values include: "MULTIJSON", "JSON", "CSV", "TSV", "SCSV", "SOHSV", "PSV", "TXT", "RAW", "SINGLEJSON", "AVRO", "TSVE", "PARQUET", "ORC", "APACHEAVRO", "W3CLOGFILE". - :paramtype data_format: str or ~kusto_management_client.models.EventHubDataFormat + :paramtype data_format: str or ~azure.mgmt.kusto.models.EventHubDataFormat :keyword event_system_properties: System properties of the event hub. :paramtype event_system_properties: list[str] :keyword compression: The event hub messages compression type. Possible values include: "None", "GZip". Default value: "None". - :paramtype compression: str or ~kusto_management_client.models.Compression - :keyword managed_identity_resource_id: The resource ID of a managed identity (system or user - assigned) to be used to authenticate with event hub. + :paramtype compression: str or ~azure.mgmt.kusto.models.Compression + :keyword managed_identity_resource_id: Empty for non-managed identity based data connection. + For system assigned identity, provide cluster resource Id. For user assigned identity (UAI) + provide the UAI resource Id. :paramtype managed_identity_resource_id: str :keyword database_routing: Indication for database routing information from the data connection, by default only database routing information is allowed. Possible values include: "Single", "Multi". - :paramtype database_routing: str or ~kusto_management_client.models.DatabaseRouting + :paramtype database_routing: str or ~azure.mgmt.kusto.models.DatabaseRouting """ super(EventHubDataConnection, self).__init__(location=location, **kwargs) self.kind = 'EventHub' # type: str @@ -2451,7 +2445,7 @@ class FollowerDatabaseListResult(msrest.serialization.Model): """The list Kusto database principals operation response. :ivar value: The list of follower database result. - :vartype value: list[~kusto_management_client.models.FollowerDatabaseDefinition] + :vartype value: list[~azure.mgmt.kusto.models.FollowerDatabaseDefinition] """ _attribute_map = { @@ -2466,7 +2460,7 @@ def __init__( ): """ :keyword value: The list of follower database result. - :paramtype value: list[~kusto_management_client.models.FollowerDatabaseDefinition] + :paramtype value: list[~azure.mgmt.kusto.models.FollowerDatabaseDefinition] """ super(FollowerDatabaseListResult, self).__init__(**kwargs) self.value = value @@ -2487,12 +2481,12 @@ class Identity(msrest.serialization.Model): UserAssigned' includes both an implicitly created identity and a set of user-assigned identities. The type 'None' will remove all identities. Possible values include: "None", "SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned". - :vartype type: str or ~kusto_management_client.models.IdentityType + :vartype type: str or ~azure.mgmt.kusto.models.IdentityType :ivar user_assigned_identities: The list of user identities associated with the Kusto cluster. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. :vartype user_assigned_identities: dict[str, - ~kusto_management_client.models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] + ~azure.mgmt.kusto.models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] """ _validation = { @@ -2520,12 +2514,12 @@ def __init__( UserAssigned' includes both an implicitly created identity and a set of user-assigned identities. The type 'None' will remove all identities. Possible values include: "None", "SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned". - :paramtype type: str or ~kusto_management_client.models.IdentityType + :paramtype type: str or ~azure.mgmt.kusto.models.IdentityType :keyword user_assigned_identities: The list of user identities associated with the Kusto cluster. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. :paramtype user_assigned_identities: dict[str, - ~kusto_management_client.models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] + ~azure.mgmt.kusto.models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] """ super(Identity, self).__init__(**kwargs) self.principal_id = None @@ -2553,7 +2547,7 @@ class IotHubDataConnection(DataConnection): :vartype location: str :ivar kind: Required. Kind of the endpoint for the data connection.Constant filled by server. Possible values include: "EventHub", "EventGrid", "IotHub". - :vartype kind: str or ~kusto_management_client.models.DataConnectionKind + :vartype kind: str or ~azure.mgmt.kusto.models.DataConnectionKind :ivar iot_hub_resource_id: The resource ID of the Iot hub to be used to create a data connection. :vartype iot_hub_resource_id: str @@ -2569,7 +2563,7 @@ class IotHubDataConnection(DataConnection): each message. Possible values include: "MULTIJSON", "JSON", "CSV", "TSV", "SCSV", "SOHSV", "PSV", "TXT", "RAW", "SINGLEJSON", "AVRO", "TSVE", "PARQUET", "ORC", "APACHEAVRO", "W3CLOGFILE". - :vartype data_format: str or ~kusto_management_client.models.IotHubDataFormat + :vartype data_format: str or ~azure.mgmt.kusto.models.IotHubDataFormat :ivar event_system_properties: System properties of the iot hub. :vartype event_system_properties: list[str] :ivar shared_access_policy_name: The name of the share access policy. @@ -2577,10 +2571,10 @@ class IotHubDataConnection(DataConnection): :ivar database_routing: Indication for database routing information from the data connection, by default only database routing information is allowed. Possible values include: "Single", "Multi". - :vartype database_routing: str or ~kusto_management_client.models.DatabaseRouting + :vartype database_routing: str or ~azure.mgmt.kusto.models.DatabaseRouting :ivar provisioning_state: The provisioned state of the resource. Possible values include: "Running", "Creating", "Deleting", "Succeeded", "Failed", "Moving". - :vartype provisioning_state: str or ~kusto_management_client.models.ProvisioningState + :vartype provisioning_state: str or ~azure.mgmt.kusto.models.ProvisioningState """ _validation = { @@ -2640,7 +2634,7 @@ def __init__( to each message. Possible values include: "MULTIJSON", "JSON", "CSV", "TSV", "SCSV", "SOHSV", "PSV", "TXT", "RAW", "SINGLEJSON", "AVRO", "TSVE", "PARQUET", "ORC", "APACHEAVRO", "W3CLOGFILE". - :paramtype data_format: str or ~kusto_management_client.models.IotHubDataFormat + :paramtype data_format: str or ~azure.mgmt.kusto.models.IotHubDataFormat :keyword event_system_properties: System properties of the iot hub. :paramtype event_system_properties: list[str] :keyword shared_access_policy_name: The name of the share access policy. @@ -2648,7 +2642,7 @@ def __init__( :keyword database_routing: Indication for database routing information from the data connection, by default only database routing information is allowed. Possible values include: "Single", "Multi". - :paramtype database_routing: str or ~kusto_management_client.models.DatabaseRouting + :paramtype database_routing: str or ~azure.mgmt.kusto.models.DatabaseRouting """ super(IotHubDataConnection, self).__init__(location=location, **kwargs) self.kind = 'IotHub' # type: str @@ -2715,7 +2709,7 @@ class LanguageExtension(msrest.serialization.Model): :ivar language_extension_name: The language extension name. Possible values include: "PYTHON", "R". - :vartype language_extension_name: str or ~kusto_management_client.models.LanguageExtensionName + :vartype language_extension_name: str or ~azure.mgmt.kusto.models.LanguageExtensionName """ _attribute_map = { @@ -2731,8 +2725,7 @@ def __init__( """ :keyword language_extension_name: The language extension name. Possible values include: "PYTHON", "R". - :paramtype language_extension_name: str or - ~kusto_management_client.models.LanguageExtensionName + :paramtype language_extension_name: str or ~azure.mgmt.kusto.models.LanguageExtensionName """ super(LanguageExtension, self).__init__(**kwargs) self.language_extension_name = language_extension_name @@ -2742,7 +2735,7 @@ class LanguageExtensionsList(msrest.serialization.Model): """The list of language extension objects. :ivar value: The list of language extensions. - :vartype value: list[~kusto_management_client.models.LanguageExtension] + :vartype value: list[~azure.mgmt.kusto.models.LanguageExtension] """ _attribute_map = { @@ -2757,7 +2750,7 @@ def __init__( ): """ :keyword value: The list of language extensions. - :paramtype value: list[~kusto_management_client.models.LanguageExtension] + :paramtype value: list[~azure.mgmt.kusto.models.LanguageExtension] """ super(LanguageExtensionsList, self).__init__(**kwargs) self.value = value @@ -2767,7 +2760,7 @@ class ListResourceSkusResult(msrest.serialization.Model): """List of available SKUs for a Kusto Cluster. :ivar value: The collection of available SKUs for an existing resource. - :vartype value: list[~kusto_management_client.models.AzureResourceSku] + :vartype value: list[~azure.mgmt.kusto.models.AzureResourceSku] """ _attribute_map = { @@ -2782,7 +2775,7 @@ def __init__( ): """ :keyword value: The collection of available SKUs for an existing resource. - :paramtype value: list[~kusto_management_client.models.AzureResourceSku] + :paramtype value: list[~azure.mgmt.kusto.models.AzureResourceSku] """ super(ListResourceSkusResult, self).__init__(**kwargs) self.value = value @@ -2802,7 +2795,7 @@ class ManagedPrivateEndpoint(ProxyResource): "Microsoft.Storage/storageAccounts". :vartype type: str :ivar system_data: Metadata pertaining to creation and last modification of the resource. - :vartype system_data: ~kusto_management_client.models.SystemData + :vartype system_data: ~azure.mgmt.kusto.models.SystemData :ivar private_link_resource_id: The ARM resource ID of the resource for which the managed private endpoint is created. :vartype private_link_resource_id: str @@ -2815,7 +2808,7 @@ class ManagedPrivateEndpoint(ProxyResource): :vartype request_message: str :ivar provisioning_state: The provisioned state of the resource. Possible values include: "Running", "Creating", "Deleting", "Succeeded", "Failed", "Moving". - :vartype provisioning_state: str or ~kusto_management_client.models.ProvisioningState + :vartype provisioning_state: str or ~azure.mgmt.kusto.models.ProvisioningState """ _validation = { @@ -2872,7 +2865,7 @@ class ManagedPrivateEndpointListResult(msrest.serialization.Model): """The list managed private endpoints operation response. :ivar value: The list of managed private endpoints. - :vartype value: list[~kusto_management_client.models.ManagedPrivateEndpoint] + :vartype value: list[~azure.mgmt.kusto.models.ManagedPrivateEndpoint] """ _attribute_map = { @@ -2887,7 +2880,7 @@ def __init__( ): """ :keyword value: The list of managed private endpoints. - :paramtype value: list[~kusto_management_client.models.ManagedPrivateEndpoint] + :paramtype value: list[~azure.mgmt.kusto.models.ManagedPrivateEndpoint] """ super(ManagedPrivateEndpointListResult, self).__init__(**kwargs) self.value = value @@ -2940,7 +2933,7 @@ class Operation(msrest.serialization.Model): :ivar name: This is of the format {provider}/{resource}/{operation}. :vartype name: str :ivar display: The object that describes the operation. - :vartype display: ~kusto_management_client.models.OperationDisplay + :vartype display: ~azure.mgmt.kusto.models.OperationDisplay :ivar origin: The intended executor of the operation. :vartype origin: str :ivar properties: Any object. @@ -2967,7 +2960,7 @@ def __init__( :keyword name: This is of the format {provider}/{resource}/{operation}. :paramtype name: str :keyword display: The object that describes the operation. - :paramtype display: ~kusto_management_client.models.OperationDisplay + :paramtype display: ~azure.mgmt.kusto.models.OperationDisplay :keyword origin: The intended executor of the operation. :paramtype origin: str :keyword properties: Any object. @@ -3030,7 +3023,7 @@ class OperationListResult(msrest.serialization.Model): """Result of the request to list REST API operations. It contains a list of operations and a URL nextLink to get the next set of results. :ivar value: The list of operations supported by the resource provider. - :vartype value: list[~kusto_management_client.models.Operation] + :vartype value: list[~azure.mgmt.kusto.models.Operation] :ivar next_link: The URL to get the next set of operation list results if there are any. :vartype next_link: str """ @@ -3049,7 +3042,7 @@ def __init__( ): """ :keyword value: The list of operations supported by the resource provider. - :paramtype value: list[~kusto_management_client.models.Operation] + :paramtype value: list[~azure.mgmt.kusto.models.Operation] :keyword next_link: The URL to get the next set of operation list results if there are any. :paramtype next_link: str """ @@ -3069,7 +3062,7 @@ class OperationResult(msrest.serialization.Model): :vartype name: str :ivar status: status of the Operation result. Possible values include: "Succeeded", "Canceled", "Failed", "Running". - :vartype status: str or ~kusto_management_client.models.Status + :vartype status: str or ~azure.mgmt.kusto.models.Status :ivar start_time: The operation start time. :vartype start_time: ~datetime.datetime :ivar end_time: The operation end time. @@ -3084,7 +3077,7 @@ class OperationResult(msrest.serialization.Model): :vartype operation_kind: str :ivar provisioning_state: The provisioned state of the resource. Possible values include: "Running", "Creating", "Deleting", "Succeeded", "Failed", "Moving". - :vartype provisioning_state: str or ~kusto_management_client.models.ProvisioningState + :vartype provisioning_state: str or ~azure.mgmt.kusto.models.ProvisioningState :ivar operation_state: The state of the operation. :vartype operation_state: str """ @@ -3229,10 +3222,10 @@ class OutboundNetworkDependenciesEndpoint(ProxyResource): Storage, Azure SQL Database, and Azure Active Directory. :vartype category: str :ivar endpoints: The endpoints that the Kusto Service Environment reaches the service at. - :vartype endpoints: list[~kusto_management_client.models.EndpointDependency] + :vartype endpoints: list[~azure.mgmt.kusto.models.EndpointDependency] :ivar provisioning_state: The provisioned state of the resource. Possible values include: "Running", "Creating", "Deleting", "Succeeded", "Failed", "Moving". - :vartype provisioning_state: str or ~kusto_management_client.models.ProvisioningState + :vartype provisioning_state: str or ~azure.mgmt.kusto.models.ProvisioningState """ _validation = { @@ -3265,7 +3258,7 @@ def __init__( Storage, Azure SQL Database, and Azure Active Directory. :paramtype category: str :keyword endpoints: The endpoints that the Kusto Service Environment reaches the service at. - :paramtype endpoints: list[~kusto_management_client.models.EndpointDependency] + :paramtype endpoints: list[~azure.mgmt.kusto.models.EndpointDependency] """ super(OutboundNetworkDependenciesEndpoint, self).__init__(**kwargs) self.etag = None @@ -3282,7 +3275,7 @@ class OutboundNetworkDependenciesEndpointListResult(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :ivar value: Required. Collection of resources. - :vartype value: list[~kusto_management_client.models.OutboundNetworkDependenciesEndpoint] + :vartype value: list[~azure.mgmt.kusto.models.OutboundNetworkDependenciesEndpoint] :ivar next_link: Link to next page of resources. :vartype next_link: str """ @@ -3305,7 +3298,7 @@ def __init__( ): """ :keyword value: Required. Collection of resources. - :paramtype value: list[~kusto_management_client.models.OutboundNetworkDependenciesEndpoint] + :paramtype value: list[~azure.mgmt.kusto.models.OutboundNetworkDependenciesEndpoint] """ super(OutboundNetworkDependenciesEndpointListResult, self).__init__(**kwargs) self.value = value @@ -3326,13 +3319,13 @@ class PrivateEndpointConnection(ProxyResource): "Microsoft.Storage/storageAccounts". :vartype type: str :ivar system_data: Metadata pertaining to creation and last modification of the resource. - :vartype system_data: ~kusto_management_client.models.SystemData + :vartype system_data: ~azure.mgmt.kusto.models.SystemData :ivar private_endpoint: Private endpoint which the connection belongs to. - :vartype private_endpoint: ~kusto_management_client.models.PrivateEndpointProperty + :vartype private_endpoint: ~azure.mgmt.kusto.models.PrivateEndpointProperty :ivar private_link_service_connection_state: Connection State of the Private Endpoint Connection. :vartype private_link_service_connection_state: - ~kusto_management_client.models.PrivateLinkServiceConnectionStateProperty + ~azure.mgmt.kusto.models.PrivateLinkServiceConnectionStateProperty :ivar group_id: Group id of the private endpoint. :vartype group_id: str :ivar provisioning_state: Provisioning state of the private endpoint. @@ -3370,7 +3363,7 @@ def __init__( :keyword private_link_service_connection_state: Connection State of the Private Endpoint Connection. :paramtype private_link_service_connection_state: - ~kusto_management_client.models.PrivateLinkServiceConnectionStateProperty + ~azure.mgmt.kusto.models.PrivateLinkServiceConnectionStateProperty """ super(PrivateEndpointConnection, self).__init__(**kwargs) self.system_data = None @@ -3384,7 +3377,7 @@ class PrivateEndpointConnectionListResult(msrest.serialization.Model): """A list of private endpoint connections. :ivar value: Array of private endpoint connections. - :vartype value: list[~kusto_management_client.models.PrivateEndpointConnection] + :vartype value: list[~azure.mgmt.kusto.models.PrivateEndpointConnection] """ _attribute_map = { @@ -3399,7 +3392,7 @@ def __init__( ): """ :keyword value: Array of private endpoint connections. - :paramtype value: list[~kusto_management_client.models.PrivateEndpointConnection] + :paramtype value: list[~azure.mgmt.kusto.models.PrivateEndpointConnection] """ super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) self.value = value @@ -3446,7 +3439,7 @@ class PrivateLinkResource(Resource): "Microsoft.Storage/storageAccounts". :vartype type: str :ivar system_data: Metadata pertaining to creation and last modification of the resource. - :vartype system_data: ~kusto_management_client.models.SystemData + :vartype system_data: ~azure.mgmt.kusto.models.SystemData :ivar group_id: The private link resource group id. :vartype group_id: str :ivar required_members: The private link resource required member names. @@ -3492,7 +3485,7 @@ class PrivateLinkResourceListResult(msrest.serialization.Model): """A list of private link resources. :ivar value: Array of private link resources. - :vartype value: list[~kusto_management_client.models.PrivateLinkResource] + :vartype value: list[~azure.mgmt.kusto.models.PrivateLinkResource] """ _attribute_map = { @@ -3507,7 +3500,7 @@ def __init__( ): """ :keyword value: Array of private link resources. - :paramtype value: list[~kusto_management_client.models.PrivateLinkResource] + :paramtype value: list[~azure.mgmt.kusto.models.PrivateLinkResource] """ super(PrivateLinkResourceListResult, self).__init__(**kwargs) self.value = value @@ -3575,17 +3568,17 @@ class ReadOnlyFollowingDatabase(Database): :vartype location: str :ivar kind: Required. Kind of the database.Constant filled by server. Possible values include: "ReadWrite", "ReadOnlyFollowing". - :vartype kind: str or ~kusto_management_client.models.Kind + :vartype kind: str or ~azure.mgmt.kusto.models.Kind :ivar provisioning_state: The provisioned state of the resource. Possible values include: "Running", "Creating", "Deleting", "Succeeded", "Failed", "Moving". - :vartype provisioning_state: str or ~kusto_management_client.models.ProvisioningState + :vartype provisioning_state: str or ~azure.mgmt.kusto.models.ProvisioningState :ivar soft_delete_period: The time the data should be kept before it stops being accessible to queries in TimeSpan. :vartype soft_delete_period: ~datetime.timedelta :ivar hot_cache_period: The time the data should be kept in cache for fast queries in TimeSpan. :vartype hot_cache_period: ~datetime.timedelta :ivar statistics: The statistics of the database. - :vartype statistics: ~kusto_management_client.models.DatabaseStatistics + :vartype statistics: ~azure.mgmt.kusto.models.DatabaseStatistics :ivar leader_cluster_resource_id: The name of the leader cluster. :vartype leader_cluster_resource_id: str :ivar attached_database_configuration_name: The name of the attached database configuration @@ -3594,7 +3587,7 @@ class ReadOnlyFollowingDatabase(Database): :ivar principals_modification_kind: The principals modification kind of the database. Possible values include: "Union", "Replace", "None". :vartype principals_modification_kind: str or - ~kusto_management_client.models.PrincipalsModificationKind + ~azure.mgmt.kusto.models.PrincipalsModificationKind """ _validation = { @@ -3669,17 +3662,17 @@ class ReadWriteDatabase(Database): :vartype location: str :ivar kind: Required. Kind of the database.Constant filled by server. Possible values include: "ReadWrite", "ReadOnlyFollowing". - :vartype kind: str or ~kusto_management_client.models.Kind + :vartype kind: str or ~azure.mgmt.kusto.models.Kind :ivar provisioning_state: The provisioned state of the resource. Possible values include: "Running", "Creating", "Deleting", "Succeeded", "Failed", "Moving". - :vartype provisioning_state: str or ~kusto_management_client.models.ProvisioningState + :vartype provisioning_state: str or ~azure.mgmt.kusto.models.ProvisioningState :ivar soft_delete_period: The time the data should be kept before it stops being accessible to queries in TimeSpan. :vartype soft_delete_period: ~datetime.timedelta :ivar hot_cache_period: The time the data should be kept in cache for fast queries in TimeSpan. :vartype hot_cache_period: ~datetime.timedelta :ivar statistics: The statistics of the database. - :vartype statistics: ~kusto_management_client.models.DatabaseStatistics + :vartype statistics: ~azure.mgmt.kusto.models.DatabaseStatistics :ivar is_followed: Indicates whether the database is followed. :vartype is_followed: bool """ @@ -3748,7 +3741,7 @@ class Script(ProxyResource): "Microsoft.Storage/storageAccounts". :vartype type: str :ivar system_data: Metadata pertaining to creation and last modification of the resource. - :vartype system_data: ~kusto_management_client.models.SystemData + :vartype system_data: ~azure.mgmt.kusto.models.SystemData :ivar script_url: The url to the KQL script blob file. Must not be used together with scriptContent property. :vartype script_url: str @@ -3765,7 +3758,7 @@ class Script(ProxyResource): :vartype continue_on_errors: bool :ivar provisioning_state: The provisioned state of the resource. Possible values include: "Running", "Creating", "Deleting", "Succeeded", "Failed", "Moving". - :vartype provisioning_state: str or ~kusto_management_client.models.ProvisioningState + :vartype provisioning_state: str or ~azure.mgmt.kusto.models.ProvisioningState """ _validation = { @@ -3870,7 +3863,7 @@ class ScriptListResult(msrest.serialization.Model): """The list Kusto database script operation response. :ivar value: The list of Kusto scripts. - :vartype value: list[~kusto_management_client.models.Script] + :vartype value: list[~azure.mgmt.kusto.models.Script] """ _attribute_map = { @@ -3885,7 +3878,7 @@ def __init__( ): """ :keyword value: The list of Kusto scripts. - :paramtype value: list[~kusto_management_client.models.Script] + :paramtype value: list[~azure.mgmt.kusto.models.Script] """ super(ScriptListResult, self).__init__(**kwargs) self.value = value @@ -3905,7 +3898,7 @@ class SkuDescription(msrest.serialization.Model): :ivar locations: The set of locations that the SKU is available. :vartype locations: list[str] :ivar location_info: Locations and zones. - :vartype location_info: list[~kusto_management_client.models.SkuLocationInfoItem] + :vartype location_info: list[~azure.mgmt.kusto.models.SkuLocationInfoItem] :ivar restrictions: The restrictions because of which SKU cannot be used. :vartype restrictions: list[any] """ @@ -3949,7 +3942,7 @@ class SkuDescriptionList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: SKU descriptions. - :vartype value: list[~kusto_management_client.models.SkuDescription] + :vartype value: list[~azure.mgmt.kusto.models.SkuDescription] """ _validation = { @@ -4015,14 +4008,14 @@ class SystemData(msrest.serialization.Model): :vartype created_by: str :ivar created_by_type: The type of identity that created the resource. Possible values include: "User", "Application", "ManagedIdentity", "Key". - :vartype created_by_type: str or ~kusto_management_client.models.CreatedByType + :vartype created_by_type: str or ~azure.mgmt.kusto.models.CreatedByType :ivar created_at: The timestamp of resource creation (UTC). :vartype created_at: ~datetime.datetime :ivar last_modified_by: The identity that last modified the resource. :vartype last_modified_by: str :ivar last_modified_by_type: The type of identity that last modified the resource. Possible values include: "User", "Application", "ManagedIdentity", "Key". - :vartype last_modified_by_type: str or ~kusto_management_client.models.CreatedByType + :vartype last_modified_by_type: str or ~azure.mgmt.kusto.models.CreatedByType :ivar last_modified_at: The timestamp of resource last modification (UTC). :vartype last_modified_at: ~datetime.datetime """ @@ -4052,14 +4045,14 @@ def __init__( :paramtype created_by: str :keyword created_by_type: The type of identity that created the resource. Possible values include: "User", "Application", "ManagedIdentity", "Key". - :paramtype created_by_type: str or ~kusto_management_client.models.CreatedByType + :paramtype created_by_type: str or ~azure.mgmt.kusto.models.CreatedByType :keyword created_at: The timestamp of resource creation (UTC). :paramtype created_at: ~datetime.datetime :keyword last_modified_by: The identity that last modified the resource. :paramtype last_modified_by: str :keyword last_modified_by_type: The type of identity that last modified the resource. Possible values include: "User", "Application", "ManagedIdentity", "Key". - :paramtype last_modified_by_type: str or ~kusto_management_client.models.CreatedByType + :paramtype last_modified_by_type: str or ~azure.mgmt.kusto.models.CreatedByType :keyword last_modified_at: The timestamp of resource last modification (UTC). :paramtype last_modified_at: ~datetime.datetime """ diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_attached_database_configurations_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_attached_database_configurations_operations.py index cb1da23eb1c1..478cfbbcf5e3 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_attached_database_configurations_operations.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_attached_database_configurations_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,7 +19,6 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -38,35 +38,35 @@ def build_check_name_availability_request( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2022-02-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurationCheckNameAvailability') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurationCheckNameAvailability") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -79,31 +79,32 @@ def build_list_by_cluster_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-02-01" + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -115,10 +116,11 @@ def build_get_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-02-01" + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), @@ -126,21 +128,21 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -155,12 +157,12 @@ def build_create_or_update_request_initial( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2022-02-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), @@ -168,23 +170,23 @@ def build_create_or_update_request_initial( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -198,10 +200,11 @@ def build_delete_request_initial( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-02-01" + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), @@ -209,21 +212,21 @@ def build_delete_request_initial( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -234,7 +237,7 @@ class AttachedDatabaseConfigurationsOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~kusto_management_client.models + :type models: ~azure.mgmt.kusto.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -265,11 +268,10 @@ def check_name_availability( :param cluster_name: The name of the Kusto cluster. :type cluster_name: str :param resource_name: The name of the resource. - :type resource_name: - ~kusto_management_client.models.AttachedDatabaseConfigurationsCheckNameRequest + :type resource_name: ~azure.mgmt.kusto.models.AttachedDatabaseConfigurationsCheckNameRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: CheckNameResult, or the result of cls(response) - :rtype: ~kusto_management_client.models.CheckNameResult + :rtype: ~azure.mgmt.kusto.models.CheckNameResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameResult"] @@ -278,6 +280,7 @@ def check_name_availability( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(resource_name, 'AttachedDatabaseConfigurationsCheckNameRequest') @@ -286,6 +289,7 @@ def check_name_availability( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self.check_name_availability.metadata['url'], @@ -293,7 +297,11 @@ def check_name_availability( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -307,7 +315,7 @@ def check_name_availability( return deserialized - check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurationCheckNameAvailability'} # type: ignore + check_name_availability.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurationCheckNameAvailability"} # type: ignore @distributed_trace @@ -327,9 +335,11 @@ def list_by_cluster( :return: An iterator like instance of either AttachedDatabaseConfigurationListResult or the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~kusto_management_client.models.AttachedDatabaseConfigurationListResult] + ~azure.core.paging.ItemPaged[~azure.mgmt.kusto.models.AttachedDatabaseConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.AttachedDatabaseConfigurationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -342,6 +352,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_by_cluster.metadata['url'], ) request = _convert_request(request) @@ -353,6 +364,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -370,7 +382,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -383,7 +399,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_cluster.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations'} # type: ignore + list_by_cluster.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations"} # type: ignore @distributed_trace def get( @@ -403,7 +419,7 @@ def get( :type attached_database_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AttachedDatabaseConfiguration, or the result of cls(response) - :rtype: ~kusto_management_client.models.AttachedDatabaseConfiguration + :rtype: ~azure.mgmt.kusto.models.AttachedDatabaseConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AttachedDatabaseConfiguration"] @@ -412,18 +428,25 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, cluster_name=cluster_name, attached_database_configuration_name=attached_database_configuration_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -437,7 +460,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}"} # type: ignore def _create_or_update_initial( @@ -454,6 +477,7 @@ def _create_or_update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'AttachedDatabaseConfiguration') @@ -463,6 +487,7 @@ def _create_or_update_initial( cluster_name=cluster_name, attached_database_configuration_name=attached_database_configuration_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self._create_or_update_initial.metadata['url'], @@ -470,7 +495,11 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201, 202]: @@ -491,7 +520,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}"} # type: ignore @distributed_trace @@ -512,7 +541,7 @@ def begin_create_or_update( :param attached_database_configuration_name: The name of the attached database configuration. :type attached_database_configuration_name: str :param parameters: The database parameters supplied to the CreateOrUpdate operation. - :type parameters: ~kusto_management_client.models.AttachedDatabaseConfiguration + :type parameters: ~azure.mgmt.kusto.models.AttachedDatabaseConfiguration :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -523,12 +552,12 @@ def begin_create_or_update( Retry-After header is present. :return: An instance of LROPoller that returns either AttachedDatabaseConfiguration or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~kusto_management_client.models.AttachedDatabaseConfiguration] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.AttachedDatabaseConfiguration] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.AttachedDatabaseConfiguration"] lro_delay = kwargs.pop( 'polling_interval', @@ -541,6 +570,7 @@ def begin_create_or_update( cluster_name=cluster_name, attached_database_configuration_name=attached_database_configuration_name, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -565,12 +595,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}"} # type: ignore - def _delete_initial( + def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -583,18 +612,25 @@ def _delete_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + request = build_delete_request_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, attached_database_configuration_name=attached_database_configuration_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self._delete_initial.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -604,11 +640,11 @@ def _delete_initial( if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}"} # type: ignore @distributed_trace - def begin_delete( + def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -635,7 +671,8 @@ def begin_delete( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -647,6 +684,7 @@ def begin_delete( resource_group_name=resource_group_name, cluster_name=cluster_name, attached_database_configuration_name=attached_database_configuration_name, + api_version=api_version, cls=lambda x,y,z: x, **kwargs ) @@ -667,7 +705,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}"} # type: ignore diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_cluster_principal_assignments_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_cluster_principal_assignments_operations.py index 36a4aaa8ab2e..76920fe6945b 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_cluster_principal_assignments_operations.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_cluster_principal_assignments_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,7 +19,6 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -38,35 +38,35 @@ def build_check_name_availability_request( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2022-02-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/checkPrincipalAssignmentNameAvailability') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/checkPrincipalAssignmentNameAvailability") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -80,10 +80,11 @@ def build_get_request( principal_assignment_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-02-01" + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), @@ -91,21 +92,21 @@ def build_get_request( "principalAssignmentName": _SERIALIZER.url("principal_assignment_name", principal_assignment_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -120,12 +121,12 @@ def build_create_or_update_request_initial( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2022-02-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), @@ -133,23 +134,23 @@ def build_create_or_update_request_initial( "principalAssignmentName": _SERIALIZER.url("principal_assignment_name", principal_assignment_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -163,10 +164,11 @@ def build_delete_request_initial( principal_assignment_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-02-01" + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), @@ -174,21 +176,21 @@ def build_delete_request_initial( "principalAssignmentName": _SERIALIZER.url("principal_assignment_name", principal_assignment_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -199,31 +201,32 @@ def build_list_request( cluster_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-02-01" + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -234,7 +237,7 @@ class ClusterPrincipalAssignmentsOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~kusto_management_client.models + :type models: ~azure.mgmt.kusto.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -265,10 +268,10 @@ def check_name_availability( :type cluster_name: str :param principal_assignment_name: The name of the principal assignment. :type principal_assignment_name: - ~kusto_management_client.models.ClusterPrincipalAssignmentCheckNameRequest + ~azure.mgmt.kusto.models.ClusterPrincipalAssignmentCheckNameRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: CheckNameResult, or the result of cls(response) - :rtype: ~kusto_management_client.models.CheckNameResult + :rtype: ~azure.mgmt.kusto.models.CheckNameResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameResult"] @@ -277,6 +280,7 @@ def check_name_availability( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(principal_assignment_name, 'ClusterPrincipalAssignmentCheckNameRequest') @@ -285,6 +289,7 @@ def check_name_availability( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self.check_name_availability.metadata['url'], @@ -292,7 +297,11 @@ def check_name_availability( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -306,7 +315,7 @@ def check_name_availability( return deserialized - check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/checkPrincipalAssignmentNameAvailability'} # type: ignore + check_name_availability.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/checkPrincipalAssignmentNameAvailability"} # type: ignore @distributed_trace @@ -327,7 +336,7 @@ def get( :type principal_assignment_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ClusterPrincipalAssignment, or the result of cls(response) - :rtype: ~kusto_management_client.models.ClusterPrincipalAssignment + :rtype: ~azure.mgmt.kusto.models.ClusterPrincipalAssignment :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ClusterPrincipalAssignment"] @@ -336,18 +345,25 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, cluster_name=cluster_name, principal_assignment_name=principal_assignment_name, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -361,7 +377,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}"} # type: ignore def _create_or_update_initial( @@ -378,6 +394,7 @@ def _create_or_update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'ClusterPrincipalAssignment') @@ -387,6 +404,7 @@ def _create_or_update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, principal_assignment_name=principal_assignment_name, + api_version=api_version, content_type=content_type, json=_json, template_url=self._create_or_update_initial.metadata['url'], @@ -394,7 +412,11 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -412,7 +434,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}"} # type: ignore @distributed_trace @@ -434,7 +456,7 @@ def begin_create_or_update( :type principal_assignment_name: str :param parameters: The Kusto cluster principalAssignment's parameters supplied for the operation. - :type parameters: ~kusto_management_client.models.ClusterPrincipalAssignment + :type parameters: ~azure.mgmt.kusto.models.ClusterPrincipalAssignment :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -445,12 +467,12 @@ def begin_create_or_update( Retry-After header is present. :return: An instance of LROPoller that returns either ClusterPrincipalAssignment or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~kusto_management_client.models.ClusterPrincipalAssignment] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.ClusterPrincipalAssignment] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ClusterPrincipalAssignment"] lro_delay = kwargs.pop( 'polling_interval', @@ -463,6 +485,7 @@ def begin_create_or_update( cluster_name=cluster_name, principal_assignment_name=principal_assignment_name, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -487,12 +510,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}"} # type: ignore - def _delete_initial( + def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -505,18 +527,25 @@ def _delete_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, cluster_name=cluster_name, principal_assignment_name=principal_assignment_name, + api_version=api_version, template_url=self._delete_initial.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -526,11 +555,11 @@ def _delete_initial( if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}"} # type: ignore @distributed_trace - def begin_delete( + def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -557,7 +586,8 @@ def begin_delete( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -569,6 +599,7 @@ def begin_delete( resource_group_name=resource_group_name, cluster_name=cluster_name, principal_assignment_name=principal_assignment_name, + api_version=api_version, cls=lambda x,y,z: x, **kwargs ) @@ -589,10 +620,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}"} # type: ignore @distributed_trace def list( @@ -611,9 +641,11 @@ def list( :return: An iterator like instance of either ClusterPrincipalAssignmentListResult or the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~kusto_management_client.models.ClusterPrincipalAssignmentListResult] + ~azure.core.paging.ItemPaged[~azure.mgmt.kusto.models.ClusterPrincipalAssignmentListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ClusterPrincipalAssignmentListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -626,6 +658,7 @@ def prepare_request(next_link=None): subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, cluster_name=cluster_name, + api_version=api_version, template_url=self.list.metadata['url'], ) request = _convert_request(request) @@ -637,6 +670,7 @@ def prepare_request(next_link=None): subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, cluster_name=cluster_name, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -654,7 +688,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -667,4 +705,4 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments"} # type: ignore diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_clusters_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_clusters_operations.py index 149036927b99..f4db79de4f66 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_clusters_operations.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_clusters_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,7 +19,6 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -35,31 +35,32 @@ def build_get_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-02-01" + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -75,39 +76,39 @@ def build_create_or_update_request_initial( if_none_match: Optional[str] = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2022-02-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if if_match is not None: - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if if_none_match is not None: - header_parameters['If-None-Match'] = _SERIALIZER.header("if_none_match", if_none_match, 'str') + _header_parameters['If-None-Match'] = _SERIALIZER.header("if_none_match", if_none_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -124,37 +125,37 @@ def build_update_request_initial( if_match: Optional[str] = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2022-02-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if if_match is not None: - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -167,31 +168,32 @@ def build_delete_request_initial( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-02-01" + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -202,31 +204,32 @@ def build_stop_request_initial( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-02-01" + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/stop') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/stop") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -237,31 +240,32 @@ def build_start_request_initial( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-02-01" + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/start') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/start") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -272,31 +276,32 @@ def build_list_follower_databases_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-02-01" + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/listFollowerDatabases') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/listFollowerDatabases") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -310,35 +315,35 @@ def build_detach_follower_databases_request_initial( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2022-02-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/detachFollowerDatabases') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/detachFollowerDatabases") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -351,31 +356,32 @@ def build_diagnose_virtual_network_request_initial( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-02-01" + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/diagnoseVirtualNetwork') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/diagnoseVirtualNetwork") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -385,30 +391,31 @@ def build_list_by_resource_group_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-02-01" + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -417,29 +424,30 @@ def build_list_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-02-01" + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/clusters') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/clusters") path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -448,29 +456,30 @@ def build_list_skus_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-02-01" + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/skus') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/skus") path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -483,34 +492,34 @@ def build_check_name_availability_request( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2022-02-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/locations/{location}/checkNameAvailability') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/locations/{location}/checkNameAvailability") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), "location": _SERIALIZER.url("location", location, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -523,31 +532,32 @@ def build_list_skus_by_resource_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-02-01" + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/skus') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/skus") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -558,31 +568,32 @@ def build_list_outbound_network_dependencies_endpoints_request( cluster_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-02-01" + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/outboundNetworkDependenciesEndpoints') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/outboundNetworkDependenciesEndpoints") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -593,31 +604,32 @@ def build_list_language_extensions_request( cluster_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-02-01" + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/listLanguageExtensions') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/listLanguageExtensions") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -631,35 +643,35 @@ def build_add_language_extensions_request_initial( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2022-02-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/addLanguageExtensions') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/addLanguageExtensions") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -675,48 +687,48 @@ def build_remove_language_extensions_request_initial( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2022-02-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/removeLanguageExtensions') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/removeLanguageExtensions") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs ) -class ClustersOperations(object): +class ClustersOperations(object): # pylint: disable=too-many-public-methods """ClustersOperations operations. You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~kusto_management_client.models + :type models: ~azure.mgmt.kusto.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -746,7 +758,7 @@ def get( :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Cluster, or the result of cls(response) - :rtype: ~kusto_management_client.models.Cluster + :rtype: ~azure.mgmt.kusto.models.Cluster :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Cluster"] @@ -755,17 +767,24 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -779,7 +798,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}"} # type: ignore def _create_or_update_initial( @@ -797,6 +816,7 @@ def _create_or_update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'Cluster') @@ -805,6 +825,7 @@ def _create_or_update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -814,7 +835,11 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -832,7 +857,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}"} # type: ignore @distributed_trace @@ -852,13 +877,14 @@ def begin_create_or_update( :param cluster_name: The name of the Kusto cluster. :type cluster_name: str :param parameters: The Kusto cluster parameters supplied to the CreateOrUpdate operation. - :type parameters: ~kusto_management_client.models.Cluster + :type parameters: ~azure.mgmt.kusto.models.Cluster :param if_match: The ETag of the cluster. Omit this value to always overwrite the current cluster. Specify the last-seen ETag value to prevent accidentally overwriting concurrent - changes. + changes. Default value is None. :type if_match: str :param if_none_match: Set to '*' to allow a new cluster to be created, but to prevent updating - an existing cluster. Other values will result in a 412 Pre-condition Failed response. + an existing cluster. Other values will result in a 412 Pre-condition Failed response. Default + value is None. :type if_none_match: 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. @@ -869,11 +895,12 @@ def begin_create_or_update( :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 Cluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~kusto_management_client.models.Cluster] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.Cluster] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Cluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -887,6 +914,7 @@ def begin_create_or_update( parameters=parameters, if_match=if_match, if_none_match=if_none_match, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -911,10 +939,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}"} # type: ignore def _update_initial( self, @@ -930,6 +957,7 @@ def _update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'ClusterUpdate') @@ -938,6 +966,7 @@ def _update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -946,7 +975,11 @@ def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201, 202]: @@ -972,7 +1005,7 @@ def _update_initial( return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} # type: ignore + _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}"} # type: ignore @distributed_trace @@ -991,10 +1024,10 @@ def begin_update( :param cluster_name: The name of the Kusto cluster. :type cluster_name: str :param parameters: The Kusto cluster parameters supplied to the Update operation. - :type parameters: ~kusto_management_client.models.ClusterUpdate + :type parameters: ~azure.mgmt.kusto.models.ClusterUpdate :param if_match: The ETag of the cluster. Omit this value to always overwrite the current cluster. Specify the last-seen ETag value to prevent accidentally overwriting concurrent - changes. + changes. Default value is None. :type if_match: 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. @@ -1005,11 +1038,12 @@ def begin_update( :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 Cluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~kusto_management_client.models.Cluster] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.Cluster] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Cluster"] lro_delay = kwargs.pop( 'polling_interval', @@ -1022,6 +1056,7 @@ def begin_update( cluster_name=cluster_name, parameters=parameters, if_match=if_match, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -1046,12 +1081,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} # type: ignore + begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}"} # type: ignore - def _delete_initial( + def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -1063,17 +1097,24 @@ def _delete_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + request = build_delete_request_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self._delete_initial.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -1083,11 +1124,11 @@ def _delete_initial( if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}"} # type: ignore @distributed_trace - def begin_delete( + def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -1111,7 +1152,8 @@ def begin_delete( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1122,6 +1164,7 @@ def begin_delete( raw_result = self._delete_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, + api_version=api_version, cls=lambda x,y,z: x, **kwargs ) @@ -1142,12 +1185,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}"} # type: ignore - def _stop_initial( + def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -1159,17 +1201,24 @@ def _stop_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + request = build_stop_request_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self._stop_initial.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -1179,11 +1228,11 @@ def _stop_initial( if cls: return cls(pipeline_response, None, {}) - _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/stop'} # type: ignore + _stop_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/stop"} # type: ignore @distributed_trace - def begin_stop( + def begin_stop( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -1207,7 +1256,8 @@ def begin_stop( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1218,6 +1268,7 @@ def begin_stop( raw_result = self._stop_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, + api_version=api_version, cls=lambda x,y,z: x, **kwargs ) @@ -1238,12 +1289,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/stop'} # type: ignore + begin_stop.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/stop"} # type: ignore - def _start_initial( + def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -1255,17 +1305,24 @@ def _start_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + request = build_start_request_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self._start_initial.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -1275,11 +1332,11 @@ def _start_initial( if cls: return cls(pipeline_response, None, {}) - _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/start'} # type: ignore + _start_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/start"} # type: ignore @distributed_trace - def begin_start( + def begin_start( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -1303,7 +1360,8 @@ def begin_start( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1314,6 +1372,7 @@ def begin_start( raw_result = self._start_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, + api_version=api_version, cls=lambda x,y,z: x, **kwargs ) @@ -1334,10 +1393,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/start'} # type: ignore + begin_start.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/start"} # type: ignore @distributed_trace def list_follower_databases( @@ -1356,10 +1414,11 @@ def list_follower_databases( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either FollowerDatabaseListResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~kusto_management_client.models.FollowerDatabaseListResult] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kusto.models.FollowerDatabaseListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.FollowerDatabaseListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -1372,6 +1431,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_follower_databases.metadata['url'], ) request = _convert_request(request) @@ -1383,6 +1443,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -1400,7 +1461,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1413,9 +1478,9 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_follower_databases.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/listFollowerDatabases'} # type: ignore + list_follower_databases.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/listFollowerDatabases"} # type: ignore - def _detach_follower_databases_initial( + def _detach_follower_databases_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -1428,6 +1493,7 @@ def _detach_follower_databases_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(follower_database_to_remove, 'FollowerDatabaseDefinition') @@ -1436,6 +1502,7 @@ def _detach_follower_databases_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self._detach_follower_databases_initial.metadata['url'], @@ -1443,7 +1510,11 @@ def _detach_follower_databases_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -1453,11 +1524,11 @@ def _detach_follower_databases_initial( if cls: return cls(pipeline_response, None, {}) - _detach_follower_databases_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/detachFollowerDatabases'} # type: ignore + _detach_follower_databases_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/detachFollowerDatabases"} # type: ignore @distributed_trace - def begin_detach_follower_databases( + def begin_detach_follower_databases( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -1471,7 +1542,7 @@ def begin_detach_follower_databases( :param cluster_name: The name of the Kusto cluster. :type cluster_name: str :param follower_database_to_remove: The follower databases properties to remove. - :type follower_database_to_remove: ~kusto_management_client.models.FollowerDatabaseDefinition + :type follower_database_to_remove: ~azure.mgmt.kusto.models.FollowerDatabaseDefinition :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -1484,8 +1555,9 @@ def begin_detach_follower_databases( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1497,6 +1569,7 @@ def begin_detach_follower_databases( resource_group_name=resource_group_name, cluster_name=cluster_name, follower_database_to_remove=follower_database_to_remove, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -1518,10 +1591,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_detach_follower_databases.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/detachFollowerDatabases'} # type: ignore + begin_detach_follower_databases.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/detachFollowerDatabases"} # type: ignore def _diagnose_virtual_network_initial( self, @@ -1535,17 +1607,24 @@ def _diagnose_virtual_network_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + request = build_diagnose_virtual_network_request_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self._diagnose_virtual_network_initial.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -1561,7 +1640,7 @@ def _diagnose_virtual_network_initial( return deserialized - _diagnose_virtual_network_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/diagnoseVirtualNetwork'} # type: ignore + _diagnose_virtual_network_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/diagnoseVirtualNetwork"} # type: ignore @distributed_trace @@ -1588,11 +1667,11 @@ def begin_diagnose_virtual_network( Retry-After header is present. :return: An instance of LROPoller that returns either DiagnoseVirtualNetworkResult or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~kusto_management_client.models.DiagnoseVirtualNetworkResult] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.DiagnoseVirtualNetworkResult] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnoseVirtualNetworkResult"] lro_delay = kwargs.pop( 'polling_interval', @@ -1603,6 +1682,7 @@ def begin_diagnose_virtual_network( raw_result = self._diagnose_virtual_network_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, + api_version=api_version, cls=lambda x,y,z: x, **kwargs ) @@ -1626,10 +1706,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_diagnose_virtual_network.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/diagnoseVirtualNetwork'} # type: ignore + begin_diagnose_virtual_network.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/diagnoseVirtualNetwork"} # type: ignore @distributed_trace def list_by_resource_group( @@ -1643,9 +1722,11 @@ 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 ClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~kusto_management_client.models.ClusterListResult] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kusto.models.ClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ClusterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -1657,6 +1738,7 @@ def prepare_request(next_link=None): request = build_list_by_resource_group_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_by_resource_group.metadata['url'], ) request = _convert_request(request) @@ -1667,6 +1749,7 @@ def prepare_request(next_link=None): request = build_list_by_resource_group_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -1684,7 +1767,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1697,7 +1784,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters'} # type: ignore + list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters"} # type: ignore @distributed_trace def list( @@ -1708,9 +1795,11 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~kusto_management_client.models.ClusterListResult] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kusto.models.ClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ClusterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -1721,6 +1810,7 @@ def prepare_request(next_link=None): request = build_list_request( subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list.metadata['url'], ) request = _convert_request(request) @@ -1730,6 +1820,7 @@ def prepare_request(next_link=None): request = build_list_request( subscription_id=self._config.subscription_id, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -1747,7 +1838,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1760,7 +1855,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/clusters'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/clusters"} # type: ignore @distributed_trace def list_skus( @@ -1771,9 +1866,11 @@ def list_skus( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SkuDescriptionList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~kusto_management_client.models.SkuDescriptionList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kusto.models.SkuDescriptionList] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuDescriptionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -1784,6 +1881,7 @@ def prepare_request(next_link=None): request = build_list_skus_request( subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_skus.metadata['url'], ) request = _convert_request(request) @@ -1793,6 +1891,7 @@ def prepare_request(next_link=None): request = build_list_skus_request( subscription_id=self._config.subscription_id, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -1810,7 +1909,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1823,7 +1926,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_skus.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/skus'} # type: ignore + list_skus.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/skus"} # type: ignore @distributed_trace def check_name_availability( @@ -1837,10 +1940,10 @@ def check_name_availability( :param location: Azure location (region) name. :type location: str :param cluster_name: The name of the cluster. - :type cluster_name: ~kusto_management_client.models.ClusterCheckNameRequest + :type cluster_name: ~azure.mgmt.kusto.models.ClusterCheckNameRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: CheckNameResult, or the result of cls(response) - :rtype: ~kusto_management_client.models.CheckNameResult + :rtype: ~azure.mgmt.kusto.models.CheckNameResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameResult"] @@ -1849,6 +1952,7 @@ def check_name_availability( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(cluster_name, 'ClusterCheckNameRequest') @@ -1856,6 +1960,7 @@ def check_name_availability( request = build_check_name_availability_request( subscription_id=self._config.subscription_id, location=location, + api_version=api_version, content_type=content_type, json=_json, template_url=self.check_name_availability.metadata['url'], @@ -1863,7 +1968,11 @@ def check_name_availability( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1877,7 +1986,7 @@ def check_name_availability( return deserialized - check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/locations/{location}/checkNameAvailability'} # type: ignore + check_name_availability.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/locations/{location}/checkNameAvailability"} # type: ignore @distributed_trace @@ -1896,9 +2005,11 @@ def list_skus_by_resource( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ListResourceSkusResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~kusto_management_client.models.ListResourceSkusResult] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kusto.models.ListResourceSkusResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListResourceSkusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -1911,6 +2022,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_skus_by_resource.metadata['url'], ) request = _convert_request(request) @@ -1922,6 +2034,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -1939,7 +2052,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1952,7 +2069,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_skus_by_resource.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/skus'} # type: ignore + list_skus_by_resource.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/skus"} # type: ignore @distributed_trace def list_outbound_network_dependencies_endpoints( @@ -1971,9 +2088,11 @@ def list_outbound_network_dependencies_endpoints( :return: An iterator like instance of either OutboundNetworkDependenciesEndpointListResult or the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~kusto_management_client.models.OutboundNetworkDependenciesEndpointListResult] + ~azure.core.paging.ItemPaged[~azure.mgmt.kusto.models.OutboundNetworkDependenciesEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundNetworkDependenciesEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -1986,6 +2105,7 @@ def prepare_request(next_link=None): subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, cluster_name=cluster_name, + api_version=api_version, template_url=self.list_outbound_network_dependencies_endpoints.metadata['url'], ) request = _convert_request(request) @@ -1997,6 +2117,7 @@ def prepare_request(next_link=None): subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, cluster_name=cluster_name, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -2014,7 +2135,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -2027,7 +2152,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_outbound_network_dependencies_endpoints.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/outboundNetworkDependenciesEndpoints'} # type: ignore + list_outbound_network_dependencies_endpoints.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/outboundNetworkDependenciesEndpoints"} # type: ignore @distributed_trace def list_language_extensions( @@ -2045,9 +2170,11 @@ def list_language_extensions( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either LanguageExtensionsList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~kusto_management_client.models.LanguageExtensionsList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kusto.models.LanguageExtensionsList] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.LanguageExtensionsList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -2060,6 +2187,7 @@ def prepare_request(next_link=None): subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, cluster_name=cluster_name, + api_version=api_version, template_url=self.list_language_extensions.metadata['url'], ) request = _convert_request(request) @@ -2071,6 +2199,7 @@ def prepare_request(next_link=None): subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, cluster_name=cluster_name, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -2088,7 +2217,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -2101,9 +2234,9 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_language_extensions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/listLanguageExtensions'} # type: ignore + list_language_extensions.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/listLanguageExtensions"} # type: ignore - def _add_language_extensions_initial( + def _add_language_extensions_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -2116,6 +2249,7 @@ def _add_language_extensions_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(language_extensions_to_add, 'LanguageExtensionsList') @@ -2124,6 +2258,7 @@ def _add_language_extensions_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, cluster_name=cluster_name, + api_version=api_version, content_type=content_type, json=_json, template_url=self._add_language_extensions_initial.metadata['url'], @@ -2131,7 +2266,11 @@ def _add_language_extensions_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -2141,11 +2280,11 @@ def _add_language_extensions_initial( if cls: return cls(pipeline_response, None, {}) - _add_language_extensions_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/addLanguageExtensions'} # type: ignore + _add_language_extensions_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/addLanguageExtensions"} # type: ignore @distributed_trace - def begin_add_language_extensions( + def begin_add_language_extensions( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -2159,7 +2298,7 @@ def begin_add_language_extensions( :param cluster_name: The name of the Kusto cluster. :type cluster_name: str :param language_extensions_to_add: The language extensions to add. - :type language_extensions_to_add: ~kusto_management_client.models.LanguageExtensionsList + :type language_extensions_to_add: ~azure.mgmt.kusto.models.LanguageExtensionsList :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -2172,8 +2311,9 @@ def begin_add_language_extensions( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -2185,6 +2325,7 @@ def begin_add_language_extensions( resource_group_name=resource_group_name, cluster_name=cluster_name, language_extensions_to_add=language_extensions_to_add, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -2206,12 +2347,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_add_language_extensions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/addLanguageExtensions'} # type: ignore + begin_add_language_extensions.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/addLanguageExtensions"} # type: ignore - def _remove_language_extensions_initial( + def _remove_language_extensions_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -2224,6 +2364,7 @@ def _remove_language_extensions_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(language_extensions_to_remove, 'LanguageExtensionsList') @@ -2232,6 +2373,7 @@ def _remove_language_extensions_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, cluster_name=cluster_name, + api_version=api_version, content_type=content_type, json=_json, template_url=self._remove_language_extensions_initial.metadata['url'], @@ -2239,7 +2381,11 @@ def _remove_language_extensions_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -2249,11 +2395,11 @@ def _remove_language_extensions_initial( if cls: return cls(pipeline_response, None, {}) - _remove_language_extensions_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/removeLanguageExtensions'} # type: ignore + _remove_language_extensions_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/removeLanguageExtensions"} # type: ignore @distributed_trace - def begin_remove_language_extensions( + def begin_remove_language_extensions( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -2267,7 +2413,7 @@ def begin_remove_language_extensions( :param cluster_name: The name of the Kusto cluster. :type cluster_name: str :param language_extensions_to_remove: The language extensions to remove. - :type language_extensions_to_remove: ~kusto_management_client.models.LanguageExtensionsList + :type language_extensions_to_remove: ~azure.mgmt.kusto.models.LanguageExtensionsList :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -2280,8 +2426,9 @@ def begin_remove_language_extensions( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -2293,6 +2440,7 @@ def begin_remove_language_extensions( resource_group_name=resource_group_name, cluster_name=cluster_name, language_extensions_to_remove=language_extensions_to_remove, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -2314,7 +2462,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_remove_language_extensions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/removeLanguageExtensions'} # type: ignore + begin_remove_language_extensions.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/removeLanguageExtensions"} # type: ignore diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_data_connections_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_data_connections_operations.py index 91cb375b9c78..fa02b9728218 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_data_connections_operations.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_data_connections_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,7 +19,6 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -36,10 +36,11 @@ def build_list_by_database_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-02-01" + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), @@ -47,21 +48,21 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -76,12 +77,12 @@ def build_data_connection_validation_request_initial( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2022-02-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnectionValidation') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnectionValidation") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), @@ -89,23 +90,23 @@ def build_data_connection_validation_request_initial( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -122,12 +123,12 @@ def build_check_name_availability_request( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2022-02-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/checkNameAvailability') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/checkNameAvailability") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), @@ -135,23 +136,23 @@ def build_check_name_availability_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -166,10 +167,11 @@ def build_get_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-02-01" + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), @@ -178,21 +180,21 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -208,12 +210,12 @@ def build_create_or_update_request_initial( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2022-02-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), @@ -222,23 +224,23 @@ def build_create_or_update_request_initial( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -256,12 +258,12 @@ def build_update_request_initial( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2022-02-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), @@ -270,23 +272,23 @@ def build_update_request_initial( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -301,10 +303,11 @@ def build_delete_request_initial( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-02-01" + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), @@ -313,21 +316,21 @@ def build_delete_request_initial( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -338,7 +341,7 @@ class DataConnectionsOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~kusto_management_client.models + :type models: ~azure.mgmt.kusto.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -372,9 +375,11 @@ def list_by_database( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DataConnectionListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~kusto_management_client.models.DataConnectionListResult] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kusto.models.DataConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.DataConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -388,6 +393,7 @@ def prepare_request(next_link=None): cluster_name=cluster_name, database_name=database_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_by_database.metadata['url'], ) request = _convert_request(request) @@ -400,6 +406,7 @@ def prepare_request(next_link=None): cluster_name=cluster_name, database_name=database_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -417,7 +424,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -430,7 +441,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections'} # type: ignore + list_by_database.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections"} # type: ignore def _data_connection_validation_initial( self, @@ -446,6 +457,7 @@ def _data_connection_validation_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'DataConnectionValidation') @@ -455,6 +467,7 @@ def _data_connection_validation_initial( cluster_name=cluster_name, database_name=database_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self._data_connection_validation_initial.metadata['url'], @@ -462,7 +475,11 @@ def _data_connection_validation_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -478,7 +495,7 @@ def _data_connection_validation_initial( return deserialized - _data_connection_validation_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnectionValidation'} # type: ignore + _data_connection_validation_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnectionValidation"} # type: ignore @distributed_trace @@ -499,7 +516,7 @@ def begin_data_connection_validation( :param database_name: The name of the database in the Kusto cluster. :type database_name: str :param parameters: The data connection parameters supplied to the CreateOrUpdate operation. - :type parameters: ~kusto_management_client.models.DataConnectionValidation + :type parameters: ~azure.mgmt.kusto.models.DataConnectionValidation :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -511,11 +528,12 @@ def begin_data_connection_validation( :return: An instance of LROPoller that returns either DataConnectionValidationListResult or the result of cls(response) :rtype: - ~azure.core.polling.LROPoller[~kusto_management_client.models.DataConnectionValidationListResult] + ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.DataConnectionValidationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.DataConnectionValidationListResult"] lro_delay = kwargs.pop( 'polling_interval', @@ -528,6 +546,7 @@ def begin_data_connection_validation( cluster_name=cluster_name, database_name=database_name, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -552,10 +571,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_data_connection_validation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnectionValidation'} # type: ignore + begin_data_connection_validation.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnectionValidation"} # type: ignore @distributed_trace def check_name_availability( @@ -575,10 +593,10 @@ def check_name_availability( :param database_name: The name of the database in the Kusto cluster. :type database_name: str :param data_connection_name: The name of the data connection. - :type data_connection_name: ~kusto_management_client.models.DataConnectionCheckNameRequest + :type data_connection_name: ~azure.mgmt.kusto.models.DataConnectionCheckNameRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: CheckNameResult, or the result of cls(response) - :rtype: ~kusto_management_client.models.CheckNameResult + :rtype: ~azure.mgmt.kusto.models.CheckNameResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameResult"] @@ -587,6 +605,7 @@ def check_name_availability( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(data_connection_name, 'DataConnectionCheckNameRequest') @@ -596,6 +615,7 @@ def check_name_availability( cluster_name=cluster_name, database_name=database_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self.check_name_availability.metadata['url'], @@ -603,7 +623,11 @@ def check_name_availability( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -617,7 +641,7 @@ def check_name_availability( return deserialized - check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/checkNameAvailability'} # type: ignore + check_name_availability.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/checkNameAvailability"} # type: ignore @distributed_trace @@ -641,7 +665,7 @@ def get( :type data_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DataConnection, or the result of cls(response) - :rtype: ~kusto_management_client.models.DataConnection + :rtype: ~azure.mgmt.kusto.models.DataConnection :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DataConnection"] @@ -650,6 +674,8 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, @@ -657,12 +683,17 @@ def get( database_name=database_name, data_connection_name=data_connection_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -676,7 +707,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}"} # type: ignore def _create_or_update_initial( @@ -694,6 +725,7 @@ def _create_or_update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'DataConnection') @@ -704,6 +736,7 @@ def _create_or_update_initial( database_name=database_name, data_connection_name=data_connection_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self._create_or_update_initial.metadata['url'], @@ -711,7 +744,11 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201, 202]: @@ -732,7 +769,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}"} # type: ignore @distributed_trace @@ -756,7 +793,7 @@ def begin_create_or_update( :param data_connection_name: The name of the data connection. :type data_connection_name: str :param parameters: The data connection parameters supplied to the CreateOrUpdate operation. - :type parameters: ~kusto_management_client.models.DataConnection + :type parameters: ~azure.mgmt.kusto.models.DataConnection :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -767,11 +804,12 @@ def begin_create_or_update( Retry-After header is present. :return: An instance of LROPoller that returns either DataConnection or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~kusto_management_client.models.DataConnection] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.DataConnection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.DataConnection"] lro_delay = kwargs.pop( 'polling_interval', @@ -785,6 +823,7 @@ def begin_create_or_update( database_name=database_name, data_connection_name=data_connection_name, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -809,10 +848,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}"} # type: ignore def _update_initial( self, @@ -829,6 +867,7 @@ def _update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'DataConnection') @@ -839,6 +878,7 @@ def _update_initial( database_name=database_name, data_connection_name=data_connection_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self._update_initial.metadata['url'], @@ -846,7 +886,11 @@ def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201, 202]: @@ -872,7 +916,7 @@ def _update_initial( return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} # type: ignore + _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}"} # type: ignore @distributed_trace @@ -896,7 +940,7 @@ def begin_update( :param data_connection_name: The name of the data connection. :type data_connection_name: str :param parameters: The data connection parameters supplied to the Update operation. - :type parameters: ~kusto_management_client.models.DataConnection + :type parameters: ~azure.mgmt.kusto.models.DataConnection :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -907,11 +951,12 @@ def begin_update( Retry-After header is present. :return: An instance of LROPoller that returns either DataConnection or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~kusto_management_client.models.DataConnection] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.DataConnection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.DataConnection"] lro_delay = kwargs.pop( 'polling_interval', @@ -925,6 +970,7 @@ def begin_update( database_name=database_name, data_connection_name=data_connection_name, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -949,12 +995,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} # type: ignore + begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}"} # type: ignore - def _delete_initial( + def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -968,6 +1013,8 @@ def _delete_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + request = build_delete_request_initial( resource_group_name=resource_group_name, @@ -975,12 +1022,17 @@ def _delete_initial( database_name=database_name, data_connection_name=data_connection_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self._delete_initial.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -990,11 +1042,11 @@ def _delete_initial( if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}"} # type: ignore @distributed_trace - def begin_delete( + def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -1024,7 +1076,8 @@ def begin_delete( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1037,6 +1090,7 @@ def begin_delete( cluster_name=cluster_name, database_name=database_name, data_connection_name=data_connection_name, + api_version=api_version, cls=lambda x,y,z: x, **kwargs ) @@ -1057,7 +1111,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}"} # type: ignore diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_database_principal_assignments_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_database_principal_assignments_operations.py index 10a428da89bf..ce34d7f3cedd 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_database_principal_assignments_operations.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_database_principal_assignments_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,7 +19,6 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -39,12 +39,12 @@ def build_check_name_availability_request( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2022-02-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/checkPrincipalAssignmentNameAvailability') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/checkPrincipalAssignmentNameAvailability") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), @@ -52,23 +52,23 @@ def build_check_name_availability_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -83,10 +83,11 @@ def build_get_request( principal_assignment_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-02-01" + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), @@ -95,21 +96,21 @@ def build_get_request( "principalAssignmentName": _SERIALIZER.url("principal_assignment_name", principal_assignment_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -125,12 +126,12 @@ def build_create_or_update_request_initial( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2022-02-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), @@ -139,23 +140,23 @@ def build_create_or_update_request_initial( "principalAssignmentName": _SERIALIZER.url("principal_assignment_name", principal_assignment_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -170,10 +171,11 @@ def build_delete_request_initial( principal_assignment_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-02-01" + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), @@ -182,21 +184,21 @@ def build_delete_request_initial( "principalAssignmentName": _SERIALIZER.url("principal_assignment_name", principal_assignment_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -208,10 +210,11 @@ def build_list_request( database_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-02-01" + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), @@ -219,21 +222,21 @@ def build_list_request( "databaseName": _SERIALIZER.url("database_name", database_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -244,7 +247,7 @@ class DatabasePrincipalAssignmentsOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~kusto_management_client.models + :type models: ~azure.mgmt.kusto.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -278,10 +281,10 @@ def check_name_availability( :type database_name: str :param principal_assignment_name: The name of the resource. :type principal_assignment_name: - ~kusto_management_client.models.DatabasePrincipalAssignmentCheckNameRequest + ~azure.mgmt.kusto.models.DatabasePrincipalAssignmentCheckNameRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: CheckNameResult, or the result of cls(response) - :rtype: ~kusto_management_client.models.CheckNameResult + :rtype: ~azure.mgmt.kusto.models.CheckNameResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameResult"] @@ -290,6 +293,7 @@ def check_name_availability( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(principal_assignment_name, 'DatabasePrincipalAssignmentCheckNameRequest') @@ -299,6 +303,7 @@ def check_name_availability( cluster_name=cluster_name, database_name=database_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self.check_name_availability.metadata['url'], @@ -306,7 +311,11 @@ def check_name_availability( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -320,7 +329,7 @@ def check_name_availability( return deserialized - check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/checkPrincipalAssignmentNameAvailability'} # type: ignore + check_name_availability.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/checkPrincipalAssignmentNameAvailability"} # type: ignore @distributed_trace @@ -344,7 +353,7 @@ def get( :type principal_assignment_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DatabasePrincipalAssignment, or the result of cls(response) - :rtype: ~kusto_management_client.models.DatabasePrincipalAssignment + :rtype: ~azure.mgmt.kusto.models.DatabasePrincipalAssignment :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DatabasePrincipalAssignment"] @@ -353,6 +362,8 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + request = build_get_request( subscription_id=self._config.subscription_id, @@ -360,12 +371,17 @@ def get( cluster_name=cluster_name, database_name=database_name, principal_assignment_name=principal_assignment_name, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -379,7 +395,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}"} # type: ignore def _create_or_update_initial( @@ -397,6 +413,7 @@ def _create_or_update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'DatabasePrincipalAssignment') @@ -407,6 +424,7 @@ def _create_or_update_initial( cluster_name=cluster_name, database_name=database_name, principal_assignment_name=principal_assignment_name, + api_version=api_version, content_type=content_type, json=_json, template_url=self._create_or_update_initial.metadata['url'], @@ -414,7 +432,11 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -432,7 +454,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}"} # type: ignore @distributed_trace @@ -456,7 +478,7 @@ def begin_create_or_update( :param principal_assignment_name: The name of the Kusto principalAssignment. :type principal_assignment_name: str :param parameters: The Kusto principalAssignments parameters supplied for the operation. - :type parameters: ~kusto_management_client.models.DatabasePrincipalAssignment + :type parameters: ~azure.mgmt.kusto.models.DatabasePrincipalAssignment :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -467,12 +489,12 @@ def begin_create_or_update( Retry-After header is present. :return: An instance of LROPoller that returns either DatabasePrincipalAssignment or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~kusto_management_client.models.DatabasePrincipalAssignment] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.DatabasePrincipalAssignment] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.DatabasePrincipalAssignment"] lro_delay = kwargs.pop( 'polling_interval', @@ -486,6 +508,7 @@ def begin_create_or_update( database_name=database_name, principal_assignment_name=principal_assignment_name, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -510,12 +533,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}"} # type: ignore - def _delete_initial( + def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -529,6 +551,8 @@ def _delete_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -536,12 +560,17 @@ def _delete_initial( cluster_name=cluster_name, database_name=database_name, principal_assignment_name=principal_assignment_name, + api_version=api_version, template_url=self._delete_initial.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -551,11 +580,11 @@ def _delete_initial( if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}"} # type: ignore @distributed_trace - def begin_delete( + def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -585,7 +614,8 @@ def begin_delete( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -598,6 +628,7 @@ def begin_delete( cluster_name=cluster_name, database_name=database_name, principal_assignment_name=principal_assignment_name, + api_version=api_version, cls=lambda x,y,z: x, **kwargs ) @@ -618,10 +649,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}"} # type: ignore @distributed_trace def list( @@ -643,9 +673,11 @@ def list( :return: An iterator like instance of either DatabasePrincipalAssignmentListResult or the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~kusto_management_client.models.DatabasePrincipalAssignmentListResult] + ~azure.core.paging.ItemPaged[~azure.mgmt.kusto.models.DatabasePrincipalAssignmentListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.DatabasePrincipalAssignmentListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -659,6 +691,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, cluster_name=cluster_name, database_name=database_name, + api_version=api_version, template_url=self.list.metadata['url'], ) request = _convert_request(request) @@ -671,6 +704,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, cluster_name=cluster_name, database_name=database_name, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -688,7 +722,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -701,4 +739,4 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments"} # type: ignore diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_databases_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_databases_operations.py index 0a5df2ad0f32..5a7fdcb46f1b 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_databases_operations.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_databases_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,7 +19,6 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -38,35 +38,35 @@ def build_check_name_availability_request( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2022-02-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/checkNameAvailability') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/checkNameAvailability") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -79,31 +79,32 @@ def build_list_by_cluster_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-02-01" + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -115,10 +116,11 @@ def build_get_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-02-01" + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), @@ -126,21 +128,21 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -155,12 +157,12 @@ def build_create_or_update_request_initial( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2022-02-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), @@ -168,23 +170,23 @@ def build_create_or_update_request_initial( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -201,12 +203,12 @@ def build_update_request_initial( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2022-02-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), @@ -214,23 +216,23 @@ def build_update_request_initial( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -244,10 +246,11 @@ def build_delete_request_initial( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-02-01" + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), @@ -255,21 +258,21 @@ def build_delete_request_initial( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -281,10 +284,11 @@ def build_list_principals_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-02-01" + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/listPrincipals') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/listPrincipals") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), @@ -292,21 +296,21 @@ def build_list_principals_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -321,12 +325,12 @@ def build_add_principals_request( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2022-02-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/addPrincipals') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/addPrincipals") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), @@ -334,23 +338,23 @@ def build_add_principals_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -367,12 +371,12 @@ def build_remove_principals_request( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2022-02-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/removePrincipals') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/removePrincipals") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), @@ -380,23 +384,23 @@ def build_remove_principals_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -409,7 +413,7 @@ class DatabasesOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~kusto_management_client.models + :type models: ~azure.mgmt.kusto.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -439,10 +443,10 @@ def check_name_availability( :param cluster_name: The name of the Kusto cluster. :type cluster_name: str :param resource_name: The name of the resource. - :type resource_name: ~kusto_management_client.models.CheckNameRequest + :type resource_name: ~azure.mgmt.kusto.models.CheckNameRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: CheckNameResult, or the result of cls(response) - :rtype: ~kusto_management_client.models.CheckNameResult + :rtype: ~azure.mgmt.kusto.models.CheckNameResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameResult"] @@ -451,6 +455,7 @@ def check_name_availability( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(resource_name, 'CheckNameRequest') @@ -459,6 +464,7 @@ def check_name_availability( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self.check_name_availability.metadata['url'], @@ -466,7 +472,11 @@ def check_name_availability( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -480,7 +490,7 @@ def check_name_availability( return deserialized - check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/checkNameAvailability'} # type: ignore + check_name_availability.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/checkNameAvailability"} # type: ignore @distributed_trace @@ -498,9 +508,11 @@ def list_by_cluster( :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DatabaseListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~kusto_management_client.models.DatabaseListResult] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kusto.models.DatabaseListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.DatabaseListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -513,6 +525,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_by_cluster.metadata['url'], ) request = _convert_request(request) @@ -524,6 +537,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -541,7 +555,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -554,7 +572,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_cluster.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases'} # type: ignore + list_by_cluster.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases"} # type: ignore @distributed_trace def get( @@ -574,7 +592,7 @@ def get( :type database_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Database, or the result of cls(response) - :rtype: ~kusto_management_client.models.Database + :rtype: ~azure.mgmt.kusto.models.Database :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Database"] @@ -583,18 +601,25 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, cluster_name=cluster_name, database_name=database_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -608,7 +633,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}"} # type: ignore def _create_or_update_initial( @@ -625,6 +650,7 @@ def _create_or_update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'Database') @@ -634,6 +660,7 @@ def _create_or_update_initial( cluster_name=cluster_name, database_name=database_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self._create_or_update_initial.metadata['url'], @@ -641,7 +668,11 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201, 202]: @@ -662,7 +693,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}"} # type: ignore @distributed_trace @@ -683,7 +714,7 @@ def begin_create_or_update( :param database_name: The name of the database in the Kusto cluster. :type database_name: str :param parameters: The database parameters supplied to the CreateOrUpdate operation. - :type parameters: ~kusto_management_client.models.Database + :type parameters: ~azure.mgmt.kusto.models.Database :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -693,11 +724,12 @@ def begin_create_or_update( :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 Database or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~kusto_management_client.models.Database] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.Database] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Database"] lro_delay = kwargs.pop( 'polling_interval', @@ -710,6 +742,7 @@ def begin_create_or_update( cluster_name=cluster_name, database_name=database_name, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -734,10 +767,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}"} # type: ignore def _update_initial( self, @@ -753,6 +785,7 @@ def _update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'Database') @@ -762,6 +795,7 @@ def _update_initial( cluster_name=cluster_name, database_name=database_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self._update_initial.metadata['url'], @@ -769,7 +803,11 @@ def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201, 202]: @@ -795,7 +833,7 @@ def _update_initial( return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} # type: ignore + _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}"} # type: ignore @distributed_trace @@ -816,7 +854,7 @@ def begin_update( :param database_name: The name of the database in the Kusto cluster. :type database_name: str :param parameters: The database parameters supplied to the Update operation. - :type parameters: ~kusto_management_client.models.Database + :type parameters: ~azure.mgmt.kusto.models.Database :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -826,11 +864,12 @@ def begin_update( :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 Database or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~kusto_management_client.models.Database] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.Database] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Database"] lro_delay = kwargs.pop( 'polling_interval', @@ -843,6 +882,7 @@ def begin_update( cluster_name=cluster_name, database_name=database_name, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -867,12 +907,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} # type: ignore + begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}"} # type: ignore - def _delete_initial( + def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -885,18 +924,25 @@ def _delete_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + request = build_delete_request_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, database_name=database_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self._delete_initial.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -906,11 +952,11 @@ def _delete_initial( if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}"} # type: ignore @distributed_trace - def begin_delete( + def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -937,7 +983,8 @@ def begin_delete( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -949,6 +996,7 @@ def begin_delete( resource_group_name=resource_group_name, cluster_name=cluster_name, database_name=database_name, + api_version=api_version, cls=lambda x,y,z: x, **kwargs ) @@ -969,10 +1017,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}"} # type: ignore @distributed_trace def list_principals( @@ -993,10 +1040,11 @@ def list_principals( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DatabasePrincipalListResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~kusto_management_client.models.DatabasePrincipalListResult] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kusto.models.DatabasePrincipalListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.DatabasePrincipalListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -1010,6 +1058,7 @@ def prepare_request(next_link=None): cluster_name=cluster_name, database_name=database_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_principals.metadata['url'], ) request = _convert_request(request) @@ -1022,6 +1071,7 @@ def prepare_request(next_link=None): cluster_name=cluster_name, database_name=database_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -1039,7 +1089,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1052,7 +1106,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_principals.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/listPrincipals'} # type: ignore + list_principals.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/listPrincipals"} # type: ignore @distributed_trace def add_principals( @@ -1072,10 +1126,10 @@ def add_principals( :param database_name: The name of the database in the Kusto cluster. :type database_name: str :param database_principals_to_add: List of database principals to add. - :type database_principals_to_add: ~kusto_management_client.models.DatabasePrincipalListRequest + :type database_principals_to_add: ~azure.mgmt.kusto.models.DatabasePrincipalListRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: DatabasePrincipalListResult, or the result of cls(response) - :rtype: ~kusto_management_client.models.DatabasePrincipalListResult + :rtype: ~azure.mgmt.kusto.models.DatabasePrincipalListResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DatabasePrincipalListResult"] @@ -1084,6 +1138,7 @@ def add_principals( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(database_principals_to_add, 'DatabasePrincipalListRequest') @@ -1093,6 +1148,7 @@ def add_principals( cluster_name=cluster_name, database_name=database_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self.add_principals.metadata['url'], @@ -1100,7 +1156,11 @@ def add_principals( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1114,7 +1174,7 @@ def add_principals( return deserialized - add_principals.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/addPrincipals'} # type: ignore + add_principals.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/addPrincipals"} # type: ignore @distributed_trace @@ -1135,11 +1195,10 @@ def remove_principals( :param database_name: The name of the database in the Kusto cluster. :type database_name: str :param database_principals_to_remove: List of database principals to remove. - :type database_principals_to_remove: - ~kusto_management_client.models.DatabasePrincipalListRequest + :type database_principals_to_remove: ~azure.mgmt.kusto.models.DatabasePrincipalListRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: DatabasePrincipalListResult, or the result of cls(response) - :rtype: ~kusto_management_client.models.DatabasePrincipalListResult + :rtype: ~azure.mgmt.kusto.models.DatabasePrincipalListResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DatabasePrincipalListResult"] @@ -1148,6 +1207,7 @@ def remove_principals( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(database_principals_to_remove, 'DatabasePrincipalListRequest') @@ -1157,6 +1217,7 @@ def remove_principals( cluster_name=cluster_name, database_name=database_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self.remove_principals.metadata['url'], @@ -1164,7 +1225,11 @@ def remove_principals( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1178,5 +1243,5 @@ def remove_principals( return deserialized - remove_principals.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/removePrincipals'} # type: ignore + remove_principals.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/removePrincipals"} # type: ignore diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_managed_private_endpoints_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_managed_private_endpoints_operations.py index d30d09f6930c..9b93531e7f8d 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_managed_private_endpoints_operations.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_managed_private_endpoints_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,7 +19,6 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -38,35 +38,35 @@ def build_check_name_availability_request( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2022-02-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpointsCheckNameAvailability') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpointsCheckNameAvailability") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -79,31 +79,32 @@ def build_list_request( cluster_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-02-01" + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpoints') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpoints") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -115,10 +116,11 @@ def build_get_request( managed_private_endpoint_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-02-01" + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpoints/{managedPrivateEndpointName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpoints/{managedPrivateEndpointName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), @@ -126,21 +128,21 @@ def build_get_request( "managedPrivateEndpointName": _SERIALIZER.url("managed_private_endpoint_name", managed_private_endpoint_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -155,12 +157,12 @@ def build_create_or_update_request_initial( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2022-02-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpoints/{managedPrivateEndpointName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpoints/{managedPrivateEndpointName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), @@ -168,23 +170,23 @@ def build_create_or_update_request_initial( "managedPrivateEndpointName": _SERIALIZER.url("managed_private_endpoint_name", managed_private_endpoint_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -201,12 +203,12 @@ def build_update_request_initial( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2022-02-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpoints/{managedPrivateEndpointName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpoints/{managedPrivateEndpointName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), @@ -214,23 +216,23 @@ def build_update_request_initial( "managedPrivateEndpointName": _SERIALIZER.url("managed_private_endpoint_name", managed_private_endpoint_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -244,10 +246,11 @@ def build_delete_request_initial( managed_private_endpoint_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-02-01" + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpoints/{managedPrivateEndpointName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpoints/{managedPrivateEndpointName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), @@ -255,21 +258,21 @@ def build_delete_request_initial( "managedPrivateEndpointName": _SERIALIZER.url("managed_private_endpoint_name", managed_private_endpoint_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -280,7 +283,7 @@ class ManagedPrivateEndpointsOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~kusto_management_client.models + :type models: ~azure.mgmt.kusto.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -310,10 +313,10 @@ def check_name_availability( :param cluster_name: The name of the Kusto cluster. :type cluster_name: str :param resource_name: The name of the resource. - :type resource_name: ~kusto_management_client.models.ManagedPrivateEndpointsCheckNameRequest + :type resource_name: ~azure.mgmt.kusto.models.ManagedPrivateEndpointsCheckNameRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: CheckNameResult, or the result of cls(response) - :rtype: ~kusto_management_client.models.CheckNameResult + :rtype: ~azure.mgmt.kusto.models.CheckNameResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameResult"] @@ -322,6 +325,7 @@ def check_name_availability( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(resource_name, 'ManagedPrivateEndpointsCheckNameRequest') @@ -330,6 +334,7 @@ def check_name_availability( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self.check_name_availability.metadata['url'], @@ -337,7 +342,11 @@ def check_name_availability( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -351,7 +360,7 @@ def check_name_availability( return deserialized - check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpointsCheckNameAvailability'} # type: ignore + check_name_availability.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpointsCheckNameAvailability"} # type: ignore @distributed_trace @@ -370,10 +379,11 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ManagedPrivateEndpointListResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~kusto_management_client.models.ManagedPrivateEndpointListResult] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kusto.models.ManagedPrivateEndpointListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedPrivateEndpointListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -386,6 +396,7 @@ def prepare_request(next_link=None): subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, cluster_name=cluster_name, + api_version=api_version, template_url=self.list.metadata['url'], ) request = _convert_request(request) @@ -397,6 +408,7 @@ def prepare_request(next_link=None): subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, cluster_name=cluster_name, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -414,7 +426,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -427,7 +443,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpoints'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpoints"} # type: ignore @distributed_trace def get( @@ -447,7 +463,7 @@ def get( :type managed_private_endpoint_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ManagedPrivateEndpoint, or the result of cls(response) - :rtype: ~kusto_management_client.models.ManagedPrivateEndpoint + :rtype: ~azure.mgmt.kusto.models.ManagedPrivateEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedPrivateEndpoint"] @@ -456,18 +472,25 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, cluster_name=cluster_name, managed_private_endpoint_name=managed_private_endpoint_name, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -481,7 +504,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpoints/{managedPrivateEndpointName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpoints/{managedPrivateEndpointName}"} # type: ignore def _create_or_update_initial( @@ -498,6 +521,7 @@ def _create_or_update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'ManagedPrivateEndpoint') @@ -507,6 +531,7 @@ def _create_or_update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, managed_private_endpoint_name=managed_private_endpoint_name, + api_version=api_version, content_type=content_type, json=_json, template_url=self._create_or_update_initial.metadata['url'], @@ -514,7 +539,11 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201, 202]: @@ -535,7 +564,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpoints/{managedPrivateEndpointName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpoints/{managedPrivateEndpointName}"} # type: ignore @distributed_trace @@ -556,7 +585,7 @@ def begin_create_or_update( :param managed_private_endpoint_name: The name of the managed private endpoint. :type managed_private_endpoint_name: str :param parameters: The managed private endpoint parameters. - :type parameters: ~kusto_management_client.models.ManagedPrivateEndpoint + :type parameters: ~azure.mgmt.kusto.models.ManagedPrivateEndpoint :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -567,11 +596,12 @@ def begin_create_or_update( Retry-After header is present. :return: An instance of LROPoller that returns either ManagedPrivateEndpoint or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~kusto_management_client.models.ManagedPrivateEndpoint] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.ManagedPrivateEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedPrivateEndpoint"] lro_delay = kwargs.pop( 'polling_interval', @@ -584,6 +614,7 @@ def begin_create_or_update( cluster_name=cluster_name, managed_private_endpoint_name=managed_private_endpoint_name, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -608,10 +639,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpoints/{managedPrivateEndpointName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpoints/{managedPrivateEndpointName}"} # type: ignore def _update_initial( self, @@ -627,6 +657,7 @@ def _update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'ManagedPrivateEndpoint') @@ -636,6 +667,7 @@ def _update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, managed_private_endpoint_name=managed_private_endpoint_name, + api_version=api_version, content_type=content_type, json=_json, template_url=self._update_initial.metadata['url'], @@ -643,7 +675,11 @@ def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -664,7 +700,7 @@ def _update_initial( return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpoints/{managedPrivateEndpointName}'} # type: ignore + _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpoints/{managedPrivateEndpointName}"} # type: ignore @distributed_trace @@ -685,7 +721,7 @@ def begin_update( :param managed_private_endpoint_name: The name of the managed private endpoint. :type managed_private_endpoint_name: str :param parameters: The managed private endpoint parameters. - :type parameters: ~kusto_management_client.models.ManagedPrivateEndpoint + :type parameters: ~azure.mgmt.kusto.models.ManagedPrivateEndpoint :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -696,11 +732,12 @@ def begin_update( Retry-After header is present. :return: An instance of LROPoller that returns either ManagedPrivateEndpoint or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~kusto_management_client.models.ManagedPrivateEndpoint] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.ManagedPrivateEndpoint] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedPrivateEndpoint"] lro_delay = kwargs.pop( 'polling_interval', @@ -713,6 +750,7 @@ def begin_update( cluster_name=cluster_name, managed_private_endpoint_name=managed_private_endpoint_name, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -737,12 +775,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpoints/{managedPrivateEndpointName}'} # type: ignore + begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpoints/{managedPrivateEndpointName}"} # type: ignore - def _delete_initial( + def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -755,18 +792,25 @@ def _delete_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, cluster_name=cluster_name, managed_private_endpoint_name=managed_private_endpoint_name, + api_version=api_version, template_url=self._delete_initial.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -776,11 +820,11 @@ def _delete_initial( if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpoints/{managedPrivateEndpointName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpoints/{managedPrivateEndpointName}"} # type: ignore @distributed_trace - def begin_delete( + def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -807,7 +851,8 @@ def begin_delete( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -819,6 +864,7 @@ def begin_delete( resource_group_name=resource_group_name, cluster_name=cluster_name, managed_private_endpoint_name=managed_private_endpoint_name, + api_version=api_version, cls=lambda x,y,z: x, **kwargs ) @@ -839,7 +885,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpoints/{managedPrivateEndpointName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpoints/{managedPrivateEndpointName}"} # type: ignore diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_operations.py index 34e985053546..8a82eb243946 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_operations.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request @@ -29,24 +29,25 @@ def build_list_request( **kwargs: Any ) -> HttpRequest: - api_version = "2022-02-01" + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/providers/Microsoft.Kusto/operations') + _url = kwargs.pop("template_url", "/providers/Microsoft.Kusto/operations") # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -57,7 +58,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: ~kusto_management_client.models + :type models: ~azure.mgmt.kusto.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -81,9 +82,11 @@ 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[~kusto_management_client.models.OperationListResult] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kusto.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -93,6 +96,7 @@ def prepare_request(next_link=None): if not next_link: request = build_list_request( + api_version=api_version, template_url=self.list.metadata['url'], ) request = _convert_request(request) @@ -101,6 +105,7 @@ def prepare_request(next_link=None): else: request = build_list_request( + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -118,7 +123,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -131,4 +140,4 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/providers/Microsoft.Kusto/operations'} # type: ignore + list.metadata = {'url': "/providers/Microsoft.Kusto/operations"} # type: ignore diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_operations_results_location_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_operations_results_location_operations.py index 14d3cb5fe3f6..a8a395da4910 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_operations_results_location_operations.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_operations_results_location_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -15,7 +16,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -31,25 +31,26 @@ def build_get_request( operation_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-02-01" + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/locations/{location}/operationResults/{operationId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/locations/{location}/operationResults/{operationId}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), "location": _SERIALIZER.url("location", location, 'str'), "operationId": _SERIALIZER.url("operation_id", operation_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, + url=_url, + params=_query_parameters, **kwargs ) @@ -60,7 +61,7 @@ class OperationsResultsLocationOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~kusto_management_client.models + :type models: ~azure.mgmt.kusto.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -76,7 +77,7 @@ def __init__(self, client, config, serializer, deserializer): self._config = config @distributed_trace - def get( + def get( # pylint: disable=inconsistent-return-statements self, location: str, operation_id: str, @@ -99,17 +100,24 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + request = build_get_request( subscription_id=self._config.subscription_id, location=location, operation_id=operation_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -119,5 +127,5 @@ def get( if cls: return cls(pipeline_response, None, {}) - get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/locations/{location}/operationResults/{operationId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/locations/{location}/operationResults/{operationId}"} # type: ignore diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_operations_results_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_operations_results_operations.py index c9682f451f08..bd1198ff4a22 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_operations_results_operations.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_operations_results_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -15,7 +16,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -31,31 +31,32 @@ def build_get_request( operation_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-02-01" + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/locations/{location}/operationResults/{operationId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/locations/{location}/operationResults/{operationId}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), "location": _SERIALIZER.url("location", location, 'str'), "operationId": _SERIALIZER.url("operation_id", operation_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -66,7 +67,7 @@ class OperationsResultsOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~kusto_management_client.models + :type models: ~azure.mgmt.kusto.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -96,7 +97,7 @@ def get( :type operation_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: OperationResult, or the result of cls(response) - :rtype: ~kusto_management_client.models.OperationResult + :rtype: ~azure.mgmt.kusto.models.OperationResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationResult"] @@ -105,17 +106,24 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + request = build_get_request( subscription_id=self._config.subscription_id, location=location, operation_id=operation_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -129,5 +137,5 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/locations/{location}/operationResults/{operationId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/locations/{location}/operationResults/{operationId}"} # type: ignore diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_private_endpoint_connections_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_private_endpoint_connections_operations.py index f0d28bc8ea1f..e9d75d8b5a06 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_private_endpoint_connections_operations.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_private_endpoint_connections_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,7 +19,6 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -35,31 +35,32 @@ def build_list_request( cluster_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-02-01" + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/privateEndpointConnections') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/privateEndpointConnections") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -71,10 +72,11 @@ def build_get_request( private_endpoint_connection_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-02-01" + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), @@ -82,21 +84,21 @@ def build_get_request( "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -111,12 +113,12 @@ def build_create_or_update_request_initial( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2022-02-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), @@ -124,23 +126,23 @@ def build_create_or_update_request_initial( "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -154,10 +156,11 @@ def build_delete_request_initial( private_endpoint_connection_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-02-01" + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), @@ -165,21 +168,21 @@ def build_delete_request_initial( "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -190,7 +193,7 @@ class PrivateEndpointConnectionsOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~kusto_management_client.models + :type models: ~azure.mgmt.kusto.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -222,9 +225,11 @@ def list( :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~kusto_management_client.models.PrivateEndpointConnectionListResult] + ~azure.core.paging.ItemPaged[~azure.mgmt.kusto.models.PrivateEndpointConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -237,6 +242,7 @@ def prepare_request(next_link=None): subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, cluster_name=cluster_name, + api_version=api_version, template_url=self.list.metadata['url'], ) request = _convert_request(request) @@ -248,6 +254,7 @@ def prepare_request(next_link=None): subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, cluster_name=cluster_name, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -265,7 +272,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -278,7 +289,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/privateEndpointConnections'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/privateEndpointConnections"} # type: ignore @distributed_trace def get( @@ -298,7 +309,7 @@ def get( :type private_endpoint_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PrivateEndpointConnection, or the result of cls(response) - :rtype: ~kusto_management_client.models.PrivateEndpointConnection + :rtype: ~azure.mgmt.kusto.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] @@ -307,18 +318,25 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, cluster_name=cluster_name, private_endpoint_connection_name=private_endpoint_connection_name, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -332,7 +350,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore def _create_or_update_initial( @@ -349,6 +367,7 @@ def _create_or_update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'PrivateEndpointConnection') @@ -358,6 +377,7 @@ def _create_or_update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, private_endpoint_connection_name=private_endpoint_connection_name, + api_version=api_version, content_type=content_type, json=_json, template_url=self._create_or_update_initial.metadata['url'], @@ -365,7 +385,11 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -383,7 +407,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace @@ -404,7 +428,7 @@ def begin_create_or_update( :param private_endpoint_connection_name: The name of the private endpoint connection. :type private_endpoint_connection_name: str :param parameters: - :type parameters: ~kusto_management_client.models.PrivateEndpointConnection + :type parameters: ~azure.mgmt.kusto.models.PrivateEndpointConnection :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -415,12 +439,12 @@ def begin_create_or_update( Retry-After header is present. :return: An instance of LROPoller that returns either PrivateEndpointConnection or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~kusto_management_client.models.PrivateEndpointConnection] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.PrivateEndpointConnection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] lro_delay = kwargs.pop( 'polling_interval', @@ -433,6 +457,7 @@ def begin_create_or_update( cluster_name=cluster_name, private_endpoint_connection_name=private_endpoint_connection_name, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -457,12 +482,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - def _delete_initial( + def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -475,18 +499,25 @@ def _delete_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + request = build_delete_request_initial( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, cluster_name=cluster_name, private_endpoint_connection_name=private_endpoint_connection_name, + api_version=api_version, template_url=self._delete_initial.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -496,11 +527,11 @@ def _delete_initial( if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace - def begin_delete( + def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -527,7 +558,8 @@ def begin_delete( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -539,6 +571,7 @@ def begin_delete( resource_group_name=resource_group_name, cluster_name=cluster_name, private_endpoint_connection_name=private_endpoint_connection_name, + api_version=api_version, cls=lambda x,y,z: x, **kwargs ) @@ -559,7 +592,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_private_link_resources_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_private_link_resources_operations.py index 799048116940..67cba6ca91ff 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_private_link_resources_operations.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_private_link_resources_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -32,31 +32,32 @@ def build_list_request( cluster_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-02-01" + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/privateLinkResources') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/privateLinkResources") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -68,10 +69,11 @@ def build_get_request( private_link_resource_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-02-01" + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/privateLinkResources/{privateLinkResourceName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/privateLinkResources/{privateLinkResourceName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), @@ -79,21 +81,21 @@ def build_get_request( "privateLinkResourceName": _SERIALIZER.url("private_link_resource_name", private_link_resource_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -104,7 +106,7 @@ class PrivateLinkResourcesOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~kusto_management_client.models + :type models: ~azure.mgmt.kusto.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -135,10 +137,11 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either PrivateLinkResourceListResult or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~kusto_management_client.models.PrivateLinkResourceListResult] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kusto.models.PrivateLinkResourceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -151,6 +154,7 @@ def prepare_request(next_link=None): subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, cluster_name=cluster_name, + api_version=api_version, template_url=self.list.metadata['url'], ) request = _convert_request(request) @@ -162,6 +166,7 @@ def prepare_request(next_link=None): subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, cluster_name=cluster_name, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -179,7 +184,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -192,7 +201,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/privateLinkResources'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/privateLinkResources"} # type: ignore @distributed_trace def get( @@ -212,7 +221,7 @@ def get( :type private_link_resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PrivateLinkResource, or the result of cls(response) - :rtype: ~kusto_management_client.models.PrivateLinkResource + :rtype: ~azure.mgmt.kusto.models.PrivateLinkResource :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResource"] @@ -221,18 +230,25 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + request = build_get_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, cluster_name=cluster_name, private_link_resource_name=private_link_resource_name, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -246,5 +262,5 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/privateLinkResources/{privateLinkResourceName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/privateLinkResources/{privateLinkResourceName}"} # type: ignore diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_scripts_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_scripts_operations.py index bbdadf820a8e..c741eb2af90d 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_scripts_operations.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_scripts_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,7 +19,6 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -36,10 +36,11 @@ def build_list_by_database_request( database_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-02-01" + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), @@ -47,21 +48,21 @@ def build_list_by_database_request( "databaseName": _SERIALIZER.url("database_name", database_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -74,10 +75,11 @@ def build_get_request( script_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-02-01" + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), @@ -86,21 +88,21 @@ def build_get_request( "scriptName": _SERIALIZER.url("script_name", script_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -116,12 +118,12 @@ def build_create_or_update_request_initial( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2022-02-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), @@ -130,23 +132,23 @@ def build_create_or_update_request_initial( "scriptName": _SERIALIZER.url("script_name", script_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -164,12 +166,12 @@ def build_update_request_initial( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2022-02-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), @@ -178,23 +180,23 @@ def build_update_request_initial( "scriptName": _SERIALIZER.url("script_name", script_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -209,10 +211,11 @@ def build_delete_request_initial( script_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-02-01" + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), @@ -221,21 +224,21 @@ def build_delete_request_initial( "scriptName": _SERIALIZER.url("script_name", script_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -250,12 +253,12 @@ def build_check_name_availability_request( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2022-02-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scriptsCheckNameAvailability') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scriptsCheckNameAvailability") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), @@ -263,23 +266,23 @@ def build_check_name_availability_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -292,7 +295,7 @@ class ScriptsOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~kusto_management_client.models + :type models: ~azure.mgmt.kusto.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -325,9 +328,11 @@ def list_by_database( :type database_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ScriptListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~kusto_management_client.models.ScriptListResult] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kusto.models.ScriptListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ScriptListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -341,6 +346,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, cluster_name=cluster_name, database_name=database_name, + api_version=api_version, template_url=self.list_by_database.metadata['url'], ) request = _convert_request(request) @@ -353,6 +359,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, cluster_name=cluster_name, database_name=database_name, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -370,7 +377,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -383,7 +394,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts'} # type: ignore + list_by_database.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts"} # type: ignore @distributed_trace def get( @@ -406,7 +417,7 @@ def get( :type script_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Script, or the result of cls(response) - :rtype: ~kusto_management_client.models.Script + :rtype: ~azure.mgmt.kusto.models.Script :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Script"] @@ -415,6 +426,8 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + request = build_get_request( subscription_id=self._config.subscription_id, @@ -422,12 +435,17 @@ def get( cluster_name=cluster_name, database_name=database_name, script_name=script_name, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -441,7 +459,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}"} # type: ignore def _create_or_update_initial( @@ -459,6 +477,7 @@ def _create_or_update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'Script') @@ -469,6 +488,7 @@ def _create_or_update_initial( cluster_name=cluster_name, database_name=database_name, script_name=script_name, + api_version=api_version, content_type=content_type, json=_json, template_url=self._create_or_update_initial.metadata['url'], @@ -476,7 +496,11 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201, 202]: @@ -497,7 +521,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}"} # type: ignore @distributed_trace @@ -521,7 +545,7 @@ def begin_create_or_update( :param script_name: The name of the Kusto database script. :type script_name: str :param parameters: The Kusto Script parameters contains the KQL to run. - :type parameters: ~kusto_management_client.models.Script + :type parameters: ~azure.mgmt.kusto.models.Script :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -531,11 +555,12 @@ def begin_create_or_update( :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 Script or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~kusto_management_client.models.Script] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.Script] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Script"] lro_delay = kwargs.pop( 'polling_interval', @@ -549,6 +574,7 @@ def begin_create_or_update( database_name=database_name, script_name=script_name, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -573,10 +599,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}"} # type: ignore def _update_initial( self, @@ -593,6 +618,7 @@ def _update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'Script') @@ -603,6 +629,7 @@ def _update_initial( cluster_name=cluster_name, database_name=database_name, script_name=script_name, + api_version=api_version, content_type=content_type, json=_json, template_url=self._update_initial.metadata['url'], @@ -610,7 +637,11 @@ def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -631,7 +662,7 @@ def _update_initial( return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}'} # type: ignore + _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}"} # type: ignore @distributed_trace @@ -655,7 +686,7 @@ def begin_update( :param script_name: The name of the Kusto database script. :type script_name: str :param parameters: The Kusto Script parameters contains to the KQL to run. - :type parameters: ~kusto_management_client.models.Script + :type parameters: ~azure.mgmt.kusto.models.Script :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -665,11 +696,12 @@ def begin_update( :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 Script or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~kusto_management_client.models.Script] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.Script] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Script"] lro_delay = kwargs.pop( 'polling_interval', @@ -683,6 +715,7 @@ def begin_update( database_name=database_name, script_name=script_name, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -707,12 +740,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}'} # type: ignore + begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}"} # type: ignore - def _delete_initial( + def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -726,6 +758,8 @@ def _delete_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + request = build_delete_request_initial( subscription_id=self._config.subscription_id, @@ -733,12 +767,17 @@ def _delete_initial( cluster_name=cluster_name, database_name=database_name, script_name=script_name, + api_version=api_version, template_url=self._delete_initial.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -748,11 +787,11 @@ def _delete_initial( if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}"} # type: ignore @distributed_trace - def begin_delete( + def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, @@ -782,7 +821,8 @@ def begin_delete( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + api_version = kwargs.pop('api_version', "2022-02-01") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -795,6 +835,7 @@ def begin_delete( cluster_name=cluster_name, database_name=database_name, script_name=script_name, + api_version=api_version, cls=lambda x,y,z: x, **kwargs ) @@ -815,10 +856,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}"} # type: ignore @distributed_trace def check_name_availability( @@ -838,10 +878,10 @@ def check_name_availability( :param database_name: The name of the database in the Kusto cluster. :type database_name: str :param script_name: The name of the script. - :type script_name: ~kusto_management_client.models.ScriptCheckNameRequest + :type script_name: ~azure.mgmt.kusto.models.ScriptCheckNameRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: CheckNameResult, or the result of cls(response) - :rtype: ~kusto_management_client.models.CheckNameResult + :rtype: ~azure.mgmt.kusto.models.CheckNameResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameResult"] @@ -850,6 +890,7 @@ def check_name_availability( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2022-02-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(script_name, 'ScriptCheckNameRequest') @@ -859,6 +900,7 @@ def check_name_availability( cluster_name=cluster_name, database_name=database_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self.check_name_availability.metadata['url'], @@ -866,7 +908,11 @@ def check_name_availability( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -880,5 +926,5 @@ def check_name_availability( return deserialized - check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scriptsCheckNameAvailability'} # type: ignore + check_name_availability.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scriptsCheckNameAvailability"} # type: ignore diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/base_client.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/base_client.py index 9784a278ab7f..0d14b68e06c9 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/base_client.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/base_client.py @@ -402,7 +402,8 @@ def parse_connection_str(conn_str, credential, service): raise ValueError("Connection string missing required connection details.") if service == "dfs": primary = primary.replace(".blob.", ".dfs.") - secondary = secondary.replace(".blob.", ".dfs.") + if secondary: + secondary = secondary.replace(".blob.", ".dfs.") return primary, secondary, credential diff --git a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/base_client.py b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/base_client.py index f8fae9e6acc5..b80d04a57363 100644 --- a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/base_client.py +++ b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/base_client.py @@ -401,7 +401,8 @@ def parse_connection_str(conn_str, credential, service): raise ValueError("Connection string missing required connection details.") if service == "dfs": primary = primary.replace(".blob.", ".dfs.") - secondary = secondary.replace(".blob.", ".dfs.") + if secondary: + secondary = secondary.replace(".blob.", ".dfs.") return primary, secondary, credential diff --git a/sdk/storage/azure-storage-file-datalake/tests/test_datalake_service_client.py b/sdk/storage/azure-storage-file-datalake/tests/test_datalake_service_client.py index 299408b4c2c1..7fc281eb5dd9 100644 --- a/sdk/storage/azure-storage-file-datalake/tests/test_datalake_service_client.py +++ b/sdk/storage/azure-storage-file-datalake/tests/test_datalake_service_client.py @@ -10,7 +10,12 @@ from azure.core.exceptions import HttpResponseError -from azure.storage.filedatalake import DataLakeServiceClient +from azure.storage.filedatalake import ( + DataLakeServiceClient, + FileSystemClient, + DataLakeFileClient, + DataLakeDirectoryClient +) from settings.testcase import DataLakePreparer from devtools_testutils.storage import StorageTestCase @@ -321,3 +326,25 @@ def test_set_cors(self, datalake_storage_account_name, datalake_storage_account_ # Assert received_props = self.dsc.get_service_properties() self._assert_cors_equal(received_props['cors'], cors) + + def test_connectionstring_without_secondary(self): + test_conn_str = "DefaultEndpointsProtocol=https;AccountName=foo;AccountKey=bar" + client = DataLakeServiceClient.from_connection_string(test_conn_str) + assert client.url == 'https://foo.dfs.core.windows.net/' + assert client.primary_hostname == 'foo.dfs.core.windows.net' + assert not client.secondary_hostname + + client = FileSystemClient.from_connection_string(test_conn_str, "fsname") + assert client.url == 'https://foo.dfs.core.windows.net/fsname' + assert client.primary_hostname == 'foo.dfs.core.windows.net' + assert not client.secondary_hostname + + client = DataLakeFileClient.from_connection_string(test_conn_str, "fsname", "fpath") + assert client.url == 'https://foo.dfs.core.windows.net/fsname/fpath' + assert client.primary_hostname == 'foo.dfs.core.windows.net' + assert not client.secondary_hostname + + client = DataLakeDirectoryClient.from_connection_string(test_conn_str, "fsname", "dname") + assert client.url == 'https://foo.dfs.core.windows.net/fsname/dname' + assert client.primary_hostname == 'foo.dfs.core.windows.net' + assert not client.secondary_hostname diff --git a/sdk/storage/azure-storage-file-datalake/tests/test_datalake_service_client_async.py b/sdk/storage/azure-storage-file-datalake/tests/test_datalake_service_client_async.py index 593ceeb11e84..84d05e467c73 100644 --- a/sdk/storage/azure-storage-file-datalake/tests/test_datalake_service_client_async.py +++ b/sdk/storage/azure-storage-file-datalake/tests/test_datalake_service_client_async.py @@ -11,7 +11,12 @@ from azure.core.exceptions import HttpResponseError -from azure.storage.filedatalake.aio import DataLakeServiceClient +from azure.storage.filedatalake.aio import ( + DataLakeServiceClient, + FileSystemClient, + DataLakeFileClient, + DataLakeDirectoryClient +) from devtools_testutils.storage.aio import AsyncStorageTestCase as StorageTestCase from settings.testcase import DataLakePreparer @@ -316,3 +321,25 @@ async def test_set_cors(self, datalake_storage_account_name, datalake_storage_ac # Assert received_props = await self.dsc.get_service_properties() self._assert_cors_equal(received_props['cors'], cors) + + async def test_connectionstring_without_secondary(self): + test_conn_str = "DefaultEndpointsProtocol=https;AccountName=foo;AccountKey=bar" + client = DataLakeServiceClient.from_connection_string(test_conn_str) + assert client.url == 'https://foo.dfs.core.windows.net/' + assert client.primary_hostname == 'foo.dfs.core.windows.net' + assert not client.secondary_hostname + + client = FileSystemClient.from_connection_string(test_conn_str, "fsname") + assert client.url == 'https://foo.dfs.core.windows.net/fsname' + assert client.primary_hostname == 'foo.dfs.core.windows.net' + assert not client.secondary_hostname + + client = DataLakeFileClient.from_connection_string(test_conn_str, "fsname", "fpath") + assert client.url == 'https://foo.dfs.core.windows.net/fsname/fpath' + assert client.primary_hostname == 'foo.dfs.core.windows.net' + assert not client.secondary_hostname + + client = DataLakeDirectoryClient.from_connection_string(test_conn_str, "fsname", "dname") + assert client.url == 'https://foo.dfs.core.windows.net/fsname/dname' + assert client.primary_hostname == 'foo.dfs.core.windows.net' + assert not client.secondary_hostname diff --git a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/base_client.py b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/base_client.py index f8fae9e6acc5..b80d04a57363 100644 --- a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/base_client.py +++ b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/base_client.py @@ -401,7 +401,8 @@ def parse_connection_str(conn_str, credential, service): raise ValueError("Connection string missing required connection details.") if service == "dfs": primary = primary.replace(".blob.", ".dfs.") - secondary = secondary.replace(".blob.", ".dfs.") + if secondary: + secondary = secondary.replace(".blob.", ".dfs.") return primary, secondary, credential diff --git a/sdk/storage/azure-storage-queue/azure/storage/queue/_shared/base_client.py b/sdk/storage/azure-storage-queue/azure/storage/queue/_shared/base_client.py index f8fae9e6acc5..b80d04a57363 100644 --- a/sdk/storage/azure-storage-queue/azure/storage/queue/_shared/base_client.py +++ b/sdk/storage/azure-storage-queue/azure/storage/queue/_shared/base_client.py @@ -401,7 +401,8 @@ def parse_connection_str(conn_str, credential, service): raise ValueError("Connection string missing required connection details.") if service == "dfs": primary = primary.replace(".blob.", ".dfs.") - secondary = secondary.replace(".blob.", ".dfs.") + if secondary: + secondary = secondary.replace(".blob.", ".dfs.") return primary, secondary, credential