diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/_azure_machine_learning_workspaces.py index 54b433a18eee..d3c92e8135bc 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/_azure_machine_learning_workspaces.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/_azure_machine_learning_workspaces.py @@ -9,21 +9,22 @@ from copy import deepcopy from typing import TYPE_CHECKING -from azure.mgmt.core import ARMPipelineClient from msrest import Deserializer, Serializer +from azure.mgmt.core import ARMPipelineClient + from . import models from ._configuration import AzureMachineLearningWorkspacesConfiguration from .operations import BatchDeploymentsOperations, BatchEndpointsOperations, CodeContainersOperations, CodeVersionsOperations, ComponentContainersOperations, ComponentVersionsOperations, ComputeOperations, DataContainersOperations, DataVersionsOperations, DatastoresOperations, EnvironmentContainersOperations, EnvironmentVersionsOperations, JobsOperations, LabelingJobsOperations, ModelContainersOperations, ModelVersionsOperations, OnlineDeploymentsOperations, OnlineEndpointsOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, QuotasOperations, RegistriesOperations, RegistryCodeContainersOperations, RegistryCodeVersionsOperations, RegistryComponentContainersOperations, RegistryComponentVersionsOperations, RegistryEnvironmentContainersOperations, RegistryEnvironmentVersionsOperations, RegistryModelContainersOperations, RegistryModelVersionsOperations, SchedulesOperations, UsagesOperations, VirtualMachineSizesOperations, WorkspaceConnectionsOperations, WorkspaceFeaturesOperations, WorkspacesOperations if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Optional + from typing import Any from azure.core.credentials import TokenCredential from azure.core.rest import HttpRequest, HttpResponse -class AzureMachineLearningWorkspaces(object): +class AzureMachineLearningWorkspaces(object): # pylint: disable=too-many-instance-attributes """These APIs allow end users to operate on Azure Machine Learning Workspace resources. :ivar operations: Operations operations diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/_configuration.py index 3c095542afad..f395f71d01fe 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/_configuration.py @@ -21,7 +21,7 @@ from azure.core.credentials import TokenCredential -class AzureMachineLearningWorkspacesConfiguration(Configuration): +class AzureMachineLearningWorkspacesConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for AzureMachineLearningWorkspaces. Note that all parameters used to create this instance are saved as instance @@ -31,7 +31,8 @@ class AzureMachineLearningWorkspacesConfiguration(Configuration): :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. :type subscription_id: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that overriding this default value may result in unsupported behavior. + :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that + overriding this default value may result in unsupported behavior. :paramtype api_version: str """ diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/_azure_machine_learning_workspaces.py index f38f5a082b39..bd38eaf1f3d9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/_azure_machine_learning_workspaces.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/_azure_machine_learning_workspaces.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 AzureMachineLearningWorkspacesConfiguration @@ -21,7 +22,7 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class AzureMachineLearningWorkspaces: +class AzureMachineLearningWorkspaces: # pylint: disable=too-many-instance-attributes """These APIs allow end users to operate on Azure Machine Learning Workspace resources. :ivar operations: Operations operations diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/_configuration.py index 58d868c71e24..dde99f5c7bff 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/_configuration.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/_configuration.py @@ -19,7 +19,7 @@ from azure.core.credentials_async import AsyncTokenCredential -class AzureMachineLearningWorkspacesConfiguration(Configuration): +class AzureMachineLearningWorkspacesConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for AzureMachineLearningWorkspaces. Note that all parameters used to create this instance are saved as instance @@ -29,7 +29,8 @@ class AzureMachineLearningWorkspacesConfiguration(Configuration): :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. :type subscription_id: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that overriding this default value may result in unsupported behavior. + :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that + overriding this default value may result in unsupported behavior. :paramtype api_version: str """ diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_batch_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_batch_deployments_operations.py index 41c5678e62fd..1483c2fe2ca7 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_batch_deployments_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_batch_deployments_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 @@ -75,9 +74,6 @@ def list( :type top: int :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BatchDeploymentTrackedResourceArmPaginatedResult or the result of cls(response) @@ -137,7 +133,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]: @@ -151,9 +151,9 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments"} # type: ignore - async def _delete_initial( + async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -182,7 +182,11 @@ async def _delete_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, 204]: @@ -199,11 +203,11 @@ async def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async - async def begin_delete( + async def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -223,9 +227,6 @@ async def begin_delete( :type endpoint_name: str :param deployment_name: Inference deployment identifier. :type deployment_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -239,7 +240,7 @@ async def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: 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', @@ -273,10 +274,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.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def get( @@ -299,9 +299,6 @@ async def get( :type endpoint_name: str :param deployment_name: The identifier for the Batch deployments. :type deployment_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: BatchDeployment, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.BatchDeployment @@ -328,7 +325,11 @@ async def get( 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]: @@ -343,7 +344,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore async def _update_initial( @@ -380,7 +381,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]: @@ -403,7 +408,7 @@ async def _update_initial( return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async @@ -431,9 +436,6 @@ async def begin_update( :param body: Batch inference deployment definition object. :type body: ~azure.mgmt.machinelearningservices.models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -450,7 +452,7 @@ async def begin_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.BatchDeployment"] lro_delay = kwargs.pop( 'polling_interval', @@ -489,10 +491,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_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore async def _create_or_update_initial( self, @@ -528,7 +529,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]: @@ -550,7 +555,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async @@ -577,9 +582,6 @@ async def begin_create_or_update( :type deployment_name: str :param body: Batch inference deployment definition object. :type body: ~azure.mgmt.machinelearningservices.models.BatchDeployment - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -596,7 +598,7 @@ async def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.BatchDeployment"] lro_delay = kwargs.pop( 'polling_interval', @@ -635,7 +637,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_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_batch_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_batch_endpoints_operations.py index c9376b449969..a31ef8ddd428 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_batch_endpoints_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_batch_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 @@ -69,9 +68,6 @@ def list( :type count: int :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BatchEndpointTrackedResourceArmPaginatedResult or the result of cls(response) @@ -127,7 +123,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]: @@ -141,9 +141,9 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints"} # type: ignore - async def _delete_initial( + async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -170,7 +170,11 @@ async def _delete_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, 204]: @@ -187,11 +191,11 @@ async def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async - async def begin_delete( + async def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -208,9 +212,6 @@ async def begin_delete( :type workspace_name: str :param endpoint_name: Inference Endpoint name. :type endpoint_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -224,7 +225,7 @@ async def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: 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', @@ -257,10 +258,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.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def get( @@ -280,9 +280,6 @@ async def get( :type workspace_name: str :param endpoint_name: Name for the Batch Endpoint. :type endpoint_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: BatchEndpoint, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.BatchEndpoint @@ -308,7 +305,11 @@ async def get( 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]: @@ -323,7 +324,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore async def _update_initial( @@ -358,7 +359,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]: @@ -381,7 +386,7 @@ async def _update_initial( return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore + _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async @@ -406,9 +411,6 @@ async def begin_update( :param body: Mutable batch inference endpoint definition object. :type body: ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithIdentity - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -425,7 +427,7 @@ async def begin_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.BatchEndpoint"] lro_delay = kwargs.pop( 'polling_interval', @@ -463,10 +465,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_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore + begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore async def _create_or_update_initial( self, @@ -500,7 +501,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]: @@ -522,7 +527,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async @@ -546,9 +551,6 @@ async def begin_create_or_update( :type endpoint_name: str :param body: Batch inference endpoint definition object. :type body: ~azure.mgmt.machinelearningservices.models.BatchEndpoint - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -565,7 +567,7 @@ async def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.BatchEndpoint"] lro_delay = kwargs.pop( 'polling_interval', @@ -603,10 +605,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.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def list_keys( @@ -626,9 +627,6 @@ async def list_keys( :type workspace_name: str :param endpoint_name: Inference Endpoint name. :type endpoint_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: EndpointAuthKeys, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys @@ -654,7 +652,11 @@ async def list_keys( 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]: @@ -669,5 +671,5 @@ async def list_keys( return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys'} # type: ignore + list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_code_containers_operations.py index 4f0be951a934..51250fad9f43 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_code_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_code_containers_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 from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -64,9 +63,6 @@ def list( :type workspace_name: str :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CodeContainerResourceArmPaginatedResult or the result of cls(response) @@ -120,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]: @@ -134,10 +134,10 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -154,9 +154,6 @@ async def delete( :type workspace_name: str :param name: Container name. This is case-sensitive. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -182,7 +179,11 @@ async def delete( 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, 204]: @@ -193,7 +194,7 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore @distributed_trace_async @@ -214,9 +215,6 @@ async def get( :type workspace_name: str :param name: Container name. This is case-sensitive. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: CodeContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer @@ -242,7 +240,11 @@ async def get( 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]: @@ -257,7 +259,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore @distributed_trace_async @@ -281,9 +283,6 @@ async def create_or_update( :type name: str :param body: Container entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.CodeContainer - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: CodeContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer @@ -313,7 +312,11 @@ async def create_or_update( 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]: @@ -332,5 +335,5 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_code_versions_operations.py index 5b1af5a04e03..6470da292155 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_code_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_code_versions_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 from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -73,9 +72,6 @@ def list( :type top: int :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CodeVersionResourceArmPaginatedResult or the result of cls(response) @@ -135,7 +131,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]: @@ -149,10 +149,10 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -172,9 +172,6 @@ async def delete( :type name: str :param version: Version identifier. This is case-sensitive. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -201,7 +198,11 @@ async def delete( 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, 204]: @@ -212,7 +213,7 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace_async @@ -236,9 +237,6 @@ async def get( :type name: str :param version: Version identifier. This is case-sensitive. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: CodeVersion, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion @@ -265,7 +263,11 @@ async def get( 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]: @@ -280,7 +282,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace_async @@ -307,9 +309,6 @@ async def create_or_update( :type version: str :param body: Version entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.CodeVersion - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: CodeVersion, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion @@ -340,7 +339,11 @@ async def create_or_update( 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]: @@ -359,5 +362,5 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_component_containers_operations.py index c31422dce68d..acbc0fe6d2a6 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_component_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_component_containers_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 @@ -67,9 +66,6 @@ def list( :type skip: str :param list_view_type: View type for including/excluding (for example) archived entities. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ComponentContainerResourceArmPaginatedResult or the result of cls(response) @@ -125,7 +121,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]: @@ -139,10 +139,10 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -159,9 +159,6 @@ async def delete( :type workspace_name: str :param name: Container name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -187,7 +184,11 @@ async def delete( 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, 204]: @@ -198,7 +199,7 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore @distributed_trace_async @@ -219,9 +220,6 @@ async def get( :type workspace_name: str :param name: Container name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ComponentContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer @@ -247,7 +245,11 @@ async def get( 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]: @@ -262,7 +264,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore @distributed_trace_async @@ -286,9 +288,6 @@ async def create_or_update( :type name: str :param body: Container entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.ComponentContainer - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ComponentContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer @@ -318,7 +317,11 @@ async def create_or_update( 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]: @@ -337,5 +340,5 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_component_versions_operations.py index 83a32b62f87f..d3dbca43c2b8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_component_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_component_versions_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 @@ -76,9 +75,6 @@ def list( :type skip: str :param list_view_type: View type for including/excluding (for example) archived entities. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ComponentVersionResourceArmPaginatedResult or the result of cls(response) @@ -140,7 +136,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]: @@ -154,10 +154,10 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -177,9 +177,6 @@ async def delete( :type name: str :param version: Version identifier. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -206,7 +203,11 @@ async def delete( 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, 204]: @@ -217,7 +218,7 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace_async @@ -241,9 +242,6 @@ async def get( :type name: str :param version: Version identifier. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ComponentVersion, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion @@ -270,7 +268,11 @@ async def get( 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]: @@ -285,7 +287,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace_async @@ -312,9 +314,6 @@ async def create_or_update( :type version: str :param body: Version entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.ComponentVersion - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ComponentVersion, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion @@ -345,7 +344,11 @@ async def create_or_update( 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]: @@ -364,5 +367,5 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_compute_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_compute_operations.py index 67d8b0abc734..bf8c25a14d65 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_compute_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_compute_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, List, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, List, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -64,9 +63,6 @@ def list( :type workspace_name: str :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either PaginatedComputeResourcesList or the result of cls(response) @@ -120,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]: @@ -134,7 +134,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes"} # type: ignore @distributed_trace_async async def get( @@ -153,9 +153,6 @@ async def get( :type workspace_name: str :param compute_name: Name of the Azure Machine Learning compute. :type compute_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ComputeResource, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ComputeResource @@ -181,7 +178,11 @@ async def get( 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]: @@ -196,7 +197,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore async def _create_or_update_initial( @@ -231,7 +232,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]: @@ -252,7 +257,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace_async @@ -276,9 +281,6 @@ async def begin_create_or_update( :type compute_name: str :param parameters: Payload with Machine Learning compute definition. :type parameters: ~azure.mgmt.machinelearningservices.models.ComputeResource - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -295,7 +297,7 @@ async def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.ComputeResource"] lro_delay = kwargs.pop( 'polling_interval', @@ -333,10 +335,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.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore async def _update_initial( self, @@ -370,7 +371,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]: @@ -384,7 +389,7 @@ async def _update_initial( return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore + _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace_async @@ -407,9 +412,6 @@ async def begin_update( :type compute_name: str :param parameters: Additional parameters for cluster update. :type parameters: ~azure.mgmt.machinelearningservices.models.ClusterUpdateParameters - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -426,7 +428,7 @@ async def begin_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.ComputeResource"] lro_delay = kwargs.pop( 'polling_interval', @@ -464,12 +466,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.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore + begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - async def _delete_initial( + async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -498,7 +499,11 @@ async def _delete_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, 204]: @@ -514,11 +519,11 @@ async def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace_async - async def begin_delete( + async def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -538,9 +543,6 @@ async def begin_delete( underlying compute from workspace if 'Detach'. :type underlying_resource_action: str or ~azure.mgmt.machinelearningservices.models.UnderlyingResourceAction - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -554,7 +556,7 @@ async def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: 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', @@ -588,13 +590,12 @@ 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.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace_async - async def update_custom_services( + async def update_custom_services( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -612,9 +613,6 @@ async def update_custom_services( :type compute_name: str :param custom_services: New list of Custom Services. :type custom_services: list[~azure.mgmt.machinelearningservices.models.CustomService] - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -644,7 +642,11 @@ async def update_custom_services( 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]: @@ -655,7 +657,7 @@ async def update_custom_services( if cls: return cls(pipeline_response, None, {}) - update_custom_services.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/customServices'} # type: ignore + update_custom_services.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/customServices"} # type: ignore @distributed_trace @@ -674,9 +676,6 @@ def list_nodes( :type workspace_name: str :param compute_name: Name of the Azure Machine Learning compute. :type compute_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AmlComputeNodesInformation or the result of cls(response) @@ -730,7 +729,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]: @@ -744,7 +747,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_nodes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes'} # type: ignore + list_nodes.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes"} # type: ignore @distributed_trace_async async def list_keys( @@ -762,9 +765,6 @@ async def list_keys( :type workspace_name: str :param compute_name: Name of the Azure Machine Learning compute. :type compute_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ComputeSecrets, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ComputeSecrets @@ -790,7 +790,11 @@ async def list_keys( 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,10 +809,10 @@ async def list_keys( return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys'} # type: ignore + list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys"} # type: ignore - async def _start_initial( + async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -835,7 +839,11 @@ async def _start_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 [202]: @@ -845,11 +853,11 @@ async def _start_initial( if cls: return cls(pipeline_response, None, {}) - _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start'} # type: ignore + _start_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore @distributed_trace_async - async def begin_start( + async def begin_start( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -864,9 +872,6 @@ async def begin_start( :type workspace_name: str :param compute_name: Name of the Azure Machine Learning compute. :type compute_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -880,7 +885,7 @@ async def begin_start( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: 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', @@ -913,12 +918,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_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start'} # type: ignore + begin_start.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore - async def _stop_initial( + async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -945,7 +949,11 @@ async def _stop_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 [202]: @@ -955,11 +963,11 @@ async def _stop_initial( if cls: return cls(pipeline_response, None, {}) - _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop'} # type: ignore + _stop_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore @distributed_trace_async - async def begin_stop( + async def begin_stop( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -974,9 +982,6 @@ async def begin_stop( :type workspace_name: str :param compute_name: Name of the Azure Machine Learning compute. :type compute_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -990,7 +995,7 @@ async def begin_stop( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: 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', @@ -1023,12 +1028,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.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop'} # type: ignore + begin_stop.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore - async def _restart_initial( + async def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -1055,7 +1059,11 @@ async def _restart_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 [202]: @@ -1065,11 +1073,11 @@ async def _restart_initial( if cls: return cls(pipeline_response, None, {}) - _restart_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart'} # type: ignore + _restart_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore @distributed_trace_async - async def begin_restart( + async def begin_restart( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -1084,9 +1092,6 @@ async def begin_restart( :type workspace_name: str :param compute_name: Name of the Azure Machine Learning compute. :type compute_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -1100,7 +1105,7 @@ async def begin_restart( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: 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', @@ -1133,13 +1138,12 @@ 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_restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart'} # type: ignore + begin_restart.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore @distributed_trace_async - async def update_idle_shutdown_setting( + async def update_idle_shutdown_setting( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -1157,9 +1161,6 @@ async def update_idle_shutdown_setting( :type compute_name: str :param parameters: The object for updating idle shutdown setting of specified ComputeInstance. :type parameters: ~azure.mgmt.machinelearningservices.models.IdleShutdownSetting - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -1189,7 +1190,11 @@ async def update_idle_shutdown_setting( 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]: @@ -1200,5 +1205,5 @@ async def update_idle_shutdown_setting( if cls: return cls(pipeline_response, None, {}) - update_idle_shutdown_setting.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateIdleShutdownSetting'} # type: ignore + update_idle_shutdown_setting.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateIdleShutdownSetting"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_data_containers_operations.py index 9e0f2b048eaa..431836783f5f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_data_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_data_containers_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 @@ -67,9 +66,6 @@ def list( :type skip: str :param list_view_type: View type for including/excluding (for example) archived entities. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DataContainerResourceArmPaginatedResult or the result of cls(response) @@ -125,7 +121,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]: @@ -139,10 +139,10 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -159,9 +159,6 @@ async def delete( :type workspace_name: str :param name: Container name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -187,7 +184,11 @@ async def delete( 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, 204]: @@ -198,7 +199,7 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore @distributed_trace_async @@ -219,9 +220,6 @@ async def get( :type workspace_name: str :param name: Container name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DataContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.DataContainer @@ -247,7 +245,11 @@ async def get( 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]: @@ -262,7 +264,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore @distributed_trace_async @@ -286,9 +288,6 @@ async def create_or_update( :type name: str :param body: Container entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.DataContainer - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DataContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.DataContainer @@ -318,7 +317,11 @@ async def create_or_update( 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]: @@ -337,5 +340,5 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_data_versions_operations.py index e2fda1d2ec4d..36293053cf04 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_data_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_data_versions_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 @@ -83,9 +82,6 @@ def list( :param list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DataVersionBaseResourceArmPaginatedResult or the result of cls(response) @@ -149,7 +145,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]: @@ -163,10 +163,10 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -186,9 +186,6 @@ async def delete( :type name: str :param version: Version identifier. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -215,7 +212,11 @@ async def delete( 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, 204]: @@ -226,7 +227,7 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace_async @@ -250,9 +251,6 @@ async def get( :type name: str :param version: Version identifier. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DataVersionBase, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase @@ -279,7 +277,11 @@ async def get( 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]: @@ -294,7 +296,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace_async @@ -321,9 +323,6 @@ async def create_or_update( :type version: str :param body: Version entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.DataVersionBase - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DataVersionBase, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase @@ -354,7 +353,11 @@ async def create_or_update( 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]: @@ -373,5 +376,5 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_datastores_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_datastores_operations.py index 47c84aaf073c..4599f14170cc 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_datastores_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_datastores_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, List, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, List, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -82,9 +81,6 @@ def list( :type order_by: str :param order_by_asc: Order by property in ascending order. :type order_by_asc: bool - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DatastoreResourceArmPaginatedResult or the result of cls(response) @@ -150,7 +146,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]: @@ -164,10 +164,10 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -184,9 +184,6 @@ async def delete( :type workspace_name: str :param name: Datastore name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -212,7 +209,11 @@ async def delete( 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, 204]: @@ -223,7 +224,7 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace_async @@ -244,9 +245,6 @@ async def get( :type workspace_name: str :param name: Datastore name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Datastore, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.Datastore @@ -272,7 +270,11 @@ async def get( 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]: @@ -287,7 +289,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace_async @@ -314,9 +316,6 @@ async def create_or_update( :type body: ~azure.mgmt.machinelearningservices.models.Datastore :param skip_validation: Flag to skip validation. :type skip_validation: bool - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Datastore, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.Datastore @@ -347,7 +346,11 @@ async def create_or_update( 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]: @@ -366,7 +369,7 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace_async @@ -387,9 +390,6 @@ async def list_secrets( :type workspace_name: str :param name: Datastore name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DatastoreSecrets, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.DatastoreSecrets @@ -415,7 +415,11 @@ async def list_secrets( 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]: @@ -430,5 +434,5 @@ async def list_secrets( return deserialized - list_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets'} # type: ignore + list_secrets.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_environment_containers_operations.py index 4152f4ae8cd8..774d9f5bdf4d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_environment_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_environment_containers_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 @@ -67,9 +66,6 @@ def list( :type skip: str :param list_view_type: View type for including/excluding (for example) archived entities. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either EnvironmentContainerResourceArmPaginatedResult or the result of cls(response) @@ -125,7 +121,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]: @@ -139,10 +139,10 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -159,9 +159,6 @@ async def delete( :type workspace_name: str :param name: Container name. This is case-sensitive. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -187,7 +184,11 @@ async def delete( 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, 204]: @@ -198,7 +199,7 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore @distributed_trace_async @@ -219,9 +220,6 @@ async def get( :type workspace_name: str :param name: Container name. This is case-sensitive. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: EnvironmentContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer @@ -247,7 +245,11 @@ async def get( 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]: @@ -262,7 +264,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore @distributed_trace_async @@ -286,9 +288,6 @@ async def create_or_update( :type name: str :param body: Container entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: EnvironmentContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer @@ -318,7 +317,11 @@ async def create_or_update( 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]: @@ -337,5 +340,5 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_environment_versions_operations.py index 96296e4f2673..d5d425464fa6 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_environment_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_environment_versions_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 @@ -76,9 +75,6 @@ def list( :type skip: str :param list_view_type: View type for including/excluding (for example) archived entities. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either EnvironmentVersionResourceArmPaginatedResult or the result of cls(response) @@ -140,7 +136,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]: @@ -154,10 +154,10 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -177,9 +177,6 @@ async def delete( :type name: str :param version: Version identifier. This is case-sensitive. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -206,7 +203,11 @@ async def delete( 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, 204]: @@ -217,7 +218,7 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace_async @@ -241,9 +242,6 @@ async def get( :type name: str :param version: Version identifier. This is case-sensitive. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: EnvironmentVersion, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion @@ -270,7 +268,11 @@ async def get( 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]: @@ -285,7 +287,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace_async @@ -312,9 +314,6 @@ async def create_or_update( :type version: str :param body: Definition of EnvironmentVersion. :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: EnvironmentVersion, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion @@ -345,7 +344,11 @@ async def create_or_update( 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]: @@ -364,5 +367,5 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_jobs_operations.py index cc1d3c251fd8..70edbcfcf4b2 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_jobs_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_jobs_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 @@ -81,9 +80,6 @@ def list( :type scheduled: bool :param schedule_id: The scheduled id for listing the job triggered from. :type schedule_id: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either JobBaseResourceArmPaginatedResult or the result of cls(response) @@ -147,7 +143,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]: @@ -161,9 +161,9 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs"} # type: ignore - async def _delete_initial( + async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -190,7 +190,11 @@ async def _delete_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, 204]: @@ -207,11 +211,11 @@ async def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace_async - async def begin_delete( + async def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -228,9 +232,6 @@ async def begin_delete( :type workspace_name: str :param id: The name and identifier for the Job. This is case-sensitive. :type id: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -244,7 +245,7 @@ async def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: 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', @@ -277,10 +278,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.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace_async async def get( @@ -300,9 +300,6 @@ async def get( :type workspace_name: str :param id: The name and identifier for the Job. This is case-sensitive. :type id: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: JobBase, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.JobBase @@ -328,7 +325,11 @@ async def get( 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]: @@ -343,7 +344,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace_async @@ -367,9 +368,6 @@ async def create_or_update( :type id: str :param body: Job definition object. :type body: ~azure.mgmt.machinelearningservices.models.JobBase - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: JobBase, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.JobBase @@ -399,7 +397,11 @@ async def create_or_update( 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]: @@ -418,10 +420,10 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - async def _cancel_initial( + async def _cancel_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -448,7 +450,11 @@ async def _cancel_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]: @@ -464,11 +470,11 @@ async def _cancel_initial( if cls: return cls(pipeline_response, None, response_headers) - _cancel_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel'} # type: ignore + _cancel_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore @distributed_trace_async - async def begin_cancel( + async def begin_cancel( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -485,9 +491,6 @@ async def begin_cancel( :type workspace_name: str :param id: The name and identifier for the Job. This is case-sensitive. :type id: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -501,7 +504,7 @@ async def begin_cancel( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: 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', @@ -534,7 +537,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_cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel'} # type: ignore + begin_cancel.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_labeling_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_labeling_jobs_operations.py index 3bd638d88d4c..c29db25275c4 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_labeling_jobs_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_labeling_jobs_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 @@ -69,9 +68,6 @@ def list( :type skip: str :param count: Number of labeling jobs to return. :type count: int - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either LabelingJobResourceArmPaginatedResult or the result of cls(response) @@ -127,7 +123,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]: @@ -141,10 +141,10 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -161,9 +161,6 @@ async def delete( :type workspace_name: str :param id: The name and identifier for the LabelingJob. :type id: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -189,7 +186,11 @@ async def delete( 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, 204]: @@ -200,7 +201,7 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore @distributed_trace_async @@ -229,9 +230,6 @@ async def get( :param include_label_categories: Boolean value to indicate Whether to include LabelCategories in response. :type include_label_categories: bool - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: LabelingJob, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.LabelingJob @@ -259,7 +257,11 @@ async def get( 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]: @@ -274,7 +276,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore async def _create_or_update_initial( @@ -309,7 +311,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]: @@ -331,7 +337,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore @distributed_trace_async @@ -355,9 +361,6 @@ async def begin_create_or_update( :type id: str :param body: LabelingJob definition object. :type body: ~azure.mgmt.machinelearningservices.models.LabelingJob - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -374,7 +377,7 @@ async def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.LabelingJob"] lro_delay = kwargs.pop( 'polling_interval', @@ -412,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_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore async def _export_labels_initial( self, @@ -449,7 +451,11 @@ async def _export_labels_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]: @@ -471,7 +477,7 @@ async def _export_labels_initial( return deserialized - _export_labels_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels'} # type: ignore + _export_labels_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore @distributed_trace_async @@ -495,9 +501,6 @@ async def begin_export_labels( :type id: str :param body: The export summary. :type body: ~azure.mgmt.machinelearningservices.models.ExportSummary - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -514,7 +517,7 @@ async def begin_export_labels( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.ExportSummary"] lro_delay = kwargs.pop( 'polling_interval', @@ -552,13 +555,12 @@ 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_export_labels.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels'} # type: ignore + begin_export_labels.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore @distributed_trace_async - async def pause( + async def pause( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -575,9 +577,6 @@ async def pause( :type workspace_name: str :param id: The name and identifier for the LabelingJob. :type id: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -603,7 +602,11 @@ async def pause( 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]: @@ -614,10 +617,10 @@ async def pause( if cls: return cls(pipeline_response, None, {}) - pause.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause'} # type: ignore + pause.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause"} # type: ignore - async def _resume_initial( + async def _resume_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -644,7 +647,11 @@ async def _resume_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]: @@ -660,11 +667,11 @@ async def _resume_initial( if cls: return cls(pipeline_response, None, response_headers) - _resume_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume'} # type: ignore + _resume_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore @distributed_trace_async - async def begin_resume( + async def begin_resume( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -681,9 +688,6 @@ async def begin_resume( :type workspace_name: str :param id: The name and identifier for the LabelingJob. :type id: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -697,7 +701,7 @@ async def begin_resume( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: 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', @@ -730,7 +734,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_resume.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume'} # type: ignore + begin_resume.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_model_containers_operations.py index fe05d8971044..5013a222b365 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_model_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_model_containers_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 @@ -70,9 +69,6 @@ def list( :type count: int :param list_view_type: View type for including/excluding (for example) archived entities. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ModelContainerResourceArmPaginatedResult or the result of cls(response) @@ -130,7 +126,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]: @@ -144,10 +144,10 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -164,9 +164,6 @@ async def delete( :type workspace_name: str :param name: Container name. This is case-sensitive. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -192,7 +189,11 @@ async def delete( 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, 204]: @@ -203,7 +204,7 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore @distributed_trace_async @@ -224,9 +225,6 @@ async def get( :type workspace_name: str :param name: Container name. This is case-sensitive. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ModelContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer @@ -252,7 +250,11 @@ async def get( 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]: @@ -267,7 +269,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore @distributed_trace_async @@ -291,9 +293,6 @@ async def create_or_update( :type name: str :param body: Container entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.ModelContainer - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ModelContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer @@ -323,7 +322,11 @@ async def create_or_update( 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]: @@ -342,5 +345,5 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_model_versions_operations.py index b5723cb2362a..1f9f681bbfac 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_model_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_model_versions_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 @@ -96,9 +95,6 @@ def list( :type feed: str :param list_view_type: View type for including/excluding (for example) archived entities. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ModelVersionResourceArmPaginatedResult or the result of cls(response) @@ -172,7 +168,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]: @@ -186,10 +186,10 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -209,9 +209,6 @@ async def delete( :type name: str :param version: Version identifier. This is case-sensitive. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -238,7 +235,11 @@ async def delete( 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, 204]: @@ -249,7 +250,7 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace_async @@ -273,9 +274,6 @@ async def get( :type name: str :param version: Version identifier. This is case-sensitive. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ModelVersion, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion @@ -302,7 +300,11 @@ async def get( 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]: @@ -317,7 +319,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace_async @@ -344,9 +346,6 @@ async def create_or_update( :type version: str :param body: Version entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.ModelVersion - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ModelVersion, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion @@ -377,7 +376,11 @@ async def create_or_update( 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]: @@ -396,5 +399,5 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_online_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_online_deployments_operations.py index 1005057a5186..a880752577b2 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_online_deployments_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_online_deployments_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 @@ -75,9 +74,6 @@ def list( :type top: int :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OnlineDeploymentTrackedResourceArmPaginatedResult or the result of cls(response) @@ -137,7 +133,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]: @@ -151,9 +151,9 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments"} # type: ignore - async def _delete_initial( + async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -182,7 +182,11 @@ async def _delete_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, 204]: @@ -199,11 +203,11 @@ async def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async - async def begin_delete( + async def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -223,9 +227,6 @@ async def begin_delete( :type endpoint_name: str :param deployment_name: Inference Endpoint Deployment name. :type deployment_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -239,7 +240,7 @@ async def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: 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', @@ -273,10 +274,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.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def get( @@ -299,9 +299,6 @@ async def get( :type endpoint_name: str :param deployment_name: Inference Endpoint Deployment name. :type deployment_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: OnlineDeployment, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.OnlineDeployment @@ -328,7 +325,11 @@ async def get( 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]: @@ -343,7 +344,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore async def _update_initial( @@ -380,7 +381,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]: @@ -403,7 +408,7 @@ async def _update_initial( return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async @@ -430,9 +435,6 @@ async def begin_update( :type deployment_name: str :param body: Online Endpoint entity to apply during operation. :type body: ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithSku - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -449,7 +451,7 @@ async def begin_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.OnlineDeployment"] lro_delay = kwargs.pop( 'polling_interval', @@ -488,10 +490,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_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore async def _create_or_update_initial( self, @@ -527,7 +528,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]: @@ -549,7 +554,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async @@ -576,9 +581,6 @@ async def begin_create_or_update( :type deployment_name: str :param body: Inference Endpoint entity to apply during operation. :type body: ~azure.mgmt.machinelearningservices.models.OnlineDeployment - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -595,7 +597,7 @@ async def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.OnlineDeployment"] lro_delay = kwargs.pop( 'polling_interval', @@ -634,10 +636,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.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace_async async def get_logs( @@ -663,9 +664,6 @@ async def get_logs( :type deployment_name: str :param body: The request containing parameters for retrieving logs. :type body: ~azure.mgmt.machinelearningservices.models.DeploymentLogsRequest - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentLogs, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.DeploymentLogs @@ -696,7 +694,11 @@ async def get_logs( 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]: @@ -711,7 +713,7 @@ async def get_logs( return deserialized - get_logs.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs'} # type: ignore + get_logs.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs"} # type: ignore @distributed_trace @@ -741,9 +743,6 @@ def list_skus( :type count: int :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SkuResourceArmPaginatedResult or the result of cls(response) @@ -803,7 +802,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]: @@ -817,4 +820,4 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_skus.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus'} # type: ignore + list_skus.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_online_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_online_endpoints_operations.py index bcb2a63e451a..e8333e8beee5 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_online_endpoints_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_online_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 @@ -87,9 +86,6 @@ def list( :type properties: str :param order_by: The option to order the response. :type order_by: str or ~azure.mgmt.machinelearningservices.models.OrderString - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OnlineEndpointTrackedResourceArmPaginatedResult or the result of cls(response) @@ -155,7 +151,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]: @@ -169,9 +169,9 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints"} # type: ignore - async def _delete_initial( + async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -198,7 +198,11 @@ async def _delete_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, 204]: @@ -215,11 +219,11 @@ async def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async - async def begin_delete( + async def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -236,9 +240,6 @@ async def begin_delete( :type workspace_name: str :param endpoint_name: Online Endpoint name. :type endpoint_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -252,7 +253,7 @@ async def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: 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', @@ -285,10 +286,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.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def get( @@ -308,9 +308,6 @@ async def get( :type workspace_name: str :param endpoint_name: Online Endpoint name. :type endpoint_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: OnlineEndpoint, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.OnlineEndpoint @@ -336,7 +333,11 @@ async def get( 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]: @@ -351,7 +352,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore async def _update_initial( @@ -386,7 +387,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]: @@ -409,7 +414,7 @@ async def _update_initial( return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore + _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async @@ -434,9 +439,6 @@ async def begin_update( :param body: Online Endpoint entity to apply during operation. :type body: ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithIdentity - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -453,7 +455,7 @@ async def begin_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.OnlineEndpoint"] lro_delay = kwargs.pop( 'polling_interval', @@ -491,10 +493,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_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore + begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore async def _create_or_update_initial( self, @@ -528,7 +529,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]: @@ -550,7 +555,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async @@ -574,9 +579,6 @@ async def begin_create_or_update( :type endpoint_name: str :param body: Online Endpoint entity to apply during operation. :type body: ~azure.mgmt.machinelearningservices.models.OnlineEndpoint - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -593,7 +595,7 @@ async def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.OnlineEndpoint"] lro_delay = kwargs.pop( 'polling_interval', @@ -631,10 +633,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.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace_async async def list_keys( @@ -654,9 +655,6 @@ async def list_keys( :type workspace_name: str :param endpoint_name: Online Endpoint name. :type endpoint_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: EndpointAuthKeys, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys @@ -682,7 +680,11 @@ async def list_keys( 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]: @@ -697,10 +699,10 @@ async def list_keys( return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys'} # type: ignore + list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys"} # type: ignore - async def _regenerate_keys_initial( + async def _regenerate_keys_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -732,7 +734,11 @@ async def _regenerate_keys_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]: @@ -748,11 +754,11 @@ async def _regenerate_keys_initial( if cls: return cls(pipeline_response, None, response_headers) - _regenerate_keys_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys'} # type: ignore + _regenerate_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore @distributed_trace_async - async def begin_regenerate_keys( + async def begin_regenerate_keys( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -772,9 +778,6 @@ async def begin_regenerate_keys( :type endpoint_name: str :param body: RegenerateKeys request . :type body: ~azure.mgmt.machinelearningservices.models.RegenerateEndpointKeysRequest - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -789,7 +792,7 @@ async def begin_regenerate_keys( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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', @@ -824,10 +827,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_regenerate_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys'} # type: ignore + begin_regenerate_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore @distributed_trace_async async def get_token( @@ -847,9 +849,6 @@ async def get_token( :type workspace_name: str :param endpoint_name: Online Endpoint name. :type endpoint_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: EndpointAuthToken, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthToken @@ -875,7 +874,11 @@ async def get_token( 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]: @@ -890,5 +893,5 @@ async def get_token( return deserialized - get_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token'} # type: ignore + get_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_operations.py index 45a87c2f66a3..4b016ee8371c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/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 @@ -53,9 +51,6 @@ def list( ) -> AsyncIterable["_models.AmlOperationListResult"]: """Lists all of the available Azure Machine Learning Services REST API operations. - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AmlOperationListResult or the result of cls(response) @@ -101,7 +96,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]: @@ -115,4 +114,4 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/providers/Microsoft.MachineLearningServices/operations'} # type: ignore + list.metadata = {'url': "/providers/Microsoft.MachineLearningServices/operations"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_private_endpoint_connections_operations.py index 69c40291d5db..023c936ebc7c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/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 -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 @@ -59,9 +58,6 @@ def list( :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result of cls(response) @@ -113,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]: @@ -127,7 +127,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections"} # type: ignore @distributed_trace_async async def get( @@ -146,9 +146,6 @@ async def get( :param private_endpoint_connection_name: The name of the private endpoint connection associated with the workspace. :type private_endpoint_connection_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: 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: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection @@ -174,7 +171,11 @@ async def get( 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]: @@ -189,7 +190,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace_async @@ -212,9 +213,6 @@ async def create_or_update( :type private_endpoint_connection_name: str :param properties: The private endpoint connection properties. :type properties: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: 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: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection @@ -244,7 +242,11 @@ async def create_or_update( 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]: @@ -259,11 +261,11 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -279,9 +281,6 @@ async def delete( :param private_endpoint_connection_name: The name of the private endpoint connection associated with the workspace. :type private_endpoint_connection_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -307,7 +306,11 @@ async def delete( 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, 204]: @@ -318,5 +321,5 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_private_link_resources_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_private_link_resources_operations.py index c762f8b03bcb..990798e11422 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_private_link_resources_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/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, 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 @@ -57,9 +56,6 @@ async def list( :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PrivateLinkResourceListResult, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.PrivateLinkResourceListResult @@ -84,7 +80,11 @@ async def list( 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]: @@ -99,5 +99,5 @@ async def list( return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_quotas_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_quotas_operations.py index f2cddd903de4..bf793b7dea97 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_quotas_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_quotas_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 @@ -59,9 +58,6 @@ async def update( :type location: str :param parameters: Quota update parameters. :type parameters: ~azure.mgmt.machinelearningservices.models.QuotaUpdateParameters - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: UpdateWorkspaceQuotasResult, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.UpdateWorkspaceQuotasResult @@ -89,7 +85,11 @@ async def update( 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 +104,7 @@ async def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas"} # type: ignore @distributed_trace @@ -117,9 +117,6 @@ def list( :param location: The location for which resource usage is queried. :type location: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ListWorkspaceQuotas or the result of cls(response) :rtype: @@ -168,7 +165,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,4 +183,4 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registries_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registries_operations.py index d1aebf6ba6e3..34eb1896daee 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registries_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registries_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 @@ -60,9 +59,6 @@ def list_by_subscription( :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either RegistryTrackedResourceArmPaginatedResult or the result of cls(response) @@ -112,7 +108,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 +126,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/registries'} # type: ignore + list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore @distributed_trace def list( @@ -143,9 +143,6 @@ def list( :type resource_group_name: str :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either RegistryTrackedResourceArmPaginatedResult or the result of cls(response) @@ -197,7 +194,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]: @@ -211,10 +212,10 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, registry_name: str, @@ -228,9 +229,6 @@ async def delete( :type resource_group_name: str :param registry_name: Name of registry. This is case-insensitive. :type registry_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -255,7 +253,11 @@ async def delete( 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, 204]: @@ -266,7 +268,7 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @distributed_trace_async @@ -284,9 +286,6 @@ async def get( :type resource_group_name: str :param registry_name: Name of registry. This is case-insensitive. :type registry_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Registry, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.Registry @@ -311,7 +310,11 @@ async def get( 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]: @@ -326,7 +329,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @distributed_trace_async @@ -347,9 +350,6 @@ async def update( :type registry_name: str :param body: Details required to create the registry. :type body: ~azure.mgmt.machinelearningservices.models.PartialRegistryPartialTrackedResource - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Registry, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.Registry @@ -378,7 +378,11 @@ async def update( 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]: @@ -393,7 +397,7 @@ async def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore async def _create_or_update_initial( @@ -426,10 +430,14 @@ 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]: + if response.status_code not in [200, 201, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) @@ -439,12 +447,15 @@ async def _create_or_update_initial( if response.status_code == 201: deserialized = self._deserialize('Registry', pipeline_response) + if response.status_code == 202: + deserialized = self._deserialize('Registry', pipeline_response) + if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @distributed_trace_async @@ -465,9 +476,6 @@ async def begin_create_or_update( :type registry_name: str :param body: Details required to create the registry. :type body: ~azure.mgmt.machinelearningservices.models.Registry - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -483,7 +491,7 @@ async def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.Registry"] lro_delay = kwargs.pop( 'polling_interval', @@ -520,7 +528,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_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_code_containers_operations.py index b1ee4bf31674..e0e6f07ef7c3 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_code_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_code_containers_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 @@ -66,9 +65,6 @@ def list( :type registry_name: str :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CodeContainerResourceArmPaginatedResult or the result of cls(response) @@ -122,7 +118,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]: @@ -136,9 +136,9 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes"} # type: ignore - async def _delete_initial( + async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, registry_name: str, @@ -165,7 +165,11 @@ async def _delete_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, 204]: @@ -182,11 +186,11 @@ async def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}"} # type: ignore @distributed_trace_async - async def begin_delete( + async def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, registry_name: str, @@ -203,9 +207,6 @@ async def begin_delete( :type registry_name: str :param name: Container name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -219,7 +220,7 @@ async def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: 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', @@ -252,10 +253,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.MachineLearningServices/registries/{registryName}/codes/{name}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}"} # type: ignore @distributed_trace_async async def get( @@ -275,9 +275,6 @@ async def get( :type registry_name: str :param name: Container name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: CodeContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer @@ -303,7 +300,11 @@ async def get( 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]: @@ -318,7 +319,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}"} # type: ignore async def _create_or_update_initial( @@ -353,7 +354,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]: @@ -375,7 +380,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}"} # type: ignore @distributed_trace_async @@ -399,9 +404,6 @@ async def begin_create_or_update( :type name: str :param body: Container entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.CodeContainer - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -418,7 +420,7 @@ async def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.CodeContainer"] lro_delay = kwargs.pop( 'polling_interval', @@ -456,7 +458,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_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_code_versions_operations.py index cc8a06bfb9b6..2fe62405587d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_code_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_code_versions_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 @@ -75,9 +74,6 @@ def list( :type top: int :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CodeVersionResourceArmPaginatedResult or the result of cls(response) @@ -137,7 +133,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]: @@ -151,9 +151,9 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions"} # type: ignore - async def _delete_initial( + async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, registry_name: str, @@ -182,7 +182,11 @@ async def _delete_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, 204]: @@ -199,11 +203,11 @@ async def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace_async - async def begin_delete( + async def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, registry_name: str, @@ -223,9 +227,6 @@ async def begin_delete( :type name: str :param version: Version identifier. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -239,7 +240,7 @@ async def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: 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', @@ -273,10 +274,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.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -299,9 +299,6 @@ async def get( :type name: str :param version: Version identifier. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: CodeVersion, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion @@ -328,7 +325,11 @@ async def get( 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]: @@ -343,7 +344,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}"} # type: ignore async def _create_or_update_initial( @@ -380,7 +381,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]: @@ -402,7 +407,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace_async @@ -429,9 +434,6 @@ async def begin_create_or_update( :type version: str :param body: Version entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.CodeVersion - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -448,7 +450,7 @@ async def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.CodeVersion"] lro_delay = kwargs.pop( 'polling_interval', @@ -487,7 +489,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_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_component_containers_operations.py index 7f80a508a4a5..0dfb849b76a6 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_component_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_component_containers_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 @@ -66,9 +65,6 @@ def list( :type registry_name: str :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ComponentContainerResourceArmPaginatedResult or the result of cls(response) @@ -122,7 +118,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]: @@ -136,9 +136,9 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components"} # type: ignore - async def _delete_initial( + async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, registry_name: str, @@ -165,7 +165,11 @@ async def _delete_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, 204]: @@ -182,11 +186,11 @@ async def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}"} # type: ignore @distributed_trace_async - async def begin_delete( + async def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, registry_name: str, @@ -203,9 +207,6 @@ async def begin_delete( :type registry_name: str :param name: Container name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -219,7 +220,7 @@ async def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: 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', @@ -252,10 +253,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.MachineLearningServices/registries/{registryName}/components/{name}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}"} # type: ignore @distributed_trace_async async def get( @@ -275,9 +275,6 @@ async def get( :type registry_name: str :param name: Container name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ComponentContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer @@ -303,7 +300,11 @@ async def get( 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]: @@ -318,7 +319,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}"} # type: ignore async def _create_or_update_initial( @@ -353,7 +354,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]: @@ -375,7 +380,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}"} # type: ignore @distributed_trace_async @@ -399,9 +404,6 @@ async def begin_create_or_update( :type name: str :param body: Container entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.ComponentContainer - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -418,7 +420,7 @@ async def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.ComponentContainer"] lro_delay = kwargs.pop( 'polling_interval', @@ -456,7 +458,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_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_component_versions_operations.py index cc26e48cec8d..5626f3374fac 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_component_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_component_versions_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 @@ -75,9 +74,6 @@ def list( :type top: int :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ComponentVersionResourceArmPaginatedResult or the result of cls(response) @@ -137,7 +133,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]: @@ -151,9 +151,9 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions"} # type: ignore - async def _delete_initial( + async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, registry_name: str, @@ -182,7 +182,11 @@ async def _delete_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, 204]: @@ -199,11 +203,11 @@ async def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace_async - async def begin_delete( + async def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, registry_name: str, @@ -223,9 +227,6 @@ async def begin_delete( :type name: str :param version: Version identifier. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -239,7 +240,7 @@ async def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: 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', @@ -273,10 +274,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.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -299,9 +299,6 @@ async def get( :type name: str :param version: Version identifier. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ComponentVersion, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion @@ -328,7 +325,11 @@ async def get( 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]: @@ -343,7 +344,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}"} # type: ignore async def _create_or_update_initial( @@ -380,7 +381,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]: @@ -402,7 +407,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace_async @@ -429,9 +434,6 @@ async def begin_create_or_update( :type version: str :param body: Version entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.ComponentVersion - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -448,7 +450,7 @@ async def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.ComponentVersion"] lro_delay = kwargs.pop( 'polling_interval', @@ -487,7 +489,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_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_environment_containers_operations.py index 4fb0f2bde4f6..8b8ced6bfdfa 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_environment_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_environment_containers_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 @@ -69,9 +68,6 @@ def list( :type skip: str :param list_view_type: View type for including/excluding (for example) archived entities. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either EnvironmentContainerResourceArmPaginatedResult or the result of cls(response) @@ -127,7 +123,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]: @@ -141,9 +141,9 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments"} # type: ignore - async def _delete_initial( + async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, registry_name: str, @@ -170,7 +170,11 @@ async def _delete_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, 204]: @@ -187,11 +191,11 @@ async def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}"} # type: ignore @distributed_trace_async - async def begin_delete( + async def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, registry_name: str, @@ -208,9 +212,6 @@ async def begin_delete( :type registry_name: str :param name: Container name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -224,7 +225,7 @@ async def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: 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', @@ -257,10 +258,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.MachineLearningServices/registries/{registryName}/environments/{name}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}"} # type: ignore @distributed_trace_async async def get( @@ -280,9 +280,6 @@ async def get( :type registry_name: str :param name: Container name. This is case-sensitive. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: EnvironmentContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer @@ -308,7 +305,11 @@ async def get( 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]: @@ -323,7 +324,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}"} # type: ignore async def _create_or_update_initial( @@ -358,7 +359,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]: @@ -380,7 +385,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}"} # type: ignore @distributed_trace_async @@ -404,9 +409,6 @@ async def begin_create_or_update( :type name: str :param body: Container entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -423,7 +425,7 @@ async def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.EnvironmentContainer"] lro_delay = kwargs.pop( 'polling_interval', @@ -461,7 +463,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_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_environment_versions_operations.py index 2f20cba00840..239914f864d2 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_environment_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_environment_versions_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 @@ -78,9 +77,6 @@ def list( :type skip: str :param list_view_type: View type for including/excluding (for example) archived entities. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either EnvironmentVersionResourceArmPaginatedResult or the result of cls(response) @@ -142,7 +138,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]: @@ -156,9 +156,9 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions"} # type: ignore - async def _delete_initial( + async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, registry_name: str, @@ -187,7 +187,11 @@ async def _delete_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, 204]: @@ -204,11 +208,11 @@ async def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace_async - async def begin_delete( + async def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, registry_name: str, @@ -228,9 +232,6 @@ async def begin_delete( :type name: str :param version: Version identifier. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -244,7 +245,7 @@ async def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: 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', @@ -278,10 +279,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.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -304,9 +304,6 @@ async def get( :type name: str :param version: Version identifier. This is case-sensitive. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: EnvironmentVersion, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion @@ -333,7 +330,11 @@ async def get( 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]: @@ -348,7 +349,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}"} # type: ignore async def _create_or_update_initial( @@ -385,7 +386,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]: @@ -407,7 +412,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace_async @@ -434,9 +439,6 @@ async def begin_create_or_update( :type version: str :param body: Version entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -453,7 +455,7 @@ async def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.EnvironmentVersion"] lro_delay = kwargs.pop( 'polling_interval', @@ -492,7 +494,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_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_model_containers_operations.py index e2e608d81dde..919decb21ad7 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_model_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_model_containers_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 @@ -69,9 +68,6 @@ def list( :type skip: str :param list_view_type: View type for including/excluding (for example) archived entities. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ModelContainerResourceArmPaginatedResult or the result of cls(response) @@ -127,7 +123,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]: @@ -141,9 +141,9 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models"} # type: ignore - async def _delete_initial( + async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, registry_name: str, @@ -170,7 +170,11 @@ async def _delete_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, 204]: @@ -187,11 +191,11 @@ async def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}"} # type: ignore @distributed_trace_async - async def begin_delete( + async def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, registry_name: str, @@ -208,9 +212,6 @@ async def begin_delete( :type registry_name: str :param name: Container name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -224,7 +225,7 @@ async def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: 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', @@ -257,10 +258,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.MachineLearningServices/registries/{registryName}/models/{name}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}"} # type: ignore @distributed_trace_async async def get( @@ -280,9 +280,6 @@ async def get( :type registry_name: str :param name: Container name. This is case-sensitive. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ModelContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer @@ -308,7 +305,11 @@ async def get( 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]: @@ -323,7 +324,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}"} # type: ignore async def _create_or_update_initial( @@ -358,7 +359,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]: @@ -380,7 +385,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}"} # type: ignore @distributed_trace_async @@ -404,9 +409,6 @@ async def begin_create_or_update( :type name: str :param body: Container entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.ModelContainer - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -423,7 +425,7 @@ async def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.ModelContainer"] lro_delay = kwargs.pop( 'polling_interval', @@ -461,7 +463,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_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_model_versions_operations.py index 3ad7c5843920..d60638f39eaa 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_model_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_registry_model_versions_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 @@ -92,9 +91,6 @@ def list( :type properties: str :param list_view_type: View type for including/excluding (for example) archived entities. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ModelVersionResourceArmPaginatedResult or the result of cls(response) @@ -164,7 +160,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]: @@ -178,9 +178,9 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions"} # type: ignore - async def _delete_initial( + async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, registry_name: str, @@ -209,7 +209,11 @@ async def _delete_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, 204]: @@ -226,11 +230,11 @@ async def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace_async - async def begin_delete( + async def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, registry_name: str, @@ -250,9 +254,6 @@ async def begin_delete( :type name: str :param version: Version identifier. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -266,7 +267,7 @@ async def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: 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', @@ -300,10 +301,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.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace_async async def get( @@ -326,9 +326,6 @@ async def get( :type name: str :param version: Version identifier. This is case-sensitive. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ModelVersion, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion @@ -355,7 +352,11 @@ async def get( 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]: @@ -370,7 +371,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}"} # type: ignore async def _create_or_update_initial( @@ -407,7 +408,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]: @@ -429,7 +434,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace_async @@ -456,9 +461,6 @@ async def begin_create_or_update( :type version: str :param body: Version entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.ModelVersion - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -475,7 +477,7 @@ async def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.ModelVersion"] lro_delay = kwargs.pop( 'polling_interval', @@ -514,7 +516,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_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_schedules_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_schedules_operations.py index babfae8ff950..d73251e23420 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_schedules_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_schedules_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 @@ -69,9 +68,6 @@ def list( :type skip: str :param list_view_type: Status filter for schedule. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ScheduleResourceArmPaginatedResult or the result of cls(response) @@ -127,7 +123,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]: @@ -141,9 +141,9 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules"} # type: ignore - async def _delete_initial( + async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -170,7 +170,11 @@ async def _delete_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, 204]: @@ -187,11 +191,11 @@ async def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore @distributed_trace_async - async def begin_delete( + async def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -208,9 +212,6 @@ async def begin_delete( :type workspace_name: str :param name: Schedule name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -224,7 +225,7 @@ async def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: 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', @@ -257,10 +258,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.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore @distributed_trace_async async def get( @@ -280,9 +280,6 @@ async def get( :type workspace_name: str :param name: Schedule name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Schedule, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.Schedule @@ -308,7 +305,11 @@ async def get( 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]: @@ -323,7 +324,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore async def _create_or_update_initial( @@ -358,7 +359,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]: @@ -380,7 +385,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore @distributed_trace_async @@ -404,9 +409,6 @@ async def begin_create_or_update( :type name: str :param body: Schedule definition. :type body: ~azure.mgmt.machinelearningservices.models.Schedule - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -422,7 +424,7 @@ async def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.Schedule"] lro_delay = kwargs.pop( 'polling_interval', @@ -460,7 +462,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_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_usages_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_usages_operations.py index c3b40a11e2f5..86be8ad1ca4e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_usages_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_usages_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 @@ -57,9 +55,6 @@ def list( :param location: The location for which resource usage is queried. :type location: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ListUsagesResult or the result of cls(response) :rtype: @@ -108,7 +103,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]: @@ -122,4 +121,4 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_virtual_machine_sizes_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_virtual_machine_sizes_operations.py index c98040033d5a..4bbc9f98e159 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_virtual_machine_sizes_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 @@ -54,9 +53,6 @@ async def list( :param location: The location upon which virtual-machine-sizes is queried. :type location: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: VirtualMachineSizeListResult, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.VirtualMachineSizeListResult @@ -80,7 +76,11 @@ async def list( 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]: @@ -95,5 +95,5 @@ async def list( return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_workspace_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_workspace_connections_operations.py index c454a3dba9e5..e29a99c87f44 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_workspace_connections_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_workspace_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 -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 @@ -66,9 +65,6 @@ async def create( :param parameters: The object for creating or updating a new workspace connection. :type parameters: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: WorkspaceConnectionPropertiesV2BasicResource, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource @@ -98,7 +94,11 @@ async def create( 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]: @@ -113,7 +113,7 @@ async def create( return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}'} # type: ignore + create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace_async @@ -132,9 +132,6 @@ async def get( :type workspace_name: str :param connection_name: Friendly name of the workspace connection. :type connection_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: WorkspaceConnectionPropertiesV2BasicResource, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource @@ -160,7 +157,11 @@ async def get( 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,11 +176,11 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -194,9 +195,6 @@ async def delete( :type workspace_name: str :param connection_name: Friendly name of the workspace connection. :type connection_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -222,7 +220,11 @@ async def delete( 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, 204]: @@ -233,7 +235,7 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace @@ -255,9 +257,6 @@ def list( :type target: str :param category: Category of the workspace connection. :type category: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult or the result of cls(response) @@ -313,7 +312,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]: @@ -327,4 +330,4 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_workspace_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_workspace_features_operations.py index f4a4e5acdaad..005b34f1cc62 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_workspace_features_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_workspace_features_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 @@ -59,9 +57,6 @@ def list( :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ListAmlUserFeatureResult or the result of cls(response) @@ -113,7 +108,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]: @@ -127,4 +126,4 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_workspaces_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_workspaces_operations.py index 979ed3df221e..c56bd5ff84f5 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_workspaces_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/aio/operations/_workspaces_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 @@ -61,9 +60,6 @@ async def get( :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Workspace, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.Workspace @@ -88,7 +84,11 @@ async def get( 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]: @@ -103,7 +103,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore async def _create_or_update_initial( @@ -136,7 +136,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, 202]: @@ -152,7 +156,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace_async @@ -171,9 +175,6 @@ async def begin_create_or_update( :type workspace_name: str :param parameters: The parameters for creating or updating a machine learning workspace. :type parameters: ~azure.mgmt.machinelearningservices.models.Workspace - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -190,7 +191,7 @@ async def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.Workspace"] lro_delay = kwargs.pop( 'polling_interval', @@ -227,12 +228,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.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - async def _delete_initial( + async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -257,7 +257,11 @@ async def _delete_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, 204]: @@ -267,11 +271,11 @@ async def _delete_initial( if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace_async - async def begin_delete( + async def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -283,9 +287,6 @@ async def begin_delete( :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -299,7 +300,7 @@ async def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: 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', @@ -331,10 +332,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.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore async def _update_initial( self, @@ -366,7 +366,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]: @@ -382,7 +386,7 @@ async def _update_initial( return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore + _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace_async @@ -401,9 +405,6 @@ async def begin_update( :type workspace_name: str :param parameters: The parameters for updating a machine learning workspace. :type parameters: ~azure.mgmt.machinelearningservices.models.WorkspaceUpdateParameters - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -420,7 +421,7 @@ async def begin_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.Workspace"] lro_delay = kwargs.pop( 'polling_interval', @@ -457,10 +458,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_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore + begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace def list_by_resource_group( @@ -475,9 +475,6 @@ def list_by_resource_group( :type resource_group_name: str :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either WorkspaceListResult or the result of cls(response) :rtype: @@ -528,7 +525,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]: @@ -542,7 +543,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.MachineLearningServices/workspaces'} # type: ignore + list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore async def _diagnose_initial( self, @@ -577,7 +578,11 @@ async def _diagnose_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]: @@ -599,7 +604,7 @@ async def _diagnose_initial( return deserialized - _diagnose_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose'} # type: ignore + _diagnose_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore @distributed_trace_async @@ -620,9 +625,6 @@ async def begin_diagnose( :type workspace_name: str :param parameters: The parameter of diagnosing workspace health. :type parameters: ~azure.mgmt.machinelearningservices.models.DiagnoseWorkspaceParameters - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -639,7 +641,7 @@ async def begin_diagnose( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.DiagnoseResponseResult"] lro_delay = kwargs.pop( 'polling_interval', @@ -676,10 +678,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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose'} # type: ignore + begin_diagnose.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore @distributed_trace_async async def list_keys( @@ -695,9 +696,6 @@ async def list_keys( :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ListWorkspaceKeysResult, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ListWorkspaceKeysResult @@ -722,7 +720,11 @@ async def list_keys( 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]: @@ -737,10 +739,10 @@ async def list_keys( return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys'} # type: ignore + list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys"} # type: ignore - async def _resync_keys_initial( + async def _resync_keys_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -765,7 +767,11 @@ async def _resync_keys_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]: @@ -775,11 +781,11 @@ async def _resync_keys_initial( if cls: return cls(pipeline_response, None, {}) - _resync_keys_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys'} # type: ignore + _resync_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore @distributed_trace_async - async def begin_resync_keys( + async def begin_resync_keys( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workspace_name: str, @@ -792,9 +798,6 @@ async def begin_resync_keys( :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -808,7 +811,7 @@ async def begin_resync_keys( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: 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', @@ -840,10 +843,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_resync_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys'} # type: ignore + begin_resync_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore @distributed_trace def list_by_subscription( @@ -855,9 +857,6 @@ def list_by_subscription( :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either WorkspaceListResult or the result of cls(response) :rtype: @@ -906,7 +905,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]: @@ -920,7 +923,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces'} # type: ignore + list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore @distributed_trace_async async def list_notebook_access_token( @@ -935,9 +938,6 @@ async def list_notebook_access_token( :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: NotebookAccessTokenResult, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.NotebookAccessTokenResult @@ -962,7 +962,11 @@ async def list_notebook_access_token( 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]: @@ -977,7 +981,7 @@ async def list_notebook_access_token( return deserialized - list_notebook_access_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken'} # type: ignore + list_notebook_access_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken"} # type: ignore async def _prepare_notebook_initial( @@ -1005,7 +1009,11 @@ async def _prepare_notebook_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]: @@ -1021,7 +1029,7 @@ async def _prepare_notebook_initial( return deserialized - _prepare_notebook_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook'} # type: ignore + _prepare_notebook_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore @distributed_trace_async @@ -1037,9 +1045,6 @@ async def begin_prepare_notebook( :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -1055,7 +1060,7 @@ async def begin_prepare_notebook( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: 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.NotebookResourceInfo"] lro_delay = kwargs.pop( 'polling_interval', @@ -1090,10 +1095,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_prepare_notebook.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook'} # type: ignore + begin_prepare_notebook.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore @distributed_trace_async async def list_storage_account_keys( @@ -1108,9 +1112,6 @@ async def list_storage_account_keys( :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ListStorageAccountKeysResult, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ListStorageAccountKeysResult @@ -1135,7 +1136,11 @@ async def list_storage_account_keys( 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]: @@ -1150,7 +1155,7 @@ async def list_storage_account_keys( return deserialized - list_storage_account_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys'} # type: ignore + list_storage_account_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys"} # type: ignore @distributed_trace_async @@ -1166,9 +1171,6 @@ async def list_notebook_keys( :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ListNotebookKeysResult, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult @@ -1193,7 +1195,11 @@ async def list_notebook_keys( 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]: @@ -1208,7 +1214,7 @@ async def list_notebook_keys( return deserialized - list_notebook_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys'} # type: ignore + list_notebook_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys"} # type: ignore @distributed_trace_async @@ -1228,9 +1234,6 @@ async def list_outbound_network_dependencies_endpoints( :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ExternalFQDNResponse, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ExternalFQDNResponse @@ -1255,7 +1258,11 @@ async def list_outbound_network_dependencies_endpoints( 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]: @@ -1270,5 +1277,5 @@ async def list_outbound_network_dependencies_endpoints( return deserialized - list_outbound_network_dependencies_endpoints.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints'} # type: ignore + list_outbound_network_dependencies_endpoints.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/_models.py index 804aefaf4691..cb054ec13ba9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/_models.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/_models.py @@ -381,7 +381,6 @@ def __init__( super(AKS, self).__init__(**kwargs) self.properties = kwargs.get('properties', None) self.compute_type = 'AKS' # type: str - self.compute_type = 'AKS' # type: str self.compute_location = None self.provisioning_state = None self.description = kwargs.get('description', None) @@ -517,7 +516,6 @@ def __init__( self.admin_kube_config = kwargs.get('admin_kube_config', None) self.image_pull_secret_name = kwargs.get('image_pull_secret_name', None) self.compute_type = 'AKS' # type: str - self.compute_type = 'AKS' # type: str class AksNetworkingConfiguration(msrest.serialization.Model): @@ -822,7 +820,6 @@ def __init__( super(AmlCompute, self).__init__(**kwargs) self.properties = kwargs.get('properties', None) self.compute_type = 'AmlCompute' # type: str - self.compute_type = 'AmlCompute' # type: str self.compute_location = None self.provisioning_state = None self.description = kwargs.get('description', None) @@ -2492,13 +2489,7 @@ def __init__( self.properties = kwargs.get('properties', None) self.tags = kwargs.get('tags', None) self.credentials = kwargs['credentials'] - self.datastore_type = 'AzureBlob' # type: str self.is_default = None - self.account_name = kwargs.get('account_name', None) - self.container_name = kwargs.get('container_name', None) - self.endpoint = kwargs.get('endpoint', None) - self.protocol = kwargs.get('protocol', None) - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) class AzureDataLakeGen1Datastore(DatastoreProperties, AzureDatastore): @@ -2591,10 +2582,7 @@ def __init__( self.properties = kwargs.get('properties', None) self.tags = kwargs.get('tags', None) self.credentials = kwargs['credentials'] - self.datastore_type = 'AzureDataLakeGen1' # type: str self.is_default = None - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) - self.store_name = kwargs['store_name'] class AzureDataLakeGen2Datastore(DatastoreProperties, AzureDatastore): @@ -2706,13 +2694,7 @@ def __init__( self.properties = kwargs.get('properties', None) self.tags = kwargs.get('tags', None) self.credentials = kwargs['credentials'] - self.datastore_type = 'AzureDataLakeGen2' # type: str self.is_default = None - self.account_name = kwargs['account_name'] - self.endpoint = kwargs.get('endpoint', None) - self.filesystem = kwargs['filesystem'] - self.protocol = kwargs.get('protocol', None) - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) class AzureFileDatastore(DatastoreProperties, AzureDatastore): @@ -2826,13 +2808,7 @@ def __init__( self.properties = kwargs.get('properties', None) self.tags = kwargs.get('tags', None) self.credentials = kwargs['credentials'] - self.datastore_type = 'AzureFile' # type: str self.is_default = None - self.account_name = kwargs['account_name'] - self.endpoint = kwargs.get('endpoint', None) - self.file_share_name = kwargs['file_share_name'] - self.protocol = kwargs.get('protocol', None) - self.service_data_access_auth_identity = kwargs.get('service_data_access_auth_identity', None) class EarlyTerminationPolicy(msrest.serialization.Model): @@ -4195,11 +4171,7 @@ def __init__( self.training_settings = kwargs.get('training_settings', None) self.log_verbosity = kwargs.get('log_verbosity', None) self.target_column_name = kwargs.get('target_column_name', None) - self.task_type = 'Classification' # type: str self.training_data = kwargs['training_data'] - self.positive_label = kwargs.get('positive_label', None) - self.primary_metric = kwargs.get('primary_metric', None) - self.training_settings = kwargs.get('training_settings', None) class TrainingSettings(msrest.serialization.Model): @@ -5470,7 +5442,6 @@ def __init__( super(ComputeInstance, self).__init__(**kwargs) self.properties = kwargs.get('properties', None) self.compute_type = 'ComputeInstance' # type: str - self.compute_type = 'ComputeInstance' # type: str self.compute_location = None self.provisioning_state = None self.description = kwargs.get('description', None) @@ -6179,10 +6150,6 @@ def __init__( self.name = None self.type = None self.system_data = None - self.identity = kwargs.get('identity', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.sku = kwargs.get('sku', None) class ComputeSchedules(msrest.serialization.Model): @@ -6663,7 +6630,6 @@ def __init__( self.uri = kwargs['uri'] self.job_input_type = 'custom_model' # type: str self.description = kwargs.get('description', None) - self.job_input_type = 'custom_model' # type: str class JobOutput(msrest.serialization.Model): @@ -6755,7 +6721,6 @@ def __init__( self.uri = kwargs.get('uri', None) self.job_output_type = 'custom_model' # type: str self.description = kwargs.get('description', None) - self.job_output_type = 'custom_model' # type: str class CustomNCrossValidations(NCrossValidations): @@ -7064,7 +7029,6 @@ def __init__( super(Databricks, self).__init__(**kwargs) self.properties = kwargs.get('properties', None) self.compute_type = 'Databricks' # type: str - self.compute_type = 'Databricks' # type: str self.compute_location = None self.provisioning_state = None self.description = kwargs.get('description', None) @@ -7132,7 +7096,6 @@ def __init__( super(DatabricksComputeSecrets, self).__init__(**kwargs) self.databricks_access_token = kwargs.get('databricks_access_token', None) self.compute_type = 'Databricks' # type: str - self.compute_type = 'Databricks' # type: str class DatabricksProperties(msrest.serialization.Model): @@ -7489,7 +7452,6 @@ def __init__( super(DataLakeAnalytics, self).__init__(**kwargs) self.properties = kwargs.get('properties', None) self.compute_type = 'DataLakeAnalytics' # type: str - self.compute_type = 'DataLakeAnalytics' # type: str self.compute_location = None self.provisioning_state = None self.description = kwargs.get('description', None) @@ -9517,11 +9479,7 @@ def __init__( self.training_settings = kwargs.get('training_settings', None) self.log_verbosity = kwargs.get('log_verbosity', None) self.target_column_name = kwargs.get('target_column_name', None) - self.task_type = 'Forecasting' # type: str self.training_data = kwargs['training_data'] - self.forecasting_settings = kwargs.get('forecasting_settings', None) - self.primary_metric = kwargs.get('primary_metric', None) - self.training_settings = kwargs.get('training_settings', None) class ForecastingSettings(msrest.serialization.Model): @@ -10057,7 +10015,6 @@ def __init__( super(HDInsight, self).__init__(**kwargs) self.properties = kwargs.get('properties', None) self.compute_type = 'HDInsight' # type: str - self.compute_type = 'HDInsight' # type: str self.compute_location = None self.provisioning_state = None self.description = kwargs.get('description', None) @@ -10463,9 +10420,7 @@ def __init__( self.primary_metric = kwargs.get('primary_metric', None) self.log_verbosity = kwargs.get('log_verbosity', None) self.target_column_name = kwargs.get('target_column_name', None) - self.task_type = 'ImageClassification' # type: str self.training_data = kwargs['training_data'] - self.primary_metric = kwargs.get('primary_metric', None) class ImageClassificationMultilabel(AutoMLVertical, ImageClassificationBase): @@ -10580,9 +10535,7 @@ def __init__( self.primary_metric = kwargs.get('primary_metric', None) self.log_verbosity = kwargs.get('log_verbosity', None) self.target_column_name = kwargs.get('target_column_name', None) - self.task_type = 'ImageClassificationMultilabel' # type: str self.training_data = kwargs['training_data'] - self.primary_metric = kwargs.get('primary_metric', None) class ImageObjectDetectionBase(ImageVertical): @@ -10762,9 +10715,7 @@ def __init__( self.primary_metric = kwargs.get('primary_metric', None) self.log_verbosity = kwargs.get('log_verbosity', None) self.target_column_name = kwargs.get('target_column_name', None) - self.task_type = 'ImageInstanceSegmentation' # type: str self.training_data = kwargs['training_data'] - self.primary_metric = kwargs.get('primary_metric', None) class ImageLimitSettings(msrest.serialization.Model): @@ -12639,9 +12590,7 @@ def __init__( self.primary_metric = kwargs.get('primary_metric', None) self.log_verbosity = kwargs.get('log_verbosity', None) self.target_column_name = kwargs.get('target_column_name', None) - self.task_type = 'ImageObjectDetection' # type: str self.training_data = kwargs['training_data'] - self.primary_metric = kwargs.get('primary_metric', None) class ImageSweepSettings(msrest.serialization.Model): @@ -13116,8 +13065,6 @@ def __init__( self.kerberos_realm = kwargs['kerberos_realm'] self.credentials_type = 'KerberosKeytab' # type: str self.secrets = kwargs['secrets'] - self.credentials_type = 'KerberosKeytab' # type: str - self.secrets = kwargs['secrets'] class KerberosKeytabSecrets(DatastoreSecrets): @@ -13212,8 +13159,6 @@ def __init__( self.kerberos_realm = kwargs['kerberos_realm'] self.credentials_type = 'KerberosPassword' # type: str self.secrets = kwargs['secrets'] - self.credentials_type = 'KerberosPassword' # type: str - self.secrets = kwargs['secrets'] class KerberosPasswordSecrets(DatastoreSecrets): @@ -13354,7 +13299,6 @@ def __init__( super(Kubernetes, self).__init__(**kwargs) self.properties = kwargs.get('properties', None) self.compute_type = 'Kubernetes' # type: str - self.compute_type = 'Kubernetes' # type: str self.compute_location = None self.provisioning_state = None self.description = kwargs.get('description', None) @@ -14973,7 +14917,6 @@ def __init__( self.uri = kwargs['uri'] self.job_input_type = 'mlflow_model' # type: str self.description = kwargs.get('description', None) - self.job_input_type = 'mlflow_model' # type: str class MLFlowModelJobOutput(JobOutput, AssetJobOutput): @@ -15023,7 +14966,6 @@ def __init__( self.uri = kwargs.get('uri', None) self.job_output_type = 'mlflow_model' # type: str self.description = kwargs.get('description', None) - self.job_output_type = 'mlflow_model' # type: str class MLTableData(DataVersionBaseProperties): @@ -15141,7 +15083,6 @@ def __init__( self.uri = kwargs['uri'] self.job_input_type = 'mltable' # type: str self.description = kwargs.get('description', None) - self.job_input_type = 'mltable' # type: str class MLTableJobOutput(JobOutput, AssetJobOutput): @@ -15191,7 +15132,6 @@ def __init__( self.uri = kwargs.get('uri', None) self.job_output_type = 'mltable' # type: str self.description = kwargs.get('description', None) - self.job_output_type = 'mltable' # type: str class ModelContainer(Resource): @@ -18227,10 +18167,7 @@ def __init__( self.training_settings = kwargs.get('training_settings', None) self.log_verbosity = kwargs.get('log_verbosity', None) self.target_column_name = kwargs.get('target_column_name', None) - self.task_type = 'Regression' # type: str self.training_data = kwargs['training_data'] - self.primary_metric = kwargs.get('primary_metric', None) - self.training_settings = kwargs.get('training_settings', None) class RegressionTrainingSettings(TrainingSettings): @@ -21016,9 +20953,7 @@ def __init__( self.primary_metric = kwargs.get('primary_metric', None) self.log_verbosity = kwargs.get('log_verbosity', None) self.target_column_name = kwargs.get('target_column_name', None) - self.task_type = 'TextClassification' # type: str self.training_data = kwargs['training_data'] - self.primary_metric = kwargs.get('primary_metric', None) class TextClassificationMultilabel(AutoMLVertical, NlpVertical): @@ -21125,9 +21060,7 @@ def __init__( self.primary_metric = None self.log_verbosity = kwargs.get('log_verbosity', None) self.target_column_name = kwargs.get('target_column_name', None) - self.task_type = 'TextClassificationMultilabel' # type: str self.training_data = kwargs['training_data'] - self.primary_metric = None class TextNer(AutoMLVertical, NlpVertical): @@ -21235,9 +21168,7 @@ def __init__( self.primary_metric = None self.log_verbosity = kwargs.get('log_verbosity', None) self.target_column_name = kwargs.get('target_column_name', None) - self.task_type = 'TextNER' # type: str self.training_data = kwargs['training_data'] - self.primary_metric = None class TmpfsOptions(msrest.serialization.Model): @@ -21377,7 +21308,6 @@ def __init__( self.uri = kwargs['uri'] self.job_input_type = 'triton_model' # type: str self.description = kwargs.get('description', None) - self.job_input_type = 'triton_model' # type: str class TritonModelJobOutput(JobOutput, AssetJobOutput): @@ -21427,7 +21357,6 @@ def __init__( self.uri = kwargs.get('uri', None) self.job_output_type = 'triton_model' # type: str self.description = kwargs.get('description', None) - self.job_output_type = 'triton_model' # type: str class TruncationSelectionPolicy(EarlyTerminationPolicy): @@ -21672,7 +21601,6 @@ def __init__( self.uri = kwargs['uri'] self.job_input_type = 'uri_file' # type: str self.description = kwargs.get('description', None) - self.job_input_type = 'uri_file' # type: str class UriFileJobOutput(JobOutput, AssetJobOutput): @@ -21722,7 +21650,6 @@ def __init__( self.uri = kwargs.get('uri', None) self.job_output_type = 'uri_file' # type: str self.description = kwargs.get('description', None) - self.job_output_type = 'uri_file' # type: str class UriFolderDataVersion(DataVersionBaseProperties): @@ -21834,7 +21761,6 @@ def __init__( self.uri = kwargs['uri'] self.job_input_type = 'uri_folder' # type: str self.description = kwargs.get('description', None) - self.job_input_type = 'uri_folder' # type: str class UriFolderJobOutput(JobOutput, AssetJobOutput): @@ -21884,7 +21810,6 @@ def __init__( self.uri = kwargs.get('uri', None) self.job_output_type = 'uri_folder' # type: str self.description = kwargs.get('description', None) - self.job_output_type = 'uri_folder' # type: str class Usage(msrest.serialization.Model): @@ -22290,7 +22215,6 @@ def __init__( super(VirtualMachine, self).__init__(**kwargs) self.properties = kwargs.get('properties', None) self.compute_type = 'VirtualMachine' # type: str - self.compute_type = 'VirtualMachine' # type: str self.compute_location = None self.provisioning_state = None self.description = kwargs.get('description', None) @@ -22448,7 +22372,6 @@ def __init__( super(VirtualMachineSecrets, self).__init__(**kwargs) self.administrator_account = kwargs.get('administrator_account', None) self.compute_type = 'VirtualMachine' # type: str - self.compute_type = 'VirtualMachine' # type: str class VirtualMachineSize(msrest.serialization.Model): diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/_models_py3.py index a75b2649ed39..10bb1d46fc96 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/_models_py3.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/models/_models_py3.py @@ -404,7 +404,6 @@ def __init__( super(AKS, self).__init__(description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) self.properties = properties self.compute_type = 'AKS' # type: str - self.compute_type = 'AKS' # type: str self.compute_location = None self.provisioning_state = None self.description = description @@ -548,7 +547,6 @@ def __init__( self.admin_kube_config = admin_kube_config self.image_pull_secret_name = image_pull_secret_name self.compute_type = 'AKS' # type: str - self.compute_type = 'AKS' # type: str class AksNetworkingConfiguration(msrest.serialization.Model): @@ -874,7 +872,6 @@ def __init__( super(AmlCompute, self).__init__(description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) self.properties = properties self.compute_type = 'AmlCompute' # type: str - self.compute_type = 'AmlCompute' # type: str self.compute_location = None self.provisioning_state = None self.description = description @@ -2657,13 +2654,7 @@ def __init__( self.properties = properties self.tags = tags self.credentials = credentials - self.datastore_type = 'AzureBlob' # type: str self.is_default = None - self.account_name = account_name - self.container_name = container_name - self.endpoint = endpoint - self.protocol = protocol - self.service_data_access_auth_identity = service_data_access_auth_identity class AzureDataLakeGen1Datastore(DatastoreProperties, AzureDatastore): @@ -2765,10 +2756,7 @@ def __init__( self.properties = properties self.tags = tags self.credentials = credentials - self.datastore_type = 'AzureDataLakeGen1' # type: str self.is_default = None - self.service_data_access_auth_identity = service_data_access_auth_identity - self.store_name = store_name class AzureDataLakeGen2Datastore(DatastoreProperties, AzureDatastore): @@ -2892,13 +2880,7 @@ def __init__( self.properties = properties self.tags = tags self.credentials = credentials - self.datastore_type = 'AzureDataLakeGen2' # type: str self.is_default = None - self.account_name = account_name - self.endpoint = endpoint - self.filesystem = filesystem - self.protocol = protocol - self.service_data_access_auth_identity = service_data_access_auth_identity class AzureFileDatastore(DatastoreProperties, AzureDatastore): @@ -3024,13 +3006,7 @@ def __init__( self.properties = properties self.tags = tags self.credentials = credentials - self.datastore_type = 'AzureFile' # type: str self.is_default = None - self.account_name = account_name - self.endpoint = endpoint - self.file_share_name = file_share_name - self.protocol = protocol - self.service_data_access_auth_identity = service_data_access_auth_identity class EarlyTerminationPolicy(msrest.serialization.Model): @@ -4510,11 +4486,7 @@ def __init__( self.training_settings = training_settings self.log_verbosity = log_verbosity self.target_column_name = target_column_name - self.task_type = 'Classification' # type: str self.training_data = training_data - self.positive_label = positive_label - self.primary_metric = primary_metric - self.training_settings = training_settings class TrainingSettings(msrest.serialization.Model): @@ -5887,7 +5859,6 @@ def __init__( super(ComputeInstance, self).__init__(description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) self.properties = properties self.compute_type = 'ComputeInstance' # type: str - self.compute_type = 'ComputeInstance' # type: str self.compute_location = None self.provisioning_state = None self.description = description @@ -6652,10 +6623,6 @@ def __init__( self.name = None self.type = None self.system_data = None - self.identity = identity - self.location = location - self.tags = tags - self.sku = sku class ComputeSchedules(msrest.serialization.Model): @@ -7167,7 +7134,6 @@ def __init__( self.uri = uri self.job_input_type = 'custom_model' # type: str self.description = description - self.job_input_type = 'custom_model' # type: str class JobOutput(msrest.serialization.Model): @@ -7265,7 +7231,6 @@ def __init__( self.uri = uri self.job_output_type = 'custom_model' # type: str self.description = description - self.job_output_type = 'custom_model' # type: str class CustomNCrossValidations(NCrossValidations): @@ -7597,7 +7562,6 @@ def __init__( super(Databricks, self).__init__(description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) self.properties = properties self.compute_type = 'Databricks' # type: str - self.compute_type = 'Databricks' # type: str self.compute_location = None self.provisioning_state = None self.description = description @@ -7669,7 +7633,6 @@ def __init__( super(DatabricksComputeSecrets, self).__init__(databricks_access_token=databricks_access_token, **kwargs) self.databricks_access_token = databricks_access_token self.compute_type = 'Databricks' # type: str - self.compute_type = 'Databricks' # type: str class DatabricksProperties(msrest.serialization.Model): @@ -8051,7 +8014,6 @@ def __init__( super(DataLakeAnalytics, self).__init__(description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) self.properties = properties self.compute_type = 'DataLakeAnalytics' # type: str - self.compute_type = 'DataLakeAnalytics' # type: str self.compute_location = None self.provisioning_state = None self.description = description @@ -10234,11 +10196,7 @@ def __init__( self.training_settings = training_settings self.log_verbosity = log_verbosity self.target_column_name = target_column_name - self.task_type = 'Forecasting' # type: str self.training_data = training_data - self.forecasting_settings = forecasting_settings - self.primary_metric = primary_metric - self.training_settings = training_settings class ForecastingSettings(msrest.serialization.Model): @@ -10823,7 +10781,6 @@ def __init__( super(HDInsight, self).__init__(description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) self.properties = properties self.compute_type = 'HDInsight' # type: str - self.compute_type = 'HDInsight' # type: str self.compute_location = None self.provisioning_state = None self.description = description @@ -11266,9 +11223,7 @@ def __init__( self.primary_metric = primary_metric self.log_verbosity = log_verbosity self.target_column_name = target_column_name - self.task_type = 'ImageClassification' # type: str self.training_data = training_data - self.primary_metric = primary_metric class ImageClassificationMultilabel(AutoMLVertical, ImageClassificationBase): @@ -11394,9 +11349,7 @@ def __init__( self.primary_metric = primary_metric self.log_verbosity = log_verbosity self.target_column_name = target_column_name - self.task_type = 'ImageClassificationMultilabel' # type: str self.training_data = training_data - self.primary_metric = primary_metric class ImageObjectDetectionBase(ImageVertical): @@ -11594,9 +11547,7 @@ def __init__( self.primary_metric = primary_metric self.log_verbosity = log_verbosity self.target_column_name = target_column_name - self.task_type = 'ImageInstanceSegmentation' # type: str self.training_data = training_data - self.primary_metric = primary_metric class ImageLimitSettings(msrest.serialization.Model): @@ -13706,9 +13657,7 @@ def __init__( self.primary_metric = primary_metric self.log_verbosity = log_verbosity self.target_column_name = target_column_name - self.task_type = 'ImageObjectDetection' # type: str self.training_data = training_data - self.primary_metric = primary_metric class ImageSweepSettings(msrest.serialization.Model): @@ -14224,8 +14173,6 @@ def __init__( self.kerberos_realm = kerberos_realm self.credentials_type = 'KerberosKeytab' # type: str self.secrets = secrets - self.credentials_type = 'KerberosKeytab' # type: str - self.secrets = secrets class KerberosKeytabSecrets(DatastoreSecrets): @@ -14327,8 +14274,6 @@ def __init__( self.kerberos_realm = kerberos_realm self.credentials_type = 'KerberosPassword' # type: str self.secrets = secrets - self.credentials_type = 'KerberosPassword' # type: str - self.secrets = secrets class KerberosPasswordSecrets(DatastoreSecrets): @@ -14478,7 +14423,6 @@ def __init__( super(Kubernetes, self).__init__(description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) self.properties = properties self.compute_type = 'Kubernetes' # type: str - self.compute_type = 'Kubernetes' # type: str self.compute_location = None self.provisioning_state = None self.description = description @@ -16220,7 +16164,6 @@ def __init__( self.uri = uri self.job_input_type = 'mlflow_model' # type: str self.description = description - self.job_input_type = 'mlflow_model' # type: str class MLFlowModelJobOutput(JobOutput, AssetJobOutput): @@ -16274,7 +16217,6 @@ def __init__( self.uri = uri self.job_output_type = 'mlflow_model' # type: str self.description = description - self.job_output_type = 'mlflow_model' # type: str class MLTableData(DataVersionBaseProperties): @@ -16404,7 +16346,6 @@ def __init__( self.uri = uri self.job_input_type = 'mltable' # type: str self.description = description - self.job_input_type = 'mltable' # type: str class MLTableJobOutput(JobOutput, AssetJobOutput): @@ -16458,7 +16399,6 @@ def __init__( self.uri = uri self.job_output_type = 'mltable' # type: str self.description = description - self.job_output_type = 'mltable' # type: str class ModelContainer(Resource): @@ -19766,10 +19706,7 @@ def __init__( self.training_settings = training_settings self.log_verbosity = log_verbosity self.target_column_name = target_column_name - self.task_type = 'Regression' # type: str self.training_data = training_data - self.primary_metric = primary_metric - self.training_settings = training_settings class RegressionTrainingSettings(TrainingSettings): @@ -22828,9 +22765,7 @@ def __init__( self.primary_metric = primary_metric self.log_verbosity = log_verbosity self.target_column_name = target_column_name - self.task_type = 'TextClassification' # type: str self.training_data = training_data - self.primary_metric = primary_metric class TextClassificationMultilabel(AutoMLVertical, NlpVertical): @@ -22947,9 +22882,7 @@ def __init__( self.primary_metric = None self.log_verbosity = log_verbosity self.target_column_name = target_column_name - self.task_type = 'TextClassificationMultilabel' # type: str self.training_data = training_data - self.primary_metric = None class TextNer(AutoMLVertical, NlpVertical): @@ -23067,9 +23000,7 @@ def __init__( self.primary_metric = None self.log_verbosity = log_verbosity self.target_column_name = target_column_name - self.task_type = 'TextNER' # type: str self.training_data = training_data - self.primary_metric = None class TmpfsOptions(msrest.serialization.Model): @@ -23222,7 +23153,6 @@ def __init__( self.uri = uri self.job_input_type = 'triton_model' # type: str self.description = description - self.job_input_type = 'triton_model' # type: str class TritonModelJobOutput(JobOutput, AssetJobOutput): @@ -23276,7 +23206,6 @@ def __init__( self.uri = uri self.job_output_type = 'triton_model' # type: str self.description = description - self.job_output_type = 'triton_model' # type: str class TruncationSelectionPolicy(EarlyTerminationPolicy): @@ -23539,7 +23468,6 @@ def __init__( self.uri = uri self.job_input_type = 'uri_file' # type: str self.description = description - self.job_input_type = 'uri_file' # type: str class UriFileJobOutput(JobOutput, AssetJobOutput): @@ -23593,7 +23521,6 @@ def __init__( self.uri = uri self.job_output_type = 'uri_file' # type: str self.description = description - self.job_output_type = 'uri_file' # type: str class UriFolderDataVersion(DataVersionBaseProperties): @@ -23716,7 +23643,6 @@ def __init__( self.uri = uri self.job_input_type = 'uri_folder' # type: str self.description = description - self.job_input_type = 'uri_folder' # type: str class UriFolderJobOutput(JobOutput, AssetJobOutput): @@ -23770,7 +23696,6 @@ def __init__( self.uri = uri self.job_output_type = 'uri_folder' # type: str self.description = description - self.job_output_type = 'uri_folder' # type: str class Usage(msrest.serialization.Model): @@ -24197,7 +24122,6 @@ def __init__( super(VirtualMachine, self).__init__(description=description, resource_id=resource_id, disable_local_auth=disable_local_auth, properties=properties, **kwargs) self.properties = properties self.compute_type = 'VirtualMachine' # type: str - self.compute_type = 'VirtualMachine' # type: str self.compute_location = None self.provisioning_state = None self.description = description @@ -24368,7 +24292,6 @@ def __init__( super(VirtualMachineSecrets, self).__init__(administrator_account=administrator_account, **kwargs) self.administrator_account = administrator_account self.compute_type = 'VirtualMachine' # type: str - self.compute_type = 'VirtualMachine' # type: str class VirtualMachineSize(msrest.serialization.Model): diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_batch_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_batch_deployments_operations.py index 5851933c7860..cc437c31c4ca 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_batch_deployments_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_batch_deployments_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 TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,14 +19,13 @@ 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 if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +48,7 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -56,27 +56,27 @@ def build_list_request( "endpointName": _SERIALIZER.url("endpoint_name", 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') if order_by is not None: - query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') + _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, '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 ) @@ -94,7 +94,7 @@ def build_delete_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -103,21 +103,21 @@ def build_delete_request_initial( "deploymentName": _SERIALIZER.url("deployment_name", deployment_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 ) @@ -135,7 +135,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -144,21 +144,21 @@ def build_get_request( "deploymentName": _SERIALIZER.url("deployment_name", deployment_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 ) @@ -177,7 +177,7 @@ def build_update_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -186,23 +186,23 @@ def build_update_request_initial( "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), } - 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, **kwargs ) @@ -221,7 +221,7 @@ def build_create_or_update_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -230,23 +230,23 @@ def build_create_or_update_request_initial( "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), } - 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, **kwargs ) @@ -301,9 +301,6 @@ def list( :type top: int :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BatchDeploymentTrackedResourceArmPaginatedResult or the result of cls(response) @@ -363,7 +360,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]: @@ -377,9 +378,9 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments"} # type: ignore - def _delete_initial( + def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -409,7 +410,11 @@ def _delete_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, 204]: @@ -426,11 +431,11 @@ def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace - def begin_delete( + def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -451,9 +456,6 @@ def begin_delete( :type endpoint_name: str :param deployment_name: Inference deployment identifier. :type deployment_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -467,7 +469,7 @@ def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: 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', @@ -501,10 +503,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.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def get( @@ -528,9 +529,6 @@ def get( :type endpoint_name: str :param deployment_name: The identifier for the Batch deployments. :type deployment_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: BatchDeployment, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.BatchDeployment @@ -557,7 +555,11 @@ def get( 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]: @@ -572,7 +574,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore def _update_initial( @@ -610,7 +612,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]: @@ -633,7 +639,7 @@ def _update_initial( return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace @@ -662,9 +668,6 @@ def begin_update( :param body: Batch inference deployment definition object. :type body: ~azure.mgmt.machinelearningservices.models.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -681,7 +684,7 @@ def begin_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.BatchDeployment"] lro_delay = kwargs.pop( 'polling_interval', @@ -720,10 +723,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_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore def _create_or_update_initial( self, @@ -760,7 +762,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]: @@ -782,7 +788,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace @@ -810,9 +816,6 @@ def begin_create_or_update( :type deployment_name: str :param body: Batch inference deployment definition object. :type body: ~azure.mgmt.machinelearningservices.models.BatchDeployment - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -829,7 +832,7 @@ def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.BatchDeployment"] lro_delay = kwargs.pop( 'polling_interval', @@ -868,7 +871,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_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_batch_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_batch_endpoints_operations.py index b179f561a8a7..ecfd3ea617d3 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_batch_endpoints_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_batch_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 TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,14 +19,13 @@ 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 if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,32 +46,32 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), "workspaceName": _SERIALIZER.url("workspace_name", workspace_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') if count is not None: - query_parameters['count'] = _SERIALIZER.query("count", count, 'int') + _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, '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 ) @@ -88,7 +88,7 @@ def build_delete_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -96,21 +96,21 @@ def build_delete_request_initial( "endpointName": _SERIALIZER.url("endpoint_name", 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 ) @@ -127,7 +127,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -135,21 +135,21 @@ def build_get_request( "endpointName": _SERIALIZER.url("endpoint_name", 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 ) @@ -167,7 +167,7 @@ def build_update_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -175,23 +175,23 @@ def build_update_request_initial( "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), } - 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, **kwargs ) @@ -209,7 +209,7 @@ def build_create_or_update_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -217,23 +217,23 @@ def build_create_or_update_request_initial( "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), } - 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, **kwargs ) @@ -250,7 +250,7 @@ def build_list_keys_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -258,21 +258,21 @@ def build_list_keys_request( "endpointName": _SERIALIZER.url("endpoint_name", 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="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -321,9 +321,6 @@ def list( :type count: int :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BatchEndpointTrackedResourceArmPaginatedResult or the result of cls(response) @@ -379,7 +376,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]: @@ -393,9 +394,9 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints"} # type: ignore - def _delete_initial( + def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -423,7 +424,11 @@ def _delete_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, 204]: @@ -440,11 +445,11 @@ def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace - def begin_delete( + def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -462,9 +467,6 @@ def begin_delete( :type workspace_name: str :param endpoint_name: Inference Endpoint name. :type endpoint_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -478,7 +480,7 @@ def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: 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', @@ -511,10 +513,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.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace def get( @@ -535,9 +536,6 @@ def get( :type workspace_name: str :param endpoint_name: Name for the Batch Endpoint. :type endpoint_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: BatchEndpoint, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.BatchEndpoint @@ -563,7 +561,11 @@ def get( 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]: @@ -578,7 +580,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore def _update_initial( @@ -614,7 +616,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]: @@ -637,7 +643,7 @@ def _update_initial( return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore + _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace @@ -663,9 +669,6 @@ def begin_update( :param body: Mutable batch inference endpoint definition object. :type body: ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithIdentity - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -681,7 +684,7 @@ def begin_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.BatchEndpoint"] lro_delay = kwargs.pop( 'polling_interval', @@ -719,10 +722,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_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore + begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore def _create_or_update_initial( self, @@ -757,7 +759,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]: @@ -779,7 +785,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace @@ -804,9 +810,6 @@ def begin_create_or_update( :type endpoint_name: str :param body: Batch inference endpoint definition object. :type body: ~azure.mgmt.machinelearningservices.models.BatchEndpoint - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -822,7 +825,7 @@ def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.BatchEndpoint"] lro_delay = kwargs.pop( 'polling_interval', @@ -860,10 +863,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.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}"} # type: ignore @distributed_trace def list_keys( @@ -884,9 +886,6 @@ def list_keys( :type workspace_name: str :param endpoint_name: Inference Endpoint name. :type endpoint_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: EndpointAuthKeys, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys @@ -912,7 +911,11 @@ def list_keys( 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]: @@ -927,5 +930,5 @@ def list_keys( return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys'} # type: ignore + list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName}/listkeys"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_code_containers_operations.py index 884850073b28..254317233f79 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_code_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_code_containers_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 TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,14 +17,13 @@ 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 if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,30 +43,30 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), "workspaceName": _SERIALIZER.url("workspace_name", workspace_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') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, '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 ) @@ -83,7 +83,7 @@ def build_delete_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -91,21 +91,21 @@ def build_delete_request( "name": _SERIALIZER.url("name", 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 ) @@ -122,7 +122,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -130,21 +130,21 @@ def build_get_request( "name": _SERIALIZER.url("name", 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 ) @@ -162,7 +162,7 @@ def build_create_or_update_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -170,23 +170,23 @@ def build_create_or_update_request( "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), } - 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, **kwargs ) @@ -232,9 +232,6 @@ def list( :type workspace_name: str :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CodeContainerResourceArmPaginatedResult or the result of cls(response) @@ -288,7 +285,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]: @@ -302,10 +303,10 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -323,9 +324,6 @@ def delete( :type workspace_name: str :param name: Container name. This is case-sensitive. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -351,7 +349,11 @@ def delete( 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, 204]: @@ -362,7 +364,7 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore @distributed_trace @@ -384,9 +386,6 @@ def get( :type workspace_name: str :param name: Container name. This is case-sensitive. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: CodeContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer @@ -412,7 +411,11 @@ def get( 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]: @@ -427,7 +430,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore @distributed_trace @@ -452,9 +455,6 @@ def create_or_update( :type name: str :param body: Container entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.CodeContainer - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: CodeContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer @@ -484,7 +484,11 @@ def create_or_update( 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]: @@ -503,5 +507,5 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_code_versions_operations.py index 5f23b0eacec5..17a29c3b389e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_code_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_code_versions_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 TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,14 +17,13 @@ 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 if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +46,7 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -54,27 +54,27 @@ def build_list_request( "name": _SERIALIZER.url("name", 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') if order_by is not None: - query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') + _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, '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 ) @@ -92,7 +92,7 @@ def build_delete_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -101,21 +101,21 @@ def build_delete_request( "version": _SERIALIZER.url("version", version, '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 ) @@ -133,7 +133,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -142,21 +142,21 @@ def build_get_request( "version": _SERIALIZER.url("version", version, '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 ) @@ -175,7 +175,7 @@ def build_create_or_update_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -184,23 +184,23 @@ def build_create_or_update_request( "version": _SERIALIZER.url("version", version, '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, **kwargs ) @@ -255,9 +255,6 @@ def list( :type top: int :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CodeVersionResourceArmPaginatedResult or the result of cls(response) @@ -317,7 +314,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]: @@ -331,10 +332,10 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -355,9 +356,6 @@ def delete( :type name: str :param version: Version identifier. This is case-sensitive. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -384,7 +382,11 @@ def delete( 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, 204]: @@ -395,7 +397,7 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace @@ -420,9 +422,6 @@ def get( :type name: str :param version: Version identifier. This is case-sensitive. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: CodeVersion, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion @@ -449,7 +448,11 @@ def get( 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]: @@ -464,7 +467,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace @@ -492,9 +495,6 @@ def create_or_update( :type version: str :param body: Version entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.CodeVersion - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: CodeVersion, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion @@ -525,7 +525,11 @@ def create_or_update( 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]: @@ -544,5 +548,5 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_component_containers_operations.py index 53f9c4e0361d..2568cbe99064 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_component_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_component_containers_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 TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,14 +17,13 @@ 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 if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,32 +44,32 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), "workspaceName": _SERIALIZER.url("workspace_name", workspace_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') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') if list_view_type is not None: - query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') + _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, '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 ) @@ -86,7 +86,7 @@ def build_delete_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -94,21 +94,21 @@ def build_delete_request( "name": _SERIALIZER.url("name", 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 ) @@ -125,7 +125,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -133,21 +133,21 @@ def build_get_request( "name": _SERIALIZER.url("name", 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 ) @@ -165,7 +165,7 @@ def build_create_or_update_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -173,23 +173,23 @@ def build_create_or_update_request( "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), } - 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, **kwargs ) @@ -238,9 +238,6 @@ def list( :type skip: str :param list_view_type: View type for including/excluding (for example) archived entities. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ComponentContainerResourceArmPaginatedResult or the result of cls(response) @@ -296,7 +293,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]: @@ -310,10 +311,10 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -331,9 +332,6 @@ def delete( :type workspace_name: str :param name: Container name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -359,7 +357,11 @@ def delete( 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, 204]: @@ -370,7 +372,7 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore @distributed_trace @@ -392,9 +394,6 @@ def get( :type workspace_name: str :param name: Container name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ComponentContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer @@ -420,7 +419,11 @@ def get( 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]: @@ -435,7 +438,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore @distributed_trace @@ -460,9 +463,6 @@ def create_or_update( :type name: str :param body: Container entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.ComponentContainer - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ComponentContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer @@ -492,7 +492,11 @@ def create_or_update( 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]: @@ -511,5 +515,5 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_component_versions_operations.py index c328cd6999d8..45ae72b476f5 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_component_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_component_versions_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 TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,14 +17,13 @@ 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 if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +47,7 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -55,29 +55,29 @@ def build_list_request( "name": _SERIALIZER.url("name", 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') if order_by is not None: - query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') + _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') if list_view_type is not None: - query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') + _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, '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 ) @@ -95,7 +95,7 @@ def build_delete_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -104,21 +104,21 @@ def build_delete_request( "version": _SERIALIZER.url("version", version, '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 ) @@ -136,7 +136,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -145,21 +145,21 @@ def build_get_request( "version": _SERIALIZER.url("version", version, '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 ) @@ -178,7 +178,7 @@ def build_create_or_update_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -187,23 +187,23 @@ def build_create_or_update_request( "version": _SERIALIZER.url("version", version, '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, **kwargs ) @@ -261,9 +261,6 @@ def list( :type skip: str :param list_view_type: View type for including/excluding (for example) archived entities. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ComponentVersionResourceArmPaginatedResult or the result of cls(response) @@ -325,7 +322,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]: @@ -339,10 +340,10 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -363,9 +364,6 @@ def delete( :type name: str :param version: Version identifier. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -392,7 +390,11 @@ def delete( 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, 204]: @@ -403,7 +405,7 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace @@ -428,9 +430,6 @@ def get( :type name: str :param version: Version identifier. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ComponentVersion, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion @@ -457,7 +456,11 @@ def get( 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]: @@ -472,7 +475,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace @@ -500,9 +503,6 @@ def create_or_update( :type version: str :param body: Version entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.ComponentVersion - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ComponentVersion, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion @@ -533,7 +533,11 @@ def create_or_update( 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]: @@ -552,5 +556,5 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_compute_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_compute_operations.py index 7098dc584f98..fc67fc0cfc9d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_compute_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_compute_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 TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,14 +19,13 @@ 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 if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, List, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, List, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,30 +45,30 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), "workspaceName": _SERIALIZER.url("workspace_name", workspace_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') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, '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 ) @@ -85,7 +85,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -93,21 +93,21 @@ def build_get_request( "computeName": _SERIALIZER.url("compute_name", compute_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,7 +125,7 @@ def build_create_or_update_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -133,23 +133,23 @@ def build_create_or_update_request_initial( "computeName": _SERIALIZER.url("compute_name", compute_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, **kwargs ) @@ -167,7 +167,7 @@ def build_update_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -175,23 +175,23 @@ def build_update_request_initial( "computeName": _SERIALIZER.url("compute_name", compute_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, **kwargs ) @@ -209,7 +209,7 @@ def build_delete_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -217,22 +217,22 @@ def build_delete_request_initial( "computeName": _SERIALIZER.url("compute_name", compute_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['underlyingResourceAction'] = _SERIALIZER.query("underlying_resource_action", underlying_resource_action, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['underlyingResourceAction'] = _SERIALIZER.query("underlying_resource_action", underlying_resource_action, '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,7 +250,7 @@ def build_update_custom_services_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/customServices') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/customServices") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -258,23 +258,23 @@ def build_update_custom_services_request( "computeName": _SERIALIZER.url("compute_name", compute_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, **kwargs ) @@ -291,7 +291,7 @@ def build_list_nodes_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -299,21 +299,21 @@ def build_list_nodes_request( "computeName": _SERIALIZER.url("compute_name", compute_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 ) @@ -330,7 +330,7 @@ def build_list_keys_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -338,21 +338,21 @@ def build_list_keys_request( "computeName": _SERIALIZER.url("compute_name", compute_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 ) @@ -369,7 +369,7 @@ def build_start_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -377,21 +377,21 @@ def build_start_request_initial( "computeName": _SERIALIZER.url("compute_name", compute_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 ) @@ -408,7 +408,7 @@ def build_stop_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -416,21 +416,21 @@ def build_stop_request_initial( "computeName": _SERIALIZER.url("compute_name", compute_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 ) @@ -447,7 +447,7 @@ def build_restart_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -455,21 +455,21 @@ def build_restart_request_initial( "computeName": _SERIALIZER.url("compute_name", compute_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 ) @@ -487,7 +487,7 @@ def build_update_idle_shutdown_setting_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateIdleShutdownSetting') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateIdleShutdownSetting") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -495,23 +495,23 @@ def build_update_idle_shutdown_setting_request( "computeName": _SERIALIZER.url("compute_name", compute_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, **kwargs ) @@ -555,9 +555,6 @@ def list( :type workspace_name: str :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either PaginatedComputeResourcesList or the result of cls(response) @@ -611,7 +608,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]: @@ -625,7 +626,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes"} # type: ignore @distributed_trace def get( @@ -645,9 +646,6 @@ def get( :type workspace_name: str :param compute_name: Name of the Azure Machine Learning compute. :type compute_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ComputeResource, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ComputeResource @@ -673,7 +671,11 @@ def get( 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]: @@ -688,7 +690,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore def _create_or_update_initial( @@ -724,7 +726,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]: @@ -745,7 +751,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace @@ -770,9 +776,6 @@ def begin_create_or_update( :type compute_name: str :param parameters: Payload with Machine Learning compute definition. :type parameters: ~azure.mgmt.machinelearningservices.models.ComputeResource - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -789,7 +792,7 @@ def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.ComputeResource"] lro_delay = kwargs.pop( 'polling_interval', @@ -827,10 +830,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.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore def _update_initial( self, @@ -865,7 +867,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]: @@ -879,7 +885,7 @@ def _update_initial( return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore + _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace @@ -903,9 +909,6 @@ def begin_update( :type compute_name: str :param parameters: Additional parameters for cluster update. :type parameters: ~azure.mgmt.machinelearningservices.models.ClusterUpdateParameters - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -922,7 +925,7 @@ def begin_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.ComputeResource"] lro_delay = kwargs.pop( 'polling_interval', @@ -960,12 +963,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.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore + begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore - def _delete_initial( + def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -995,7 +997,11 @@ def _delete_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, 204]: @@ -1011,11 +1017,11 @@ def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace - def begin_delete( + def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -1036,9 +1042,6 @@ def begin_delete( underlying compute from workspace if 'Detach'. :type underlying_resource_action: str or ~azure.mgmt.machinelearningservices.models.UnderlyingResourceAction - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -1052,7 +1055,7 @@ def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: 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', @@ -1086,13 +1089,12 @@ 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.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}"} # type: ignore @distributed_trace - def update_custom_services( + def update_custom_services( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -1111,9 +1113,6 @@ def update_custom_services( :type compute_name: str :param custom_services: New list of Custom Services. :type custom_services: list[~azure.mgmt.machinelearningservices.models.CustomService] - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -1143,7 +1142,11 @@ def update_custom_services( 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]: @@ -1154,7 +1157,7 @@ def update_custom_services( if cls: return cls(pipeline_response, None, {}) - update_custom_services.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/customServices'} # type: ignore + update_custom_services.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/customServices"} # type: ignore @distributed_trace @@ -1174,9 +1177,6 @@ def list_nodes( :type workspace_name: str :param compute_name: Name of the Azure Machine Learning compute. :type compute_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AmlComputeNodesInformation or the result of cls(response) @@ -1230,7 +1230,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]: @@ -1244,7 +1248,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_nodes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes'} # type: ignore + list_nodes.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes"} # type: ignore @distributed_trace def list_keys( @@ -1263,9 +1267,6 @@ def list_keys( :type workspace_name: str :param compute_name: Name of the Azure Machine Learning compute. :type compute_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ComputeSecrets, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ComputeSecrets @@ -1291,7 +1292,11 @@ def list_keys( 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]: @@ -1306,10 +1311,10 @@ def list_keys( return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys'} # type: ignore + list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys"} # type: ignore - def _start_initial( + def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -1337,7 +1342,11 @@ def _start_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 [202]: @@ -1347,11 +1356,11 @@ def _start_initial( if cls: return cls(pipeline_response, None, {}) - _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start'} # type: ignore + _start_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore @distributed_trace - def begin_start( + def begin_start( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -1367,9 +1376,6 @@ def begin_start( :type workspace_name: str :param compute_name: Name of the Azure Machine Learning compute. :type compute_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -1383,7 +1389,7 @@ def begin_start( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: 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', @@ -1416,12 +1422,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_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start'} # type: ignore + begin_start.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start"} # type: ignore - def _stop_initial( + def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -1449,7 +1454,11 @@ def _stop_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 [202]: @@ -1459,11 +1468,11 @@ def _stop_initial( if cls: return cls(pipeline_response, None, {}) - _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop'} # type: ignore + _stop_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore @distributed_trace - def begin_stop( + def begin_stop( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -1479,9 +1488,6 @@ def begin_stop( :type workspace_name: str :param compute_name: Name of the Azure Machine Learning compute. :type compute_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -1495,7 +1501,7 @@ def begin_stop( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: 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', @@ -1528,12 +1534,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.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop'} # type: ignore + begin_stop.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop"} # type: ignore - def _restart_initial( + def _restart_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -1561,7 +1566,11 @@ def _restart_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 [202]: @@ -1571,11 +1580,11 @@ def _restart_initial( if cls: return cls(pipeline_response, None, {}) - _restart_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart'} # type: ignore + _restart_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore @distributed_trace - def begin_restart( + def begin_restart( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -1591,9 +1600,6 @@ def begin_restart( :type workspace_name: str :param compute_name: Name of the Azure Machine Learning compute. :type compute_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -1607,7 +1613,7 @@ def begin_restart( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: 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', @@ -1640,13 +1646,12 @@ 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_restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart'} # type: ignore + begin_restart.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart"} # type: ignore @distributed_trace - def update_idle_shutdown_setting( + def update_idle_shutdown_setting( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -1665,9 +1670,6 @@ def update_idle_shutdown_setting( :type compute_name: str :param parameters: The object for updating idle shutdown setting of specified ComputeInstance. :type parameters: ~azure.mgmt.machinelearningservices.models.IdleShutdownSetting - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -1697,7 +1699,11 @@ def update_idle_shutdown_setting( 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]: @@ -1708,5 +1714,5 @@ def update_idle_shutdown_setting( if cls: return cls(pipeline_response, None, {}) - update_idle_shutdown_setting.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateIdleShutdownSetting'} # type: ignore + update_idle_shutdown_setting.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateIdleShutdownSetting"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_data_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_data_containers_operations.py index a23c79eb33f1..e809b6cc7a71 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_data_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_data_containers_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 TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,14 +17,13 @@ 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 if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,32 +44,32 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), "workspaceName": _SERIALIZER.url("workspace_name", workspace_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') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') if list_view_type is not None: - query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') + _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, '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 ) @@ -86,7 +86,7 @@ def build_delete_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -94,21 +94,21 @@ def build_delete_request( "name": _SERIALIZER.url("name", 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 ) @@ -125,7 +125,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -133,21 +133,21 @@ def build_get_request( "name": _SERIALIZER.url("name", 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 ) @@ -165,7 +165,7 @@ def build_create_or_update_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -173,23 +173,23 @@ def build_create_or_update_request( "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), } - 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, **kwargs ) @@ -238,9 +238,6 @@ def list( :type skip: str :param list_view_type: View type for including/excluding (for example) archived entities. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DataContainerResourceArmPaginatedResult or the result of cls(response) @@ -296,7 +293,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]: @@ -310,10 +311,10 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -331,9 +332,6 @@ def delete( :type workspace_name: str :param name: Container name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -359,7 +357,11 @@ def delete( 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, 204]: @@ -370,7 +372,7 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore @distributed_trace @@ -392,9 +394,6 @@ def get( :type workspace_name: str :param name: Container name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DataContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.DataContainer @@ -420,7 +419,11 @@ def get( 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]: @@ -435,7 +438,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore @distributed_trace @@ -460,9 +463,6 @@ def create_or_update( :type name: str :param body: Container entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.DataContainer - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DataContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.DataContainer @@ -492,7 +492,11 @@ def create_or_update( 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]: @@ -511,5 +515,5 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_data_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_data_versions_operations.py index d892e4946f40..eae182ebdb75 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_data_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_data_versions_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 TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,14 +17,13 @@ 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 if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +48,7 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -56,31 +56,31 @@ def build_list_request( "name": _SERIALIZER.url("name", 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') if order_by is not None: - query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') + _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') if tags is not None: - query_parameters['$tags'] = _SERIALIZER.query("tags", tags, 'str') + _query_parameters['$tags'] = _SERIALIZER.query("tags", tags, 'str') if list_view_type is not None: - query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') + _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, '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 ) @@ -98,7 +98,7 @@ def build_delete_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -107,21 +107,21 @@ def build_delete_request( "version": _SERIALIZER.url("version", version, '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 ) @@ -139,7 +139,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -148,21 +148,21 @@ def build_get_request( "version": _SERIALIZER.url("version", version, '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 ) @@ -181,7 +181,7 @@ def build_create_or_update_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -190,23 +190,23 @@ def build_create_or_update_request( "version": _SERIALIZER.url("version", version, '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, **kwargs ) @@ -271,9 +271,6 @@ def list( :param list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived entities. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DataVersionBaseResourceArmPaginatedResult or the result of cls(response) @@ -337,7 +334,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]: @@ -351,10 +352,10 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -375,9 +376,6 @@ def delete( :type name: str :param version: Version identifier. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -404,7 +402,11 @@ def delete( 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, 204]: @@ -415,7 +417,7 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace @@ -440,9 +442,6 @@ def get( :type name: str :param version: Version identifier. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DataVersionBase, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase @@ -469,7 +468,11 @@ def get( 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]: @@ -484,7 +487,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore @distributed_trace @@ -512,9 +515,6 @@ def create_or_update( :type version: str :param body: Version entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.DataVersionBase - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DataVersionBase, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.DataVersionBase @@ -545,7 +545,11 @@ def create_or_update( 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]: @@ -564,5 +568,5 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_datastores_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_datastores_operations.py index 0f364095279e..24fe3fbf1f80 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_datastores_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_datastores_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 TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,14 +17,13 @@ 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 if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, List, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, List, Optional, TypeVar T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,42 +49,42 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), "workspaceName": _SERIALIZER.url("workspace_name", workspace_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') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') if count is not None: - query_parameters['count'] = _SERIALIZER.query("count", count, 'int') + _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') if is_default is not None: - query_parameters['isDefault'] = _SERIALIZER.query("is_default", is_default, 'bool') + _query_parameters['isDefault'] = _SERIALIZER.query("is_default", is_default, 'bool') if names is not None: - query_parameters['names'] = _SERIALIZER.query("names", names, '[str]', div=',') + _query_parameters['names'] = _SERIALIZER.query("names", names, '[str]', div=',') if search_text is not None: - query_parameters['searchText'] = _SERIALIZER.query("search_text", search_text, 'str') + _query_parameters['searchText'] = _SERIALIZER.query("search_text", search_text, 'str') if order_by is not None: - query_parameters['orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') + _query_parameters['orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') if order_by_asc is not None: - query_parameters['orderByAsc'] = _SERIALIZER.query("order_by_asc", order_by_asc, 'bool') + _query_parameters['orderByAsc'] = _SERIALIZER.query("order_by_asc", order_by_asc, 'bool') # 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 ) @@ -101,7 +101,7 @@ def build_delete_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -109,21 +109,21 @@ def build_delete_request( "name": _SERIALIZER.url("name", 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 ) @@ -140,7 +140,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -148,21 +148,21 @@ def build_get_request( "name": _SERIALIZER.url("name", 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 ) @@ -181,7 +181,7 @@ def build_create_or_update_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -189,25 +189,25 @@ def build_create_or_update_request( "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), } - 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') if skip_validation is not None: - query_parameters['skipValidation'] = _SERIALIZER.query("skip_validation", skip_validation, 'bool') + _query_parameters['skipValidation'] = _SERIALIZER.query("skip_validation", skip_validation, 'bool') # 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, **kwargs ) @@ -224,7 +224,7 @@ def build_list_secrets_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -232,21 +232,21 @@ def build_list_secrets_request( "name": _SERIALIZER.url("name", 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 ) @@ -310,9 +310,6 @@ def list( :type order_by: str :param order_by_asc: Order by property in ascending order. :type order_by_asc: bool - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DatastoreResourceArmPaginatedResult or the result of cls(response) @@ -378,7 +375,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]: @@ -392,10 +393,10 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -413,9 +414,6 @@ def delete( :type workspace_name: str :param name: Datastore name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -441,7 +439,11 @@ def delete( 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, 204]: @@ -452,7 +454,7 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace @@ -474,9 +476,6 @@ def get( :type workspace_name: str :param name: Datastore name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Datastore, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.Datastore @@ -502,7 +501,11 @@ def get( 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]: @@ -517,7 +520,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace @@ -545,9 +548,6 @@ def create_or_update( :type body: ~azure.mgmt.machinelearningservices.models.Datastore :param skip_validation: Flag to skip validation. :type skip_validation: bool - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Datastore, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.Datastore @@ -578,7 +578,11 @@ def create_or_update( 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]: @@ -597,7 +601,7 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}"} # type: ignore @distributed_trace @@ -619,9 +623,6 @@ def list_secrets( :type workspace_name: str :param name: Datastore name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DatastoreSecrets, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.DatastoreSecrets @@ -647,7 +648,11 @@ def list_secrets( 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]: @@ -662,5 +667,5 @@ def list_secrets( return deserialized - list_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets'} # type: ignore + list_secrets.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_environment_containers_operations.py index eb83a9d9a0bd..9234f37eb34a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_environment_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_environment_containers_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 TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,14 +17,13 @@ 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 if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,32 +44,32 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), "workspaceName": _SERIALIZER.url("workspace_name", workspace_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') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') if list_view_type is not None: - query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') + _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, '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 ) @@ -86,7 +86,7 @@ def build_delete_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -94,21 +94,21 @@ def build_delete_request( "name": _SERIALIZER.url("name", 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 ) @@ -125,7 +125,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -133,21 +133,21 @@ def build_get_request( "name": _SERIALIZER.url("name", 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 ) @@ -165,7 +165,7 @@ def build_create_or_update_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -173,23 +173,23 @@ def build_create_or_update_request( "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), } - 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, **kwargs ) @@ -238,9 +238,6 @@ def list( :type skip: str :param list_view_type: View type for including/excluding (for example) archived entities. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either EnvironmentContainerResourceArmPaginatedResult or the result of cls(response) @@ -296,7 +293,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]: @@ -310,10 +311,10 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -331,9 +332,6 @@ def delete( :type workspace_name: str :param name: Container name. This is case-sensitive. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -359,7 +357,11 @@ def delete( 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, 204]: @@ -370,7 +372,7 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore @distributed_trace @@ -392,9 +394,6 @@ def get( :type workspace_name: str :param name: Container name. This is case-sensitive. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: EnvironmentContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer @@ -420,7 +419,11 @@ def get( 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]: @@ -435,7 +438,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore @distributed_trace @@ -460,9 +463,6 @@ def create_or_update( :type name: str :param body: Container entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: EnvironmentContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer @@ -492,7 +492,11 @@ def create_or_update( 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]: @@ -511,5 +515,5 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_environment_versions_operations.py index 12f7aa7056a0..167bbc040c85 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_environment_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_environment_versions_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 TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,14 +17,13 @@ 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 if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +47,7 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -55,29 +55,29 @@ def build_list_request( "name": _SERIALIZER.url("name", 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') if order_by is not None: - query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') + _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') if list_view_type is not None: - query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') + _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, '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 ) @@ -95,7 +95,7 @@ def build_delete_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -104,21 +104,21 @@ def build_delete_request( "version": _SERIALIZER.url("version", version, '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 ) @@ -136,7 +136,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -145,21 +145,21 @@ def build_get_request( "version": _SERIALIZER.url("version", version, '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 ) @@ -178,7 +178,7 @@ def build_create_or_update_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -187,23 +187,23 @@ def build_create_or_update_request( "version": _SERIALIZER.url("version", version, '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, **kwargs ) @@ -261,9 +261,6 @@ def list( :type skip: str :param list_view_type: View type for including/excluding (for example) archived entities. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either EnvironmentVersionResourceArmPaginatedResult or the result of cls(response) @@ -325,7 +322,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]: @@ -339,10 +340,10 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -363,9 +364,6 @@ def delete( :type name: str :param version: Version identifier. This is case-sensitive. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -392,7 +390,11 @@ def delete( 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, 204]: @@ -403,7 +405,7 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace @@ -428,9 +430,6 @@ def get( :type name: str :param version: Version identifier. This is case-sensitive. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: EnvironmentVersion, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion @@ -457,7 +456,11 @@ def get( 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]: @@ -472,7 +475,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace @@ -500,9 +503,6 @@ def create_or_update( :type version: str :param body: Definition of EnvironmentVersion. :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: EnvironmentVersion, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion @@ -533,7 +533,11 @@ def create_or_update( 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]: @@ -552,5 +556,5 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_jobs_operations.py index 85ed28079764..a3a443e03453 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_jobs_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_jobs_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 TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,14 +19,13 @@ 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 if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -50,40 +50,40 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), "workspaceName": _SERIALIZER.url("workspace_name", workspace_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') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') if job_type is not None: - query_parameters['jobType'] = _SERIALIZER.query("job_type", job_type, 'str') + _query_parameters['jobType'] = _SERIALIZER.query("job_type", job_type, 'str') if tag is not None: - query_parameters['tag'] = _SERIALIZER.query("tag", tag, 'str') + _query_parameters['tag'] = _SERIALIZER.query("tag", tag, 'str') if list_view_type is not None: - query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') + _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') if scheduled is not None: - query_parameters['scheduled'] = _SERIALIZER.query("scheduled", scheduled, 'bool') + _query_parameters['scheduled'] = _SERIALIZER.query("scheduled", scheduled, 'bool') if schedule_id is not None: - query_parameters['scheduleId'] = _SERIALIZER.query("schedule_id", schedule_id, 'str') + _query_parameters['scheduleId'] = _SERIALIZER.query("schedule_id", schedule_id, '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 ) @@ -100,7 +100,7 @@ def build_delete_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -108,21 +108,21 @@ def build_delete_request_initial( "id": _SERIALIZER.url("id", 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 ) @@ -139,7 +139,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -147,21 +147,21 @@ def build_get_request( "id": _SERIALIZER.url("id", 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 ) @@ -179,7 +179,7 @@ def build_create_or_update_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -187,23 +187,23 @@ def build_create_or_update_request( "id": _SERIALIZER.url("id", id, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), } - 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, **kwargs ) @@ -220,7 +220,7 @@ def build_cancel_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -228,21 +228,21 @@ def build_cancel_request_initial( "id": _SERIALIZER.url("id", 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 ) @@ -303,9 +303,6 @@ def list( :type scheduled: bool :param schedule_id: The scheduled id for listing the job triggered from. :type schedule_id: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either JobBaseResourceArmPaginatedResult or the result of cls(response) @@ -369,7 +366,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,9 +384,9 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs"} # type: ignore - def _delete_initial( + def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -413,7 +414,11 @@ def _delete_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, 204]: @@ -430,11 +435,11 @@ def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace - def begin_delete( + def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -452,9 +457,6 @@ def begin_delete( :type workspace_name: str :param id: The name and identifier for the Job. This is case-sensitive. :type id: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -468,7 +470,7 @@ def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: 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', @@ -501,10 +503,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.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace def get( @@ -525,9 +526,6 @@ def get( :type workspace_name: str :param id: The name and identifier for the Job. This is case-sensitive. :type id: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: JobBase, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.JobBase @@ -553,7 +551,11 @@ def get( 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]: @@ -568,7 +570,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore @distributed_trace @@ -593,9 +595,6 @@ def create_or_update( :type id: str :param body: Job definition object. :type body: ~azure.mgmt.machinelearningservices.models.JobBase - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: JobBase, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.JobBase @@ -625,7 +624,11 @@ def create_or_update( 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]: @@ -644,10 +647,10 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}"} # type: ignore - def _cancel_initial( + def _cancel_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -675,7 +678,11 @@ def _cancel_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]: @@ -691,11 +698,11 @@ def _cancel_initial( if cls: return cls(pipeline_response, None, response_headers) - _cancel_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel'} # type: ignore + _cancel_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore @distributed_trace - def begin_cancel( + def begin_cancel( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -713,9 +720,6 @@ def begin_cancel( :type workspace_name: str :param id: The name and identifier for the Job. This is case-sensitive. :type id: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -729,7 +733,7 @@ def begin_cancel( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: 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', @@ -762,7 +766,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_cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel'} # type: ignore + begin_cancel.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}/cancel"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_labeling_jobs_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_labeling_jobs_operations.py index e4c04d98e84d..6fb608de455b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_labeling_jobs_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_labeling_jobs_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 TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,14 +19,13 @@ 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 if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,32 +46,32 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), "workspaceName": _SERIALIZER.url("workspace_name", workspace_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') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') if count is not None: - query_parameters['count'] = _SERIALIZER.query("count", count, 'int') + _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') # 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 ) @@ -88,7 +88,7 @@ def build_delete_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -96,21 +96,21 @@ def build_delete_request( "id": _SERIALIZER.url("id", 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 ) @@ -129,7 +129,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -137,25 +137,25 @@ def build_get_request( "id": _SERIALIZER.url("id", 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') if include_job_instructions is not None: - query_parameters['includeJobInstructions'] = _SERIALIZER.query("include_job_instructions", include_job_instructions, 'bool') + _query_parameters['includeJobInstructions'] = _SERIALIZER.query("include_job_instructions", include_job_instructions, 'bool') if include_label_categories is not None: - query_parameters['includeLabelCategories'] = _SERIALIZER.query("include_label_categories", include_label_categories, 'bool') + _query_parameters['includeLabelCategories'] = _SERIALIZER.query("include_label_categories", include_label_categories, 'bool') # 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 ) @@ -173,7 +173,7 @@ def build_create_or_update_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -181,23 +181,23 @@ def build_create_or_update_request_initial( "id": _SERIALIZER.url("id", id, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), } - 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, **kwargs ) @@ -215,7 +215,7 @@ def build_export_labels_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -223,23 +223,23 @@ def build_export_labels_request_initial( "id": _SERIALIZER.url("id", 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, **kwargs ) @@ -256,7 +256,7 @@ def build_pause_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -264,21 +264,21 @@ def build_pause_request( "id": _SERIALIZER.url("id", 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 ) @@ -295,7 +295,7 @@ def build_resume_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -303,21 +303,21 @@ def build_resume_request_initial( "id": _SERIALIZER.url("id", 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 ) @@ -366,9 +366,6 @@ def list( :type skip: str :param count: Number of labeling jobs to return. :type count: int - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either LabelingJobResourceArmPaginatedResult or the result of cls(response) @@ -424,7 +421,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]: @@ -438,10 +439,10 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -459,9 +460,6 @@ def delete( :type workspace_name: str :param id: The name and identifier for the LabelingJob. :type id: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -487,7 +485,11 @@ def delete( 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, 204]: @@ -498,7 +500,7 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore @distributed_trace @@ -528,9 +530,6 @@ def get( :param include_label_categories: Boolean value to indicate Whether to include LabelCategories in response. :type include_label_categories: bool - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: LabelingJob, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.LabelingJob @@ -558,7 +557,11 @@ def get( 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]: @@ -573,7 +576,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore def _create_or_update_initial( @@ -609,7 +612,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]: @@ -631,7 +638,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore @distributed_trace @@ -656,9 +663,6 @@ def begin_create_or_update( :type id: str :param body: LabelingJob definition object. :type body: ~azure.mgmt.machinelearningservices.models.LabelingJob - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -674,7 +678,7 @@ def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.LabelingJob"] lro_delay = kwargs.pop( 'polling_interval', @@ -712,10 +716,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.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}"} # type: ignore def _export_labels_initial( self, @@ -750,7 +753,11 @@ def _export_labels_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]: @@ -772,7 +779,7 @@ def _export_labels_initial( return deserialized - _export_labels_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels'} # type: ignore + _export_labels_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore @distributed_trace @@ -797,9 +804,6 @@ def begin_export_labels( :type id: str :param body: The export summary. :type body: ~azure.mgmt.machinelearningservices.models.ExportSummary - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -815,7 +819,7 @@ def begin_export_labels( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.ExportSummary"] lro_delay = kwargs.pop( 'polling_interval', @@ -853,13 +857,12 @@ 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_export_labels.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels'} # type: ignore + begin_export_labels.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels"} # type: ignore @distributed_trace - def pause( + def pause( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -877,9 +880,6 @@ def pause( :type workspace_name: str :param id: The name and identifier for the LabelingJob. :type id: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -905,7 +905,11 @@ def pause( 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]: @@ -916,10 +920,10 @@ def pause( if cls: return cls(pipeline_response, None, {}) - pause.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause'} # type: ignore + pause.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause"} # type: ignore - def _resume_initial( + def _resume_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -947,7 +951,11 @@ def _resume_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]: @@ -963,11 +971,11 @@ def _resume_initial( if cls: return cls(pipeline_response, None, response_headers) - _resume_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume'} # type: ignore + _resume_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore @distributed_trace - def begin_resume( + def begin_resume( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -985,9 +993,6 @@ def begin_resume( :type workspace_name: str :param id: The name and identifier for the LabelingJob. :type id: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -1001,7 +1006,7 @@ def begin_resume( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: 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', @@ -1034,7 +1039,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_resume.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume'} # type: ignore + begin_resume.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_model_containers_operations.py index bfc1d2f93076..0d78a86fe090 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_model_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_model_containers_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 TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,14 +17,13 @@ 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 if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,34 +45,34 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), "workspaceName": _SERIALIZER.url("workspace_name", workspace_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') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') if count is not None: - query_parameters['count'] = _SERIALIZER.query("count", count, 'int') + _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') if list_view_type is not None: - query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') + _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, '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 ) @@ -89,7 +89,7 @@ def build_delete_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -97,21 +97,21 @@ def build_delete_request( "name": _SERIALIZER.url("name", 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 ) @@ -128,7 +128,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -136,21 +136,21 @@ def build_get_request( "name": _SERIALIZER.url("name", 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 ) @@ -168,7 +168,7 @@ def build_create_or_update_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -176,23 +176,23 @@ def build_create_or_update_request( "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), } - 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, **kwargs ) @@ -244,9 +244,6 @@ def list( :type count: int :param list_view_type: View type for including/excluding (for example) archived entities. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ModelContainerResourceArmPaginatedResult or the result of cls(response) @@ -304,7 +301,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]: @@ -318,10 +319,10 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -339,9 +340,6 @@ def delete( :type workspace_name: str :param name: Container name. This is case-sensitive. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -367,7 +365,11 @@ def delete( 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, 204]: @@ -378,7 +380,7 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore @distributed_trace @@ -400,9 +402,6 @@ def get( :type workspace_name: str :param name: Container name. This is case-sensitive. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ModelContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer @@ -428,7 +427,11 @@ def get( 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]: @@ -443,7 +446,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore @distributed_trace @@ -468,9 +471,6 @@ def create_or_update( :type name: str :param body: Container entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.ModelContainer - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ModelContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer @@ -500,7 +500,11 @@ def create_or_update( 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]: @@ -519,5 +523,5 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_model_versions_operations.py index 221b6389a8b4..cf1c86a89d73 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_model_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_model_versions_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 TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,14 +17,13 @@ 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 if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -53,7 +53,7 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -61,41 +61,41 @@ def build_list_request( "name": _SERIALIZER.url("name", 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') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') if order_by is not None: - query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') + _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') if version is not None: - query_parameters['version'] = _SERIALIZER.query("version", version, 'str') + _query_parameters['version'] = _SERIALIZER.query("version", version, 'str') if description is not None: - query_parameters['description'] = _SERIALIZER.query("description", description, 'str') + _query_parameters['description'] = _SERIALIZER.query("description", description, 'str') if offset is not None: - query_parameters['offset'] = _SERIALIZER.query("offset", offset, 'int') + _query_parameters['offset'] = _SERIALIZER.query("offset", offset, 'int') if tags is not None: - query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') + _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') if properties is not None: - query_parameters['properties'] = _SERIALIZER.query("properties", properties, 'str') + _query_parameters['properties'] = _SERIALIZER.query("properties", properties, 'str') if feed is not None: - query_parameters['feed'] = _SERIALIZER.query("feed", feed, 'str') + _query_parameters['feed'] = _SERIALIZER.query("feed", feed, 'str') if list_view_type is not None: - query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') + _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, '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 ) @@ -113,7 +113,7 @@ def build_delete_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -122,21 +122,21 @@ def build_delete_request( "version": _SERIALIZER.url("version", version, '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 ) @@ -154,7 +154,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -163,21 +163,21 @@ def build_get_request( "version": _SERIALIZER.url("version", version, '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 ) @@ -196,7 +196,7 @@ def build_create_or_update_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -205,23 +205,23 @@ def build_create_or_update_request( "version": _SERIALIZER.url("version", version, '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, **kwargs ) @@ -299,9 +299,6 @@ def list( :type feed: str :param list_view_type: View type for including/excluding (for example) archived entities. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ModelVersionResourceArmPaginatedResult or the result of cls(response) @@ -375,7 +372,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]: @@ -389,10 +390,10 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -413,9 +414,6 @@ def delete( :type name: str :param version: Version identifier. This is case-sensitive. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -442,7 +440,11 @@ def delete( 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, 204]: @@ -453,7 +455,7 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace @@ -478,9 +480,6 @@ def get( :type name: str :param version: Version identifier. This is case-sensitive. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ModelVersion, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion @@ -507,7 +506,11 @@ def get( 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]: @@ -522,7 +525,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace @@ -550,9 +553,6 @@ def create_or_update( :type version: str :param body: Version entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.ModelVersion - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ModelVersion, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion @@ -583,7 +583,11 @@ def create_or_update( 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]: @@ -602,5 +606,5 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_online_deployments_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_online_deployments_operations.py index 0af2fd7ecdce..4d3d7e29176a 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_online_deployments_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_online_deployments_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 TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,14 +19,13 @@ 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 if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +48,7 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -56,27 +56,27 @@ def build_list_request( "endpointName": _SERIALIZER.url("endpoint_name", 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') if order_by is not None: - query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') + _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, '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 ) @@ -94,7 +94,7 @@ def build_delete_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -103,21 +103,21 @@ def build_delete_request_initial( "deploymentName": _SERIALIZER.url("deployment_name", deployment_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 ) @@ -135,7 +135,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -144,21 +144,21 @@ def build_get_request( "deploymentName": _SERIALIZER.url("deployment_name", deployment_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 ) @@ -177,7 +177,7 @@ def build_update_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -186,23 +186,23 @@ def build_update_request_initial( "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), } - 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, **kwargs ) @@ -221,7 +221,7 @@ def build_create_or_update_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -230,23 +230,23 @@ def build_create_or_update_request_initial( "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), } - 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, **kwargs ) @@ -265,7 +265,7 @@ def build_get_logs_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -274,23 +274,23 @@ def build_get_logs_request( "deploymentName": _SERIALIZER.url("deployment_name", deployment_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, **kwargs ) @@ -310,7 +310,7 @@ def build_list_skus_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -319,25 +319,25 @@ def build_list_skus_request( "deploymentName": _SERIALIZER.url("deployment_name", deployment_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') if count is not None: - query_parameters['count'] = _SERIALIZER.query("count", count, 'int') + _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, '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 ) @@ -392,9 +392,6 @@ def list( :type top: int :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OnlineDeploymentTrackedResourceArmPaginatedResult or the result of cls(response) @@ -454,7 +451,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]: @@ -468,9 +469,9 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments"} # type: ignore - def _delete_initial( + def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -500,7 +501,11 @@ def _delete_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, 204]: @@ -517,11 +522,11 @@ def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace - def begin_delete( + def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -542,9 +547,6 @@ def begin_delete( :type endpoint_name: str :param deployment_name: Inference Endpoint Deployment name. :type deployment_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -558,7 +560,7 @@ def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: 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', @@ -592,10 +594,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.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def get( @@ -619,9 +620,6 @@ def get( :type endpoint_name: str :param deployment_name: Inference Endpoint Deployment name. :type deployment_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: OnlineDeployment, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.OnlineDeployment @@ -648,7 +646,11 @@ def get( 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]: @@ -663,7 +665,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore def _update_initial( @@ -701,7 +703,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]: @@ -724,7 +730,7 @@ def _update_initial( return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace @@ -752,9 +758,6 @@ def begin_update( :type deployment_name: str :param body: Online Endpoint entity to apply during operation. :type body: ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithSku - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -771,7 +774,7 @@ def begin_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.OnlineDeployment"] lro_delay = kwargs.pop( 'polling_interval', @@ -810,10 +813,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_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore def _create_or_update_initial( self, @@ -850,7 +852,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]: @@ -872,7 +878,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace @@ -900,9 +906,6 @@ def begin_create_or_update( :type deployment_name: str :param body: Inference Endpoint entity to apply during operation. :type body: ~azure.mgmt.machinelearningservices.models.OnlineDeployment - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -919,7 +922,7 @@ def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.OnlineDeployment"] lro_delay = kwargs.pop( 'polling_interval', @@ -958,10 +961,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.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}"} # type: ignore @distributed_trace def get_logs( @@ -988,9 +990,6 @@ def get_logs( :type deployment_name: str :param body: The request containing parameters for retrieving logs. :type body: ~azure.mgmt.machinelearningservices.models.DeploymentLogsRequest - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentLogs, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.DeploymentLogs @@ -1021,7 +1020,11 @@ def get_logs( 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]: @@ -1036,7 +1039,7 @@ def get_logs( return deserialized - get_logs.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs'} # type: ignore + get_logs.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/getLogs"} # type: ignore @distributed_trace @@ -1067,9 +1070,6 @@ def list_skus( :type count: int :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SkuResourceArmPaginatedResult or the result of cls(response) @@ -1129,7 +1129,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]: @@ -1143,4 +1147,4 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_skus.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus'} # type: ignore + list_skus.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/deployments/{deploymentName}/skus"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_online_endpoints_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_online_endpoints_operations.py index 60221ff9d973..448697196546 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_online_endpoints_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_online_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 TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,14 +19,13 @@ 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 if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -51,42 +51,42 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), "workspaceName": _SERIALIZER.url("workspace_name", workspace_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') if name is not None: - query_parameters['name'] = _SERIALIZER.query("name", name, 'str') + _query_parameters['name'] = _SERIALIZER.query("name", name, 'str') if count is not None: - query_parameters['count'] = _SERIALIZER.query("count", count, 'int') + _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') if compute_type is not None: - query_parameters['computeType'] = _SERIALIZER.query("compute_type", compute_type, 'str') + _query_parameters['computeType'] = _SERIALIZER.query("compute_type", compute_type, 'str') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') if tags is not None: - query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') + _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') if properties is not None: - query_parameters['properties'] = _SERIALIZER.query("properties", properties, 'str') + _query_parameters['properties'] = _SERIALIZER.query("properties", properties, 'str') if order_by is not None: - query_parameters['orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') + _query_parameters['orderBy'] = _SERIALIZER.query("order_by", order_by, '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 ) @@ -103,7 +103,7 @@ def build_delete_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -111,21 +111,21 @@ def build_delete_request_initial( "endpointName": _SERIALIZER.url("endpoint_name", 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 ) @@ -142,7 +142,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -150,21 +150,21 @@ def build_get_request( "endpointName": _SERIALIZER.url("endpoint_name", 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 ) @@ -182,7 +182,7 @@ def build_update_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -190,23 +190,23 @@ def build_update_request_initial( "endpointName": _SERIALIZER.url("endpoint_name", 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, **kwargs ) @@ -224,7 +224,7 @@ def build_create_or_update_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -232,23 +232,23 @@ def build_create_or_update_request_initial( "endpointName": _SERIALIZER.url("endpoint_name", endpoint_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), } - 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, **kwargs ) @@ -265,7 +265,7 @@ def build_list_keys_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -273,21 +273,21 @@ def build_list_keys_request( "endpointName": _SERIALIZER.url("endpoint_name", 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="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -305,7 +305,7 @@ def build_regenerate_keys_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -313,23 +313,23 @@ def build_regenerate_keys_request_initial( "endpointName": _SERIALIZER.url("endpoint_name", 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="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -346,7 +346,7 @@ def build_get_token_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -354,21 +354,21 @@ def build_get_token_request( "endpointName": _SERIALIZER.url("endpoint_name", 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="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -435,9 +435,6 @@ def list( :type properties: str :param order_by: The option to order the response. :type order_by: str or ~azure.mgmt.machinelearningservices.models.OrderString - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OnlineEndpointTrackedResourceArmPaginatedResult or the result of cls(response) @@ -503,7 +500,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]: @@ -517,9 +518,9 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints"} # type: ignore - def _delete_initial( + def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -547,7 +548,11 @@ def _delete_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, 204]: @@ -564,11 +569,11 @@ def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace - def begin_delete( + def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -586,9 +591,6 @@ def begin_delete( :type workspace_name: str :param endpoint_name: Online Endpoint name. :type endpoint_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -602,7 +604,7 @@ def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: 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', @@ -635,10 +637,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.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace def get( @@ -659,9 +660,6 @@ def get( :type workspace_name: str :param endpoint_name: Online Endpoint name. :type endpoint_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: OnlineEndpoint, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.OnlineEndpoint @@ -687,7 +685,11 @@ def get( 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]: @@ -702,7 +704,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore def _update_initial( @@ -738,7 +740,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]: @@ -761,7 +767,7 @@ def _update_initial( return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore + _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace @@ -787,9 +793,6 @@ def begin_update( :param body: Online Endpoint entity to apply during operation. :type body: ~azure.mgmt.machinelearningservices.models.PartialMinimalTrackedResourceWithIdentity - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -806,7 +809,7 @@ def begin_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.OnlineEndpoint"] lro_delay = kwargs.pop( 'polling_interval', @@ -844,10 +847,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_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore + begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore def _create_or_update_initial( self, @@ -882,7 +884,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]: @@ -904,7 +910,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace @@ -929,9 +935,6 @@ def begin_create_or_update( :type endpoint_name: str :param body: Online Endpoint entity to apply during operation. :type body: ~azure.mgmt.machinelearningservices.models.OnlineEndpoint - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -948,7 +951,7 @@ def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.OnlineEndpoint"] lro_delay = kwargs.pop( 'polling_interval', @@ -986,10 +989,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.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}"} # type: ignore @distributed_trace def list_keys( @@ -1010,9 +1012,6 @@ def list_keys( :type workspace_name: str :param endpoint_name: Online Endpoint name. :type endpoint_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: EndpointAuthKeys, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthKeys @@ -1038,7 +1037,11 @@ def list_keys( 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]: @@ -1053,10 +1056,10 @@ def list_keys( return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys'} # type: ignore + list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/listKeys"} # type: ignore - def _regenerate_keys_initial( + def _regenerate_keys_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -1089,7 +1092,11 @@ def _regenerate_keys_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]: @@ -1105,11 +1112,11 @@ def _regenerate_keys_initial( if cls: return cls(pipeline_response, None, response_headers) - _regenerate_keys_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys'} # type: ignore + _regenerate_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore @distributed_trace - def begin_regenerate_keys( + def begin_regenerate_keys( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -1130,9 +1137,6 @@ def begin_regenerate_keys( :type endpoint_name: str :param body: RegenerateKeys request . :type body: ~azure.mgmt.machinelearningservices.models.RegenerateEndpointKeysRequest - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -1147,7 +1151,7 @@ def begin_regenerate_keys( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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', @@ -1182,10 +1186,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_regenerate_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys'} # type: ignore + begin_regenerate_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/regenerateKeys"} # type: ignore @distributed_trace def get_token( @@ -1206,9 +1209,6 @@ def get_token( :type workspace_name: str :param endpoint_name: Online Endpoint name. :type endpoint_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: EndpointAuthToken, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.EndpointAuthToken @@ -1234,7 +1234,11 @@ def get_token( 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]: @@ -1249,5 +1253,5 @@ def get_token( return deserialized - get_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token'} # type: ignore + get_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName}/token"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_operations.py index ea2920b77703..28734bc56724 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/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 TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,14 +17,13 @@ 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 if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -39,21 +39,21 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/providers/Microsoft.MachineLearningServices/operations') + _url = kwargs.pop("template_url", "/providers/Microsoft.MachineLearningServices/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 ) @@ -88,9 +88,6 @@ def list( # type: (...) -> Iterable["_models.AmlOperationListResult"] """Lists all of the available Azure Machine Learning Services REST API operations. - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AmlOperationListResult or the result of cls(response) @@ -136,7 +133,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]: @@ -150,4 +151,4 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/providers/Microsoft.MachineLearningServices/operations'} # type: ignore + list.metadata = {'url': "/providers/Microsoft.MachineLearningServices/operations"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_private_endpoint_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_private_endpoint_connections_operations.py index 181a009e09dc..58281925f838 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_private_endpoint_connections_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/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 TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,14 +17,13 @@ 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 if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,28 +42,28 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), } - 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 ) @@ -80,7 +80,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -88,21 +88,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 ) @@ -120,7 +120,7 @@ def build_create_or_update_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -128,23 +128,23 @@ def build_create_or_update_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 = 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, **kwargs ) @@ -161,7 +161,7 @@ def build_delete_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -169,21 +169,21 @@ def build_delete_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="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -224,9 +224,6 @@ def list( :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result of cls(response) @@ -278,7 +275,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]: @@ -292,7 +293,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections"} # type: ignore @distributed_trace def get( @@ -312,9 +313,6 @@ def get( :param private_endpoint_connection_name: The name of the private endpoint connection associated with the workspace. :type private_endpoint_connection_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: 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: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection @@ -340,7 +338,11 @@ def get( 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]: @@ -355,7 +357,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace @@ -379,9 +381,6 @@ def create_or_update( :type private_endpoint_connection_name: str :param properties: The private endpoint connection properties. :type properties: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: 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: ~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection @@ -411,7 +410,11 @@ def create_or_update( 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]: @@ -426,11 +429,11 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -447,9 +450,6 @@ def delete( :param private_endpoint_connection_name: The name of the private endpoint connection associated with the workspace. :type private_endpoint_connection_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -475,7 +475,11 @@ def delete( 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, 204]: @@ -486,5 +490,5 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_private_link_resources_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_private_link_resources_operations.py index 4c7a77d2bf93..1ad9f1900055 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_private_link_resources_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/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 TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -15,14 +16,13 @@ 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 if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar + from typing import Any, Callable, Dict, Optional, TypeVar T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -41,28 +41,28 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), "workspaceName": _SERIALIZER.url("workspace_name", workspace_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 ) @@ -103,9 +103,6 @@ def list( :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PrivateLinkResourceListResult, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.PrivateLinkResourceListResult @@ -130,7 +127,11 @@ def list( 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]: @@ -145,5 +146,5 @@ def list( return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_quotas_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_quotas_operations.py index 828a0e22643c..d69bf6dfa54f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_quotas_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_quotas_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 TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,14 +17,13 @@ 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 if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,29 +42,29 @@ def build_update_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas") # pylint: disable=line-too-long path_format_arguments = { "location": _SERIALIZER.url("location", location, 'str', pattern=r'^[-\w\._]+$'), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), } - 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, **kwargs ) @@ -79,27 +79,27 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "location": _SERIALIZER.url("location", location, 'str', pattern=r'^[-\w\._]+$'), } - 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 ) @@ -140,9 +140,6 @@ def update( :type location: str :param parameters: Quota update parameters. :type parameters: ~azure.mgmt.machinelearningservices.models.QuotaUpdateParameters - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: UpdateWorkspaceQuotasResult, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.UpdateWorkspaceQuotasResult @@ -170,7 +167,11 @@ def update( 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]: @@ -185,7 +186,7 @@ def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas"} # type: ignore @distributed_trace @@ -199,9 +200,6 @@ def list( :param location: The location for which resource usage is queried. :type location: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ListWorkspaceQuotas or the result of cls(response) :rtype: @@ -250,7 +248,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]: @@ -264,4 +266,4 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registries_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registries_operations.py index f2c903b70366..a3468d327729 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registries_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registries_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 TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,14 +19,13 @@ 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 if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,28 +43,28 @@ def build_list_by_subscription_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/registries') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/registries") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), } - 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') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, '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 ) @@ -80,29 +80,29 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), } - 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') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, '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 ) @@ -118,28 +118,28 @@ def build_delete_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), "registryName": _SERIALIZER.url("registry_name", registry_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 ) @@ -155,28 +155,28 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), "registryName": _SERIALIZER.url("registry_name", registry_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 ) @@ -193,30 +193,30 @@ def build_update_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), } - 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, **kwargs ) @@ -233,30 +233,30 @@ def build_create_or_update_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), "registryName": _SERIALIZER.url("registry_name", registry_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), } - 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, **kwargs ) @@ -296,9 +296,6 @@ def list_by_subscription( :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either RegistryTrackedResourceArmPaginatedResult or the result of cls(response) @@ -348,7 +345,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]: @@ -362,7 +363,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/registries'} # type: ignore + list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore @distributed_trace def list( @@ -380,9 +381,6 @@ def list( :type resource_group_name: str :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either RegistryTrackedResourceArmPaginatedResult or the result of cls(response) @@ -434,7 +432,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]: @@ -448,10 +450,10 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str registry_name, # type: str @@ -466,9 +468,6 @@ def delete( :type resource_group_name: str :param registry_name: Name of registry. This is case-insensitive. :type registry_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -493,7 +492,11 @@ def delete( 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, 204]: @@ -504,7 +507,7 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @distributed_trace @@ -523,9 +526,6 @@ def get( :type resource_group_name: str :param registry_name: Name of registry. This is case-insensitive. :type registry_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Registry, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.Registry @@ -550,7 +550,11 @@ def get( 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]: @@ -565,7 +569,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @distributed_trace @@ -587,9 +591,6 @@ def update( :type registry_name: str :param body: Details required to create the registry. :type body: ~azure.mgmt.machinelearningservices.models.PartialRegistryPartialTrackedResource - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Registry, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.Registry @@ -618,7 +619,11 @@ def update( 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]: @@ -633,7 +638,7 @@ def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore def _create_or_update_initial( @@ -667,10 +672,14 @@ 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]: + if response.status_code not in [200, 201, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) @@ -680,12 +689,15 @@ def _create_or_update_initial( if response.status_code == 201: deserialized = self._deserialize('Registry', pipeline_response) + if response.status_code == 202: + deserialized = self._deserialize('Registry', pipeline_response) + if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore @distributed_trace @@ -707,9 +719,6 @@ def begin_create_or_update( :type registry_name: str :param body: Details required to create the registry. :type body: ~azure.mgmt.machinelearningservices.models.Registry - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -724,7 +733,7 @@ def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.Registry"] lro_delay = kwargs.pop( 'polling_interval', @@ -761,7 +770,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_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_code_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_code_containers_operations.py index a330703c74f1..2366781ec437 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_code_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_code_containers_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 TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,14 +19,13 @@ 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 if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,30 +45,30 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), "registryName": _SERIALIZER.url("registry_name", registry_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') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, '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 ) @@ -85,7 +85,7 @@ def build_delete_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -93,21 +93,21 @@ def build_delete_request_initial( "name": _SERIALIZER.url("name", 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 ) @@ -124,7 +124,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -132,21 +132,21 @@ def build_get_request( "name": _SERIALIZER.url("name", 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 ) @@ -164,7 +164,7 @@ def build_create_or_update_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -172,23 +172,23 @@ def build_create_or_update_request_initial( "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), } - 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, **kwargs ) @@ -234,9 +234,6 @@ def list( :type registry_name: str :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CodeContainerResourceArmPaginatedResult or the result of cls(response) @@ -290,7 +287,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]: @@ -304,9 +305,9 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes"} # type: ignore - def _delete_initial( + def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str registry_name, # type: str @@ -334,7 +335,11 @@ def _delete_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, 204]: @@ -351,11 +356,11 @@ def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}"} # type: ignore @distributed_trace - def begin_delete( + def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str registry_name, # type: str @@ -373,9 +378,6 @@ def begin_delete( :type registry_name: str :param name: Container name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -389,7 +391,7 @@ def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: 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', @@ -422,10 +424,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.MachineLearningServices/registries/{registryName}/codes/{name}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}"} # type: ignore @distributed_trace def get( @@ -446,9 +447,6 @@ def get( :type registry_name: str :param name: Container name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: CodeContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.CodeContainer @@ -474,7 +472,11 @@ def get( 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]: @@ -489,7 +491,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}"} # type: ignore def _create_or_update_initial( @@ -525,7 +527,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]: @@ -547,7 +553,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}"} # type: ignore @distributed_trace @@ -572,9 +578,6 @@ def begin_create_or_update( :type name: str :param body: Container entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.CodeContainer - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -590,7 +593,7 @@ def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.CodeContainer"] lro_delay = kwargs.pop( 'polling_interval', @@ -628,7 +631,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_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_code_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_code_versions_operations.py index 69cb21d354f8..df8e42fdc76b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_code_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_code_versions_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 TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,14 +19,13 @@ 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 if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +48,7 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -56,27 +56,27 @@ def build_list_request( "name": _SERIALIZER.url("name", 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') if order_by is not None: - query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') + _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, '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 ) @@ -94,7 +94,7 @@ def build_delete_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -103,21 +103,21 @@ def build_delete_request_initial( "version": _SERIALIZER.url("version", version, '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 ) @@ -135,7 +135,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -144,21 +144,21 @@ def build_get_request( "version": _SERIALIZER.url("version", version, '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 ) @@ -177,7 +177,7 @@ def build_create_or_update_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -186,23 +186,23 @@ def build_create_or_update_request_initial( "version": _SERIALIZER.url("version", version, '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, **kwargs ) @@ -257,9 +257,6 @@ def list( :type top: int :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CodeVersionResourceArmPaginatedResult or the result of cls(response) @@ -319,7 +316,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]: @@ -333,9 +334,9 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions"} # type: ignore - def _delete_initial( + def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str registry_name, # type: str @@ -365,7 +366,11 @@ def _delete_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, 204]: @@ -382,11 +387,11 @@ def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace - def begin_delete( + def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str registry_name, # type: str @@ -407,9 +412,6 @@ def begin_delete( :type name: str :param version: Version identifier. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -423,7 +425,7 @@ def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: 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', @@ -457,10 +459,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.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -484,9 +485,6 @@ def get( :type name: str :param version: Version identifier. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: CodeVersion, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.CodeVersion @@ -513,7 +511,11 @@ def get( 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]: @@ -528,7 +530,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}"} # type: ignore def _create_or_update_initial( @@ -566,7 +568,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]: @@ -588,7 +594,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}"} # type: ignore @distributed_trace @@ -616,9 +622,6 @@ def begin_create_or_update( :type version: str :param body: Version entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.CodeVersion - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -634,7 +637,7 @@ def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.CodeVersion"] lro_delay = kwargs.pop( 'polling_interval', @@ -673,7 +676,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_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_component_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_component_containers_operations.py index 49f648ea56d5..4b9297e159f1 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_component_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_component_containers_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 TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,14 +19,13 @@ 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 if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,30 +45,30 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), "registryName": _SERIALIZER.url("registry_name", registry_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') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, '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 ) @@ -85,7 +85,7 @@ def build_delete_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -93,21 +93,21 @@ def build_delete_request_initial( "name": _SERIALIZER.url("name", 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 ) @@ -124,7 +124,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -132,21 +132,21 @@ def build_get_request( "name": _SERIALIZER.url("name", 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 ) @@ -164,7 +164,7 @@ def build_create_or_update_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -172,23 +172,23 @@ def build_create_or_update_request_initial( "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), } - 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, **kwargs ) @@ -234,9 +234,6 @@ def list( :type registry_name: str :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ComponentContainerResourceArmPaginatedResult or the result of cls(response) @@ -290,7 +287,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]: @@ -304,9 +305,9 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components"} # type: ignore - def _delete_initial( + def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str registry_name, # type: str @@ -334,7 +335,11 @@ def _delete_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, 204]: @@ -351,11 +356,11 @@ def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}"} # type: ignore @distributed_trace - def begin_delete( + def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str registry_name, # type: str @@ -373,9 +378,6 @@ def begin_delete( :type registry_name: str :param name: Container name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -389,7 +391,7 @@ def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: 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', @@ -422,10 +424,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.MachineLearningServices/registries/{registryName}/components/{name}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}"} # type: ignore @distributed_trace def get( @@ -446,9 +447,6 @@ def get( :type registry_name: str :param name: Container name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ComponentContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ComponentContainer @@ -474,7 +472,11 @@ def get( 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]: @@ -489,7 +491,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}"} # type: ignore def _create_or_update_initial( @@ -525,7 +527,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]: @@ -547,7 +553,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}"} # type: ignore @distributed_trace @@ -572,9 +578,6 @@ def begin_create_or_update( :type name: str :param body: Container entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.ComponentContainer - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -591,7 +594,7 @@ def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.ComponentContainer"] lro_delay = kwargs.pop( 'polling_interval', @@ -629,7 +632,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_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_component_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_component_versions_operations.py index b0ca745c6d92..826aacb218e8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_component_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_component_versions_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 TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,14 +19,13 @@ 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 if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +48,7 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -56,27 +56,27 @@ def build_list_request( "name": _SERIALIZER.url("name", 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') if order_by is not None: - query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') + _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, '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 ) @@ -94,7 +94,7 @@ def build_delete_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -103,21 +103,21 @@ def build_delete_request_initial( "version": _SERIALIZER.url("version", version, '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 ) @@ -135,7 +135,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -144,21 +144,21 @@ def build_get_request( "version": _SERIALIZER.url("version", version, '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 ) @@ -177,7 +177,7 @@ def build_create_or_update_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -186,23 +186,23 @@ def build_create_or_update_request_initial( "version": _SERIALIZER.url("version", version, '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, **kwargs ) @@ -257,9 +257,6 @@ def list( :type top: int :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ComponentVersionResourceArmPaginatedResult or the result of cls(response) @@ -319,7 +316,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]: @@ -333,9 +334,9 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions"} # type: ignore - def _delete_initial( + def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str registry_name, # type: str @@ -365,7 +366,11 @@ def _delete_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, 204]: @@ -382,11 +387,11 @@ def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace - def begin_delete( + def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str registry_name, # type: str @@ -407,9 +412,6 @@ def begin_delete( :type name: str :param version: Version identifier. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -423,7 +425,7 @@ def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: 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', @@ -457,10 +459,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.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -484,9 +485,6 @@ def get( :type name: str :param version: Version identifier. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ComponentVersion, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ComponentVersion @@ -513,7 +511,11 @@ def get( 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]: @@ -528,7 +530,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}"} # type: ignore def _create_or_update_initial( @@ -566,7 +568,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]: @@ -588,7 +594,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}"} # type: ignore @distributed_trace @@ -616,9 +622,6 @@ def begin_create_or_update( :type version: str :param body: Version entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.ComponentVersion - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -635,7 +638,7 @@ def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.ComponentVersion"] lro_delay = kwargs.pop( 'polling_interval', @@ -674,7 +677,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_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_environment_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_environment_containers_operations.py index a03c2c6686e1..253b3b103a5b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_environment_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_environment_containers_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 TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,14 +19,13 @@ 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 if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,32 +46,32 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), "registryName": _SERIALIZER.url("registry_name", registry_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') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') if list_view_type is not None: - query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') + _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, '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 ) @@ -88,7 +88,7 @@ def build_delete_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -96,21 +96,21 @@ def build_delete_request_initial( "name": _SERIALIZER.url("name", 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 ) @@ -127,7 +127,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -135,21 +135,21 @@ def build_get_request( "name": _SERIALIZER.url("name", 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 ) @@ -167,7 +167,7 @@ def build_create_or_update_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -175,23 +175,23 @@ def build_create_or_update_request_initial( "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), } - 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, **kwargs ) @@ -240,9 +240,6 @@ def list( :type skip: str :param list_view_type: View type for including/excluding (for example) archived entities. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either EnvironmentContainerResourceArmPaginatedResult or the result of cls(response) @@ -298,7 +295,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]: @@ -312,9 +313,9 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments"} # type: ignore - def _delete_initial( + def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str registry_name, # type: str @@ -342,7 +343,11 @@ def _delete_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, 204]: @@ -359,11 +364,11 @@ def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}"} # type: ignore @distributed_trace - def begin_delete( + def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str registry_name, # type: str @@ -381,9 +386,6 @@ def begin_delete( :type registry_name: str :param name: Container name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -397,7 +399,7 @@ def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: 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', @@ -430,10 +432,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.MachineLearningServices/registries/{registryName}/environments/{name}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}"} # type: ignore @distributed_trace def get( @@ -454,9 +455,6 @@ def get( :type registry_name: str :param name: Container name. This is case-sensitive. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: EnvironmentContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer @@ -482,7 +480,11 @@ def get( 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]: @@ -497,7 +499,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}"} # type: ignore def _create_or_update_initial( @@ -533,7 +535,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]: @@ -555,7 +561,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}"} # type: ignore @distributed_trace @@ -580,9 +586,6 @@ def begin_create_or_update( :type name: str :param body: Container entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentContainer - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -599,7 +602,7 @@ def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.EnvironmentContainer"] lro_delay = kwargs.pop( 'polling_interval', @@ -637,7 +640,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_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_environment_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_environment_versions_operations.py index a52e3e6b2dc0..baf37424abd9 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_environment_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_environment_versions_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 TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,14 +19,13 @@ 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 if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +49,7 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -57,29 +57,29 @@ def build_list_request( "name": _SERIALIZER.url("name", 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') if order_by is not None: - query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') + _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') if list_view_type is not None: - query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') + _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, '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 ) @@ -97,7 +97,7 @@ def build_delete_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -106,21 +106,21 @@ def build_delete_request_initial( "version": _SERIALIZER.url("version", version, '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 ) @@ -138,7 +138,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -147,21 +147,21 @@ def build_get_request( "version": _SERIALIZER.url("version", version, '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 ) @@ -180,7 +180,7 @@ def build_create_or_update_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -189,23 +189,23 @@ def build_create_or_update_request_initial( "version": _SERIALIZER.url("version", version, '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, **kwargs ) @@ -263,9 +263,6 @@ def list( :type skip: str :param list_view_type: View type for including/excluding (for example) archived entities. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either EnvironmentVersionResourceArmPaginatedResult or the result of cls(response) @@ -327,7 +324,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]: @@ -341,9 +342,9 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions"} # type: ignore - def _delete_initial( + def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str registry_name, # type: str @@ -373,7 +374,11 @@ def _delete_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, 204]: @@ -390,11 +395,11 @@ def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace - def begin_delete( + def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str registry_name, # type: str @@ -415,9 +420,6 @@ def begin_delete( :type name: str :param version: Version identifier. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -431,7 +433,7 @@ def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: 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', @@ -465,10 +467,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.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -492,9 +493,6 @@ def get( :type name: str :param version: Version identifier. This is case-sensitive. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: EnvironmentVersion, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion @@ -521,7 +519,11 @@ def get( 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]: @@ -536,7 +538,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}"} # type: ignore def _create_or_update_initial( @@ -574,7 +576,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]: @@ -596,7 +602,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}"} # type: ignore @distributed_trace @@ -624,9 +630,6 @@ def begin_create_or_update( :type version: str :param body: Version entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.EnvironmentVersion - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -643,7 +646,7 @@ def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.EnvironmentVersion"] lro_delay = kwargs.pop( 'polling_interval', @@ -682,7 +685,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_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_model_containers_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_model_containers_operations.py index 5ed8c24e76e6..edf60684ffbb 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_model_containers_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_model_containers_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 TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,14 +19,13 @@ 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 if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,32 +46,32 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), "registryName": _SERIALIZER.url("registry_name", registry_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') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') if list_view_type is not None: - query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') + _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, '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 ) @@ -88,7 +88,7 @@ def build_delete_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -96,21 +96,21 @@ def build_delete_request_initial( "name": _SERIALIZER.url("name", 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 ) @@ -127,7 +127,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -135,21 +135,21 @@ def build_get_request( "name": _SERIALIZER.url("name", 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 ) @@ -167,7 +167,7 @@ def build_create_or_update_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -175,23 +175,23 @@ def build_create_or_update_request_initial( "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), } - 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, **kwargs ) @@ -240,9 +240,6 @@ def list( :type skip: str :param list_view_type: View type for including/excluding (for example) archived entities. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ModelContainerResourceArmPaginatedResult or the result of cls(response) @@ -298,7 +295,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]: @@ -312,9 +313,9 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models"} # type: ignore - def _delete_initial( + def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str registry_name, # type: str @@ -342,7 +343,11 @@ def _delete_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, 204]: @@ -359,11 +364,11 @@ def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}"} # type: ignore @distributed_trace - def begin_delete( + def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str registry_name, # type: str @@ -381,9 +386,6 @@ def begin_delete( :type registry_name: str :param name: Container name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -397,7 +399,7 @@ def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: 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', @@ -430,10 +432,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.MachineLearningServices/registries/{registryName}/models/{name}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}"} # type: ignore @distributed_trace def get( @@ -454,9 +455,6 @@ def get( :type registry_name: str :param name: Container name. This is case-sensitive. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ModelContainer, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ModelContainer @@ -482,7 +480,11 @@ def get( 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]: @@ -497,7 +499,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}"} # type: ignore def _create_or_update_initial( @@ -533,7 +535,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]: @@ -555,7 +561,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}"} # type: ignore @distributed_trace @@ -580,9 +586,6 @@ def begin_create_or_update( :type name: str :param body: Container entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.ModelContainer - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -599,7 +602,7 @@ def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.ModelContainer"] lro_delay = kwargs.pop( 'polling_interval', @@ -637,7 +640,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_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_model_versions_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_model_versions_operations.py index 94a2fad67cd4..ed7ca8357ae7 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_model_versions_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_registry_model_versions_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 TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,14 +19,13 @@ 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 if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -53,7 +53,7 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -61,37 +61,37 @@ def build_list_request( "name": _SERIALIZER.url("name", 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') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') if order_by is not None: - query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') + _query_parameters['$orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') if version is not None: - query_parameters['version'] = _SERIALIZER.query("version", version, 'str') + _query_parameters['version'] = _SERIALIZER.query("version", version, 'str') if description is not None: - query_parameters['description'] = _SERIALIZER.query("description", description, 'str') + _query_parameters['description'] = _SERIALIZER.query("description", description, 'str') if tags is not None: - query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') + _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') if properties is not None: - query_parameters['properties'] = _SERIALIZER.query("properties", properties, 'str') + _query_parameters['properties'] = _SERIALIZER.query("properties", properties, 'str') if list_view_type is not None: - query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') + _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, '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 ) @@ -109,7 +109,7 @@ def build_delete_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -118,21 +118,21 @@ def build_delete_request_initial( "version": _SERIALIZER.url("version", version, '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 ) @@ -150,7 +150,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -159,21 +159,21 @@ def build_get_request( "version": _SERIALIZER.url("version", version, '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 ) @@ -192,7 +192,7 @@ def build_create_or_update_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -201,23 +201,23 @@ def build_create_or_update_request_initial( "version": _SERIALIZER.url("version", version, '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, **kwargs ) @@ -289,9 +289,6 @@ def list( :type properties: str :param list_view_type: View type for including/excluding (for example) archived entities. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ModelVersionResourceArmPaginatedResult or the result of cls(response) @@ -361,7 +358,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]: @@ -375,9 +376,9 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions"} # type: ignore - def _delete_initial( + def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str registry_name, # type: str @@ -407,7 +408,11 @@ def _delete_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, 204]: @@ -424,11 +429,11 @@ def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace - def begin_delete( + def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str registry_name, # type: str @@ -449,9 +454,6 @@ def begin_delete( :type name: str :param version: Version identifier. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -465,7 +467,7 @@ def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: 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', @@ -499,10 +501,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.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace def get( @@ -526,9 +527,6 @@ def get( :type name: str :param version: Version identifier. This is case-sensitive. :type version: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ModelVersion, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ModelVersion @@ -555,7 +553,11 @@ def get( 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]: @@ -570,7 +572,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}"} # type: ignore def _create_or_update_initial( @@ -608,7 +610,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]: @@ -630,7 +636,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}"} # type: ignore @distributed_trace @@ -658,9 +664,6 @@ def begin_create_or_update( :type version: str :param body: Version entity to create or update. :type body: ~azure.mgmt.machinelearningservices.models.ModelVersion - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -676,7 +679,7 @@ def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.ModelVersion"] lro_delay = kwargs.pop( 'polling_interval', @@ -715,7 +718,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_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_schedules_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_schedules_operations.py index 79681867d082..f86a36206fc2 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_schedules_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_schedules_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 TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,14 +19,13 @@ 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 if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,32 +46,32 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), "workspaceName": _SERIALIZER.url("workspace_name", workspace_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') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') if list_view_type is not None: - query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') + _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, '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 ) @@ -88,7 +88,7 @@ def build_delete_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -96,21 +96,21 @@ def build_delete_request_initial( "name": _SERIALIZER.url("name", 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 ) @@ -127,7 +127,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -135,21 +135,21 @@ def build_get_request( "name": _SERIALIZER.url("name", 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 ) @@ -167,7 +167,7 @@ def build_create_or_update_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -175,23 +175,23 @@ def build_create_or_update_request_initial( "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), } - 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, **kwargs ) @@ -240,9 +240,6 @@ def list( :type skip: str :param list_view_type: Status filter for schedule. :type list_view_type: str or ~azure.mgmt.machinelearningservices.models.ScheduleListViewType - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ScheduleResourceArmPaginatedResult or the result of cls(response) @@ -298,7 +295,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]: @@ -312,9 +313,9 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules"} # type: ignore - def _delete_initial( + def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -342,7 +343,11 @@ def _delete_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, 204]: @@ -359,11 +364,11 @@ def _delete_initial( if cls: return cls(pipeline_response, None, response_headers) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore @distributed_trace - def begin_delete( + def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -381,9 +386,6 @@ def begin_delete( :type workspace_name: str :param name: Schedule name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -397,7 +399,7 @@ def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: 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', @@ -430,10 +432,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.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore @distributed_trace def get( @@ -454,9 +455,6 @@ def get( :type workspace_name: str :param name: Schedule name. :type name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Schedule, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.Schedule @@ -482,7 +480,11 @@ def get( 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]: @@ -497,7 +499,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore def _create_or_update_initial( @@ -533,7 +535,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]: @@ -555,7 +561,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore @distributed_trace @@ -580,9 +586,6 @@ def begin_create_or_update( :type name: str :param body: Schedule definition. :type body: ~azure.mgmt.machinelearningservices.models.Schedule - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -597,7 +600,7 @@ def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.Schedule"] lro_delay = kwargs.pop( 'polling_interval', @@ -635,7 +638,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_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_usages_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_usages_operations.py index 0ddc7b3d314f..eaf2673542b7 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_usages_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_usages_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 TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,14 +17,13 @@ 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 if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -41,27 +41,27 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "location": _SERIALIZER.url("location", location, 'str', pattern=r'^[-\w\._]+$'), } - 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 ) @@ -100,9 +100,6 @@ def list( :param location: The location for which resource usage is queried. :type location: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ListUsagesResult or the result of cls(response) :rtype: @@ -151,7 +148,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]: @@ -165,4 +166,4 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_virtual_machine_sizes_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_virtual_machine_sizes_operations.py index 20dc5fbf5070..0c8ccb2106cb 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_virtual_machine_sizes_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_virtual_machine_sizes_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 TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -15,14 +16,13 @@ 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 if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar + from typing import Any, Callable, Dict, Optional, TypeVar T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,27 +40,27 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes") # pylint: disable=line-too-long path_format_arguments = { "location": _SERIALIZER.url("location", location, 'str', pattern=r'^[-\w\._]+$'), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), } - 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 ) @@ -98,9 +98,6 @@ def list( :param location: The location upon which virtual-machine-sizes is queried. :type location: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: VirtualMachineSizeListResult, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.VirtualMachineSizeListResult @@ -124,7 +121,11 @@ def list( 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]: @@ -139,5 +140,5 @@ def list( return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_workspace_connections_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_workspace_connections_operations.py index 7dce64062ad8..0e8b54fa156e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_workspace_connections_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_workspace_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 TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,14 +17,13 @@ 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 if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +44,7 @@ def build_create_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -52,23 +52,23 @@ def build_create_request( "connectionName": _SERIALIZER.url("connection_name", 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, **kwargs ) @@ -85,7 +85,7 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -93,21 +93,21 @@ def build_get_request( "connectionName": _SERIALIZER.url("connection_name", 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 ) @@ -124,7 +124,7 @@ def build_delete_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), @@ -132,21 +132,21 @@ def build_delete_request( "connectionName": _SERIALIZER.url("connection_name", 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 ) @@ -164,32 +164,32 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), "workspaceName": _SERIALIZER.url("workspace_name", workspace_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 = kwargs.pop("params", {}) # type: Dict[str, Any] if target is not None: - query_parameters['target'] = _SERIALIZER.query("target", target, 'str') + _query_parameters['target'] = _SERIALIZER.query("target", target, 'str') if category is not None: - query_parameters['category'] = _SERIALIZER.query("category", category, 'str') - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['category'] = _SERIALIZER.query("category", category, 'str') + _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 ) @@ -237,9 +237,6 @@ def create( :param parameters: The object for creating or updating a new workspace connection. :type parameters: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: WorkspaceConnectionPropertiesV2BasicResource, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource @@ -269,7 +266,11 @@ def create( 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]: @@ -284,7 +285,7 @@ def create( return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}'} # type: ignore + create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace @@ -304,9 +305,6 @@ def get( :type workspace_name: str :param connection_name: Friendly name of the workspace connection. :type connection_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: WorkspaceConnectionPropertiesV2BasicResource, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceConnectionPropertiesV2BasicResource @@ -332,7 +330,11 @@ def get( 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]: @@ -347,11 +349,11 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -367,9 +369,6 @@ def delete( :type workspace_name: str :param connection_name: Friendly name of the workspace connection. :type connection_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -395,7 +394,11 @@ def delete( 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, 204]: @@ -406,7 +409,7 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}"} # type: ignore @distributed_trace @@ -429,9 +432,6 @@ def list( :type target: str :param category: Category of the workspace connection. :type category: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult or the result of cls(response) @@ -487,7 +487,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]: @@ -501,4 +505,4 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_workspace_features_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_workspace_features_operations.py index 527e6f78f637..95365dd5eca7 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_workspace_features_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_workspace_features_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 TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,14 +17,13 @@ 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 if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,28 +42,28 @@ def build_list_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), "workspaceName": _SERIALIZER.url("workspace_name", workspace_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,9 +104,6 @@ def list( :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ListAmlUserFeatureResult or the result of cls(response) @@ -158,7 +155,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]: @@ -172,4 +173,4 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_workspaces_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_workspaces_operations.py index e277ab626ffe..86fa0ef46b74 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_workspaces_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_10_01_preview/operations/_workspaces_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 TYPE_CHECKING -import warnings + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,14 +19,13 @@ 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 if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,28 +44,28 @@ def build_get_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), "workspaceName": _SERIALIZER.url("workspace_name", workspace_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 ) @@ -82,30 +82,30 @@ def build_create_or_update_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), "workspaceName": _SERIALIZER.url("workspace_name", workspace_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, **kwargs ) @@ -121,28 +121,28 @@ def build_delete_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), "workspaceName": _SERIALIZER.url("workspace_name", workspace_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 ) @@ -159,30 +159,30 @@ def build_update_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), "workspaceName": _SERIALIZER.url("workspace_name", workspace_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, **kwargs ) @@ -198,29 +198,29 @@ def build_list_by_resource_group_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), } - 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') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, '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 ) @@ -237,30 +237,30 @@ def build_diagnose_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), "workspaceName": _SERIALIZER.url("workspace_name", workspace_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, **kwargs ) @@ -276,28 +276,28 @@ def build_list_keys_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), "workspaceName": _SERIALIZER.url("workspace_name", workspace_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 ) @@ -313,28 +313,28 @@ def build_resync_keys_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), "workspaceName": _SERIALIZER.url("workspace_name", workspace_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 ) @@ -349,28 +349,28 @@ def build_list_by_subscription_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), } - 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') if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, '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 ) @@ -386,28 +386,28 @@ def build_list_notebook_access_token_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), "workspaceName": _SERIALIZER.url("workspace_name", workspace_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 ) @@ -423,28 +423,28 @@ def build_prepare_notebook_request_initial( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), "workspaceName": _SERIALIZER.url("workspace_name", workspace_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 ) @@ -460,28 +460,28 @@ def build_list_storage_account_keys_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), "workspaceName": _SERIALIZER.url("workspace_name", workspace_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 ) @@ -497,28 +497,28 @@ def build_list_notebook_keys_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), "workspaceName": _SERIALIZER.url("workspace_name", workspace_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 ) @@ -534,28 +534,28 @@ def build_list_outbound_network_dependencies_endpoints_request( accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), "workspaceName": _SERIALIZER.url("workspace_name", workspace_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 ) @@ -596,9 +596,6 @@ def get( :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Workspace, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.Workspace @@ -623,7 +620,11 @@ def get( 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]: @@ -638,7 +639,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore def _create_or_update_initial( @@ -672,7 +673,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, 202]: @@ -688,7 +693,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace @@ -708,9 +713,6 @@ def begin_create_or_update( :type workspace_name: str :param parameters: The parameters for creating or updating a machine learning workspace. :type parameters: ~azure.mgmt.machinelearningservices.models.Workspace - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -725,7 +727,7 @@ def begin_create_or_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.Workspace"] lro_delay = kwargs.pop( 'polling_interval', @@ -762,12 +764,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.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore - def _delete_initial( + def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -793,7 +794,11 @@ def _delete_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, 204]: @@ -803,11 +808,11 @@ def _delete_initial( if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace - def begin_delete( + def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -820,9 +825,6 @@ def begin_delete( :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -836,7 +838,7 @@ def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: 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', @@ -868,10 +870,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.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore def _update_initial( self, @@ -904,7 +905,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]: @@ -920,7 +925,7 @@ def _update_initial( return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore + _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace @@ -940,9 +945,6 @@ def begin_update( :type workspace_name: str :param parameters: The parameters for updating a machine learning workspace. :type parameters: ~azure.mgmt.machinelearningservices.models.WorkspaceUpdateParameters - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -957,7 +959,7 @@ def begin_update( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.Workspace"] lro_delay = kwargs.pop( 'polling_interval', @@ -994,10 +996,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_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} # type: ignore + begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}"} # type: ignore @distributed_trace def list_by_resource_group( @@ -1013,9 +1014,6 @@ def list_by_resource_group( :type resource_group_name: str :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either WorkspaceListResult or the result of cls(response) :rtype: @@ -1066,7 +1064,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]: @@ -1080,7 +1082,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.MachineLearningServices/workspaces'} # type: ignore + list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore def _diagnose_initial( self, @@ -1116,7 +1118,11 @@ def _diagnose_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]: @@ -1138,7 +1144,7 @@ def _diagnose_initial( return deserialized - _diagnose_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose'} # type: ignore + _diagnose_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore @distributed_trace @@ -1160,9 +1166,6 @@ def begin_diagnose( :type workspace_name: str :param parameters: The parameter of diagnosing workspace health. :type parameters: ~azure.mgmt.machinelearningservices.models.DiagnoseWorkspaceParameters - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -1179,7 +1182,7 @@ def begin_diagnose( """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # 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.DiagnoseResponseResult"] lro_delay = kwargs.pop( 'polling_interval', @@ -1216,10 +1219,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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose'} # type: ignore + begin_diagnose.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose"} # type: ignore @distributed_trace def list_keys( @@ -1236,9 +1238,6 @@ def list_keys( :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ListWorkspaceKeysResult, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ListWorkspaceKeysResult @@ -1263,7 +1262,11 @@ def list_keys( 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]: @@ -1278,10 +1281,10 @@ def list_keys( return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys'} # type: ignore + list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys"} # type: ignore - def _resync_keys_initial( + def _resync_keys_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -1307,7 +1310,11 @@ def _resync_keys_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]: @@ -1317,11 +1324,11 @@ def _resync_keys_initial( if cls: return cls(pipeline_response, None, {}) - _resync_keys_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys'} # type: ignore + _resync_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore @distributed_trace - def begin_resync_keys( + def begin_resync_keys( # pylint: disable=inconsistent-return-statements self, resource_group_name, # type: str workspace_name, # type: str @@ -1335,9 +1342,6 @@ def begin_resync_keys( :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -1351,7 +1355,7 @@ def begin_resync_keys( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: 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', @@ -1383,10 +1387,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_resync_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys'} # type: ignore + begin_resync_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys"} # type: ignore @distributed_trace def list_by_subscription( @@ -1399,9 +1402,6 @@ def list_by_subscription( :param skip: Continuation token for pagination. :type skip: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either WorkspaceListResult or the result of cls(response) :rtype: @@ -1450,7 +1450,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]: @@ -1464,7 +1468,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces'} # type: ignore + list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces"} # type: ignore @distributed_trace def list_notebook_access_token( @@ -1480,9 +1484,6 @@ def list_notebook_access_token( :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: NotebookAccessTokenResult, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.NotebookAccessTokenResult @@ -1507,7 +1508,11 @@ def list_notebook_access_token( 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]: @@ -1522,7 +1527,7 @@ def list_notebook_access_token( return deserialized - list_notebook_access_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken'} # type: ignore + list_notebook_access_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken"} # type: ignore def _prepare_notebook_initial( @@ -1551,7 +1556,11 @@ def _prepare_notebook_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]: @@ -1567,7 +1576,7 @@ def _prepare_notebook_initial( return deserialized - _prepare_notebook_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook'} # type: ignore + _prepare_notebook_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore @distributed_trace @@ -1584,9 +1593,6 @@ def begin_prepare_notebook( :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -1602,7 +1608,7 @@ def begin_prepare_notebook( :raises: ~azure.core.exceptions.HttpResponseError """ api_version = kwargs.pop('api_version', "2022-10-01-preview") # type: 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.NotebookResourceInfo"] lro_delay = kwargs.pop( 'polling_interval', @@ -1637,10 +1643,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_prepare_notebook.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook'} # type: ignore + begin_prepare_notebook.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook"} # type: ignore @distributed_trace def list_storage_account_keys( @@ -1656,9 +1661,6 @@ def list_storage_account_keys( :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ListStorageAccountKeysResult, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ListStorageAccountKeysResult @@ -1683,7 +1685,11 @@ def list_storage_account_keys( 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]: @@ -1698,7 +1704,7 @@ def list_storage_account_keys( return deserialized - list_storage_account_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys'} # type: ignore + list_storage_account_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys"} # type: ignore @distributed_trace @@ -1715,9 +1721,6 @@ def list_notebook_keys( :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ListNotebookKeysResult, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ListNotebookKeysResult @@ -1742,7 +1745,11 @@ def list_notebook_keys( 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]: @@ -1757,7 +1764,7 @@ def list_notebook_keys( return deserialized - list_notebook_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys'} # type: ignore + list_notebook_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys"} # type: ignore @distributed_trace @@ -1778,9 +1785,6 @@ def list_outbound_network_dependencies_endpoints( :type resource_group_name: str :param workspace_name: Name of Azure Machine Learning workspace. :type workspace_name: str - :keyword api_version: Api Version. The default value is "2022-10-01-preview". Note that - overriding this default value may result in unsupported behavior. - :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ExternalFQDNResponse, or the result of cls(response) :rtype: ~azure.mgmt.machinelearningservices.models.ExternalFQDNResponse @@ -1805,7 +1809,11 @@ def list_outbound_network_dependencies_endpoints( 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]: @@ -1820,5 +1828,5 @@ def list_outbound_network_dependencies_endpoints( return deserialized - list_outbound_network_dependencies_endpoints.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints'} # type: ignore + list_outbound_network_dependencies_endpoints.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry.py index 579ef59a1b89..a9fce5140db0 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry.py @@ -4,45 +4,51 @@ from marshmallow import fields -from azure.ai.ml._schema.core.fields import NestedField, StringTransformedEnum, UnionField +from azure.ai.ml._schema.core.fields import DumpableStringField, NestedField, StringTransformedEnum, UnionField from azure.ai.ml._schema.core.resource import ResourceSchema from azure.ai.ml._utils.utils import snake_to_pascal from azure.ai.ml.constants._common import PublicNetworkAccess from azure.ai.ml.constants._registry import AcrAccountSku from azure.ai.ml.entities._registry.registry_support_classes import SystemCreatedAcrAccount +from azure.ai.ml._utils._experimental import experimental -from .registry_region_arm_details import RegistryRegionArmDetailsSchema +from azure.ai.ml._schema.workspace.identity import IdentitySchema +from .registry_region_arm_details import RegistryRegionDetailsSchema from .system_created_acr_account import SystemCreatedAcrAccountSchema from .util import acr_format_validator # Based on 10-01-preview api +@experimental class RegistrySchema(ResourceSchema): - # Inherits name, id, tag and description fields from ResourceSchema + # Inherits name, id, tags, and description fields from ResourceSchema # Values from RegistryTrackedResource (Client name: Registry) location = fields.Str(required=True) - # identity = ignored - output only - # kind = ignored - output only - # sku = ignored - output only # Values from Registry (Client name: RegistryProperties) public_network_access = StringTransformedEnum( allowed_values=[PublicNetworkAccess.DISABLED, PublicNetworkAccess.ENABLED], casing_transform=snake_to_pascal, ) - replication_locations = fields.List(NestedField(RegistryRegionArmDetailsSchema)) + replication_locations = fields.List(NestedField(RegistryRegionDetailsSchema)) intellectual_property_publisher = fields.Str() # This is an acr account which will be applied to every registryRegionArmDetail defined # in replication_locations. This is different from the internal swagger # definition, which has a per-region list of acr accounts. # Per-region acr account configuration is NOT possible through yaml configs for now. container_registry = UnionField( - [fields.Str(validate=acr_format_validator), NestedField(SystemCreatedAcrAccountSchema)], + [DumpableStringField(validate=acr_format_validator), NestedField(SystemCreatedAcrAccountSchema)], required=False, is_strict=True, load_default=SystemCreatedAcrAccount(acr_account_sku=AcrAccountSku.PREMIUM), ) - # managed_resource_group = ignored - output only - # mlflow_registry_uri = ignored - output only - # discovery_url = ignored - output only + + # Values that can only be set by return values from the system, never + # set by the user. + identity = NestedField(IdentitySchema, dump_only=True) + kind = fields.Str(dump_only=True) + sku = fields.Str(dump_only=True) + managed_resource_group = fields.Str(dump_only=True) + mlflow_registry_uri = fields.Str(dump_only=True) + discovery_url = fields.Str(dump_only=True) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry_region_arm_details.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry_region_arm_details.py index 19a681162bdb..8d62a1193734 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry_region_arm_details.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/registry_region_arm_details.py @@ -6,32 +6,56 @@ from marshmallow import ValidationError, fields, post_load, pre_dump -from azure.ai.ml._schema.core.fields import NestedField, UnionField +from azure.ai.ml._schema.core.fields import DumpableStringField, NestedField, UnionField from azure.ai.ml._schema.core.schema_meta import PatchedSchemaMeta +from azure.ai.ml.constants._registry import StorageAccountType +from azure.ai.ml.entities._registry.registry_support_classes import SystemCreatedStorageAccount +from azure.ai.ml._utils._experimental import experimental from .system_created_storage_account import SystemCreatedStorageAccountSchema from .util import storage_account_validator # Differs from the swagger def in that the acr_details can only be supplied as a # single registry-wide instance, rather than a per-region list. -class RegistryRegionArmDetailsSchema(metaclass=PatchedSchemaMeta): +@experimental +class RegistryRegionDetailsSchema(metaclass=PatchedSchemaMeta): + # Commenting this out for the time being. + # We do not want to surface the acr_config as a per-region configurable + # field. Instead we want to simplify the UX and surface it as a non-list, + # top-level value called 'container_registry'. + # We don't even want to show the per-region acr accounts when displaying a + # registry to the user, so this isn't even left as a dump-only field. + '''acr_config = fields.List( + UnionField( + [DumpableStringField(validate=acr_format_validator), NestedField(SystemCreatedAcrAccountSchema)], + dump_only=True, + is_strict=True, + ) + )''' location = fields.Str() - storage_config = fields.List( - UnionField([fields.Str(validate=storage_account_validator), NestedField(SystemCreatedStorageAccountSchema)]) + storage_config = UnionField( + [ + NestedField(SystemCreatedStorageAccountSchema), + fields.List(DumpableStringField(validate=storage_account_validator)), + ], + is_strict=True, + load_default=SystemCreatedStorageAccount( + storage_account_hns=False, storage_account_type=StorageAccountType.STANDARD_LRS + ), ) @post_load def make(self, data, **kwargs): - from azure.ai.ml.entities import RegistryRegionArmDetails + from azure.ai.ml.entities import RegistryRegionDetails data.pop("type", None) - return RegistryRegionArmDetails(**data) + return RegistryRegionDetails(**data) @pre_dump def predump(self, data, **kwargs): - from azure.ai.ml.entities import RegistryRegionArmDetails + from azure.ai.ml.entities import RegistryRegionDetails - if not isinstance(data, RegistryRegionArmDetails): - raise ValidationError("Cannot dump non-RegistryRegionArmDetails object into RegistryRegionArmDetailsSchema") + if not isinstance(data, RegistryRegionDetails): + raise ValidationError("Cannot dump non-RegistryRegionDetails object into RegistryRegionDetailsSchema") return data diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_acr_account.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_acr_account.py index 67285f9b001f..672dcd1e4b87 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_acr_account.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_acr_account.py @@ -6,11 +6,13 @@ from marshmallow import ValidationError, fields, post_load, pre_dump + from azure.ai.ml._schema import StringTransformedEnum from azure.ai.ml._schema.core.schema_meta import PatchedSchemaMeta from azure.ai.ml.constants._registry import AcrAccountSku +from azure.ai.ml._utils._experimental import experimental - +@experimental class SystemCreatedAcrAccountSchema(metaclass=PatchedSchemaMeta): arm_resource_id = fields.Str(dump_only=True) acr_account_sku = StringTransformedEnum( diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_storage_account.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_storage_account.py index 9bb0a01ee870..13ac77c2c05f 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_storage_account.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/system_created_storage_account.py @@ -6,11 +6,13 @@ from marshmallow import ValidationError, fields, post_load, pre_dump + from azure.ai.ml._schema import StringTransformedEnum from azure.ai.ml._schema.core.schema_meta import PatchedSchemaMeta from azure.ai.ml.constants._registry import StorageAccountType +from azure.ai.ml._utils._experimental import experimental - +@experimental class SystemCreatedStorageAccountSchema(metaclass=PatchedSchemaMeta): arm_resource_id = fields.Str(dump_only=True) storage_account_hns = fields.Bool() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/constants/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/constants/__init__.py index e0239983df05..251e50bc4da5 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/constants/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/constants/__init__.py @@ -7,8 +7,15 @@ from ._common import AssetTypes, GitProperties, InputOutputModes, ModelType, TimeZone from ._component import ParallelTaskType from ._deployment import BatchDeploymentOutputAction -from ._job import DistributionType, ImportSourceType, JobType -from ._job import ImageClassificationModelNames, ImageObjectDetectionModelNames, ImageInstanceSegmentationModelNames +from ._job import ( + DistributionType, + ImageClassificationModelNames, + ImageInstanceSegmentationModelNames, + ImageObjectDetectionModelNames, + ImportSourceType, + JobType, +) +from ._registry import StorageAccountType, AcrAccountSku from ._workspace import ManagedServiceIdentityType __all__ = [ @@ -26,4 +33,6 @@ "ImageClassificationModelNames", "ImageObjectDetectionModelNames", "ImageInstanceSegmentationModelNames", + "StorageAccountType", + "AcrAccountSku", ] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/constants/_common.py b/sdk/ml/azure-ai-ml/azure/ai/ml/constants/_common.py index 19d5b8c80535..9ecd32da8d83 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/constants/_common.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/constants/_common.py @@ -336,6 +336,7 @@ class YAMLRefDocLinks: COMMAND_COMPONENT = "https://aka.ms/ml-cli-v2-component-command-yaml-reference" PARALLEL_COMPONENT = "https://aka.ms/ml-cli-v2-component-parallel-yaml-reference" SCHEDULE = "https://aka.ms/ml-cli-v2-schedule-yaml-reference" + REGISTRY = "https://aka.ms/ml-cli-v2-registry-yaml-reference" class YAMLRefDocSchemaNames: diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/constants/_registry.py b/sdk/ml/azure-ai-ml/azure/ai/ml/constants/_registry.py index befd69dc1969..4577894b9222 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/constants/_registry.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/constants/_registry.py @@ -1,12 +1,12 @@ # --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- + import re from enum import Enum from azure.core import CaseInsensitiveEnumMeta - class StorageAccountType(str, Enum, metaclass=CaseInsensitiveEnumMeta): STANDARD_LRS = "Standard_LRS".lower() STANDARD_GRS = "Standard_GRS".lower() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/__init__.py index 5acd4847f82f..faaa0bf1538d 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/__init__.py @@ -73,7 +73,7 @@ ) from ._registry.registry import Registry from ._registry.registry_support_classes import ( - RegistryRegionArmDetails, + RegistryRegionDetails, SystemCreatedAcrAccount, SystemCreatedStorageAccount, ) @@ -200,7 +200,7 @@ "SystemCreatedAcrAccount", "SystemCreatedStorageAccount", "ValidationResult", - "RegistryRegionArmDetails", + "RegistryRegionDetails", "Registry", "SynapseSparkCompute", "AutoScaleSettings", diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_credentials.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_credentials.py index 215e4e9fdf13..c3e7e8f6c145 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_credentials.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_credentials.py @@ -44,6 +44,10 @@ Identity as RestIdentityConfiguration ) +from azure.ai.ml._restclient.v2022_10_01_preview.models import ( + ManagedServiceIdentity as RestRegistryManagedIdentity +) + class AccountKeyConfiguration(RestTranslatableMixin, ABC): def __init__( @@ -397,7 +401,7 @@ def _from_job_rest_object(cls, obj: RestAmlToken) -> "AmlTokenConfiguration": return cls() -# This class will be used to represent Identity property on compute and endpoint +# This class will be used to represent Identity property on compute, endpoint, and registry class IdentityConfiguration(RestTranslatableMixin): """Managed identity specification.""" @@ -442,6 +446,22 @@ def _from_compute_rest_object(cls, obj: RestIdentityConfiguration) -> "IdentityC result.tenant_id = obj.tenant_id return result + def _to_rest_object(self) -> RestRegistryManagedIdentity: + return RestRegistryManagedIdentity( + type=self.type, + principal_id=self.principal_id, + tenant_id=self.tenant_id, + ) + + @classmethod + def _from_rest_object(cls, obj: RestRegistryManagedIdentity) -> "IdentityConfiguration": + result = cls( + type=obj.type, + user_assigned_identities=None, + ) + result.principal_id = obj.principal_id + result.tenant_id = obj.tenant_id + return result class NoneCredentialConfiguration(RestTranslatableMixin): """None Credential Configuration.""" diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py index 9cdd0e954280..781a7d52274b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py @@ -2,32 +2,39 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- -# pylint: disable=too-many-instance-attributes +# pylint: disable=too-many-instance-attributes,protected-access from os import PathLike from pathlib import Path from typing import IO, AnyStr, Dict, List, Union +from azure.ai.ml._restclient.v2022_10_01_preview.models import ManagedServiceIdentity as RestManagedServiceIdentity +from azure.ai.ml._restclient.v2022_10_01_preview.models import ( + ManagedServiceIdentityType as RestManagedServiceIdentityType, +) from azure.ai.ml._restclient.v2022_10_01_preview.models import Registry as RestRegistry +from azure.ai.ml._restclient.v2022_10_01_preview.models import RegistryProperties from azure.ai.ml._schema.registry.registry import RegistrySchema from azure.ai.ml._utils.utils import dump_yaml_to_file from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY, PARAMS_OVERRIDE_KEY +from azure.ai.ml.entities._credentials import IdentityConfiguration from azure.ai.ml.entities._resource import Resource from azure.ai.ml.entities._util import load_from_dict +from azure.ai.ml._utils._experimental import experimental -from .registry_support_classes import RegistryRegionArmDetails - -YAML_REGION_DETAILS = "replication_locations" -YAML_SINGLE_ACR_DETAIL = "container_registry" -CLASS_REGION_DETAILS = "region_details" +from .registry_support_classes import RegistryRegionDetails, SystemCreatedStorageAccount +CONTAINER_REGISTRY = "container_registry" +REPLICATION_LOCATIONS = "replication_locations" +@experimental class Registry(Resource): def __init__( self, *, name: str, location: str, + identity: IdentityConfiguration = None, description: str = None, tags: Dict[str, str] = None, public_network_access: str = None, @@ -35,28 +42,33 @@ def __init__( intellectual_property_publisher: str = None, managed_resource_group: str = None, mlflow_registry_uri: str = None, - region_details: List[RegistryRegionArmDetails], + replication_locations: List[RegistryRegionDetails], **kwargs, ): - """Azure ML registry. :param name: Name of the registry. Must be globally unique and is immutable. :type name: str - :param tags: Tags of the registry. - :type tags: dict :param location: The location this registry resource is located in. :type location: str + :param identity: registry's System Managed Identity + :type identity: ManagedServiceIdentity :param description: Description of the registry. :type description: str + :param tags: Tags of the registry. + :type tags: dict :param public_network_access: Whether to allow public endpoint connectivity. :type public_network_access: str + :param discovery_url: Backend service base url for the registry. + :type discovery_url: str :param intellectual_property_publisher: Intellectual property publisher. :type intellectual_property_publisher: str :param managed_resource_group: Managed resource group created for the registry. :type managed_resource_group: str + :param mlflow_registry_uri: Ml flow tracking uri for the registry. + :type mlflow_registry_uri: str :param region_details: Details of each region the registry is in. - :type region_details: List[RegistryRegionArmDetails] + :type region_details: List[RegistryRegionDetails] :param kwargs: A dictionary of additional configuration parameters. :type kwargs: dict """ @@ -65,12 +77,14 @@ def __init__( # self.display_name = name # Do we need a top-level visible name value? self.location = location - self.region_details = region_details + self.identity = identity + self.replication_locations = replication_locations self.public_network_access = public_network_access self.intellectual_property_publisher = intellectual_property_publisher self.managed_resource_group = managed_resource_group self.discovery_url = discovery_url self.mlflow_registry_uri = mlflow_registry_uri + self.container_registry = None def dump( self, @@ -85,9 +99,34 @@ def dump( yaml_serialized = self._to_dict() dump_yaml_to_file(dest, yaml_serialized, default_flow_style=False) + # The internal structure of the registry object is closer to how it's + # represented by the registry API, which differs from how registries + # are represented in YAML. This function converts those differences. def _to_dict(self) -> Dict: # pylint: disable=no-member - return RegistrySchema(context={BASE_PATH_CONTEXT_KEY: "./"}).dump(self) + schema = RegistrySchema(context={BASE_PATH_CONTEXT_KEY: "./"}) + + # Grab the first acr account of the first region and set that + # as the system-wide container registry. + # Although support for multiple ACRs per region, as well as + # different ACRs per region technically exist according to the + # API schema, we do not want to surface that as an option, + # since the use cases for variable/multiple ACRs are extremely + # limited, and would probably just confuse most users. + if self.replication_locations and len(self.replication_locations) > 0: + if self.replication_locations[0].acr_config and len(self.replication_locations[0].acr_config) > 0: + self.container_registry = self.replication_locations[0].acr_config[0] + + # Change single-list managed storage accounts to not be lists. + # Although storage accounts are storage in a list to match the + # underlying API, users should only enter in one managed storage + # in YAML. + for region_detail in self.replication_locations: + if region_detail.storage_config and isinstance( + region_detail.storage_config[0], SystemCreatedStorageAccount + ): + region_detail.storage_config = region_detail.storage_config[0] + return schema.dump(self) @classmethod def _load( @@ -105,8 +144,6 @@ def _load( } loaded_schema = load_from_dict(RegistrySchema, data, context, **kwargs) cls._convert_yaml_dict_to_entity_input(loaded_schema) - # https://dev.azure.com/msdata/Vienna/_workitems/edit/1971490/ - # TODO - ensure that top-level location, if set, exists among managed locations, throw error otherwise. return Registry(**loaded_schema) @classmethod @@ -115,22 +152,28 @@ def _from_rest_object(cls, rest_obj: RestRegistry) -> "Registry": return None real_registry = rest_obj.properties - region_details = [] + # Convert from api name region_details to user-shown name "replication locations" + replication_locations = [] if real_registry.region_details: - region_details = [ - RegistryRegionArmDetails._from_rest_object(details) for details in real_registry.region_details # pylint: disable=protected-access + replication_locations = [ + RegistryRegionDetails._from_rest_object(details) for details in real_registry.region_details # pylint: disable=protected-access ] + identity = None + if rest_obj.identity and isinstance(rest_obj.identity, RestManagedServiceIdentity): + identity = IdentityConfiguration._from_rest_object(rest_obj.identity) return Registry( name=rest_obj.name, description=real_registry.description, - tags=real_registry.tags, + identity=identity, + id=rest_obj.id, + tags=rest_obj.tags, location=rest_obj.location, public_network_access=real_registry.public_network_access, discovery_url=real_registry.discovery_url, intellectual_property_publisher=real_registry.intellectual_property_publisher, managed_resource_group=real_registry.managed_resource_group, mlflow_registry_uri=real_registry.ml_flow_registry_uri, - region_details=region_details, + replication_locations=replication_locations, ) # There are differences between what our registry validation schema @@ -138,20 +181,51 @@ def _from_rest_object(cls, rest_obj: RestRegistry) -> "Registry": # This is mostly due to the compromise required to balance # the actual shape of registries as they're defined by # autorest with how the spec wanted users to be able to - # configure them + # configure them. This function should eventually be @classmethod def _convert_yaml_dict_to_entity_input( cls, input: Dict, # pylint: disable=redefined-builtin ): - # change replication_locations to region_details + # pop container_registry value. global_acr_exists = False - if YAML_REGION_DETAILS in input: - input[CLASS_REGION_DETAILS] = input.pop(YAML_REGION_DETAILS) - if YAML_SINGLE_ACR_DETAIL in input: - acr_input = input.pop(YAML_SINGLE_ACR_DETAIL) + if CONTAINER_REGISTRY in input: + acr_input = input.pop(CONTAINER_REGISTRY) global_acr_exists = True - for region_detail in input[CLASS_REGION_DETAILS]: + for region_detail in input[REPLICATION_LOCATIONS]: + # Apply container_registry as acr_config of each region detail if global_acr_exists: if not hasattr(region_detail, "acr_details") or len(region_detail.acr_details) == 0: region_detail.acr_config = [acr_input] + # Convert single, non-list managed storage into a 1-element list. + if hasattr(region_detail, "storage_config") and isinstance(region_detail.storage_config, \ + SystemCreatedStorageAccount): + region_detail.storage_config = [region_detail.storage_config] + + + def _to_rest_object(self) -> RestRegistry: + """Build current parameterized schedule instance to a registry object before submission. + + :return: Rest registry. + """ + identity = RestManagedServiceIdentity(type=RestManagedServiceIdentityType.SYSTEM_ASSIGNED) + replication_locations = [] + if self.replication_locations: + replication_locations = [details._to_rest_object() for details in self.replication_locations] + return RestRegistry( + name=self.name, + location=self.location, + identity=identity, + tags=self.tags, + description=self.description, + properties=RegistryProperties( + #tags=self.tags, interior tags exist due to swagger inheritance + # issues, don't actually use them. + public_network_access=self.public_network_access, + discovery_url=self.discovery_url, + intellectual_property_publisher=self.intellectual_property_publisher, + managed_resource_group=self.managed_resource_group, + ml_flow_registry_uri=self.mlflow_registry_uri, + region_details=replication_locations, + ), + ) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py index 1ef8198b7656..20f70a0eb105 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry_support_classes.py @@ -1,17 +1,26 @@ # --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- +# pylint:disable=protected-access,no-else-return from typing import List, Union -from azure.ai.ml._restclient.v2022_10_01_preview.models import AcrDetails as RestAcrDetails -from azure.ai.ml._restclient.v2022_10_01_preview.models import RegistryRegionArmDetails as RestRegistryRegionArmDetails -from azure.ai.ml._restclient.v2022_10_01_preview.models import StorageAccountDetails as RestStorageAccountDetails +from azure.ai.ml._restclient.v2022_10_01_preview.models import ( + AcrDetails as RestAcrDetails, + ArmResourceId as RestArmResourceId, + RegistryRegionArmDetails as RestRegistryRegionArmDetails, + StorageAccountDetails as RestStorageAccountDetails, + SystemCreatedAcrAccount as RestSystemCreatedAcrAccount, + SystemCreatedStorageAccount as RestSystemCreatedStorageAccount, + UserCreatedAcrAccount as RestUserCreatedAcrAccount, + UserCreatedStorageAccount as RestUserCreatedStorageAccount) +from azure.ai.ml._utils._experimental import experimental from azure.ai.ml.constants._registry import StorageAccountType # This exists despite not being used by the schema validator because this entire # class is an output only value from the API. +@experimental class SystemCreatedAcrAccount: def __init__( self, @@ -26,12 +35,57 @@ def __init__( only Premium is a valid option for registries. :type acr_account_sku: str :param arm_resource_id: Resource ID of the ACR account. - :type arm_resource_id: str + :type arm_resource_id: str. Default value is None. """ self.acr_account_sku = acr_account_sku self.arm_resource_id = arm_resource_id + # acr should technically be a union between str and SystemCreatedAcrAccount, + # but python doesn't accept self class references apparently. + # Class method instead of normal function to accept possible + # string input. + @classmethod + def _to_rest_object(cls, acr) -> RestAcrDetails: + if hasattr(acr, "acr_account_sku") and acr.acr_account_sku is not None: + # SKU enum requires input to be a capitalized word, + # so we format the input to be acceptable as long as spelling is + # correct. + acr_account_sku = acr.acr_account_sku.capitalize() + # We DO NOT want to set the arm_resource_id. The backend provides very + # unhelpful errors if you provide an empty/null/invalid resource ID, + # and ignores the value otherwise. It's better to avoid setting it in + # the conversion in this direction at all. + return RestAcrDetails( + system_created_acr_account=RestSystemCreatedAcrAccount( + acr_account_sku=acr_account_sku, + ) + ) + else: + return RestAcrDetails( + user_created_acr_account=RestUserCreatedAcrAccount( + arm_resource_id=RestArmResourceId(resource_id=acr)) + ) + + @classmethod + def _from_rest_object(cls, rest_obj: RestAcrDetails) -> "Union[str, SystemCreatedAcrAccount]": + if not rest_obj: + return None + # TODO should we even bother check if both values are set and throw an error? This shouldn't be possible. + if hasattr(rest_obj, "system_created_acr_account") and rest_obj.system_created_acr_account is not None: + resource_id = None + if rest_obj.system_created_acr_account.arm_resource_id: + resource_id = rest_obj.system_created_acr_account.arm_resource_id.resource_id + return SystemCreatedAcrAccount( + acr_account_sku=rest_obj.system_created_acr_account.acr_account_sku, + arm_resource_id=resource_id, + ) + elif hasattr(rest_obj, "user_created_acr_account") and rest_obj.user_created_acr_account is not None: + return rest_obj.user_created_acr_account.arm_resource_id.resource_id + else: + return None # TODO should this throw an error instead? + +@experimental class SystemCreatedStorageAccount: def __init__( self, @@ -55,9 +109,58 @@ def __init__( self.storage_account_hns = storage_account_hns self.storage_account_type = storage_account_type + # storage should technically be a union between str and SystemCreatedStorageAccount, + # but python doesn't accept self class references apparently. + # Class method instead of normal function to accept possible + # string input. + + @classmethod + def _to_rest_object(cls, storage) -> RestStorageAccountDetails: + if hasattr(storage, "storage_account_type") and storage.storage_account_type is not None: + + # We DO NOT want to set the arm_resource_id. The backend provides very + # unhelpful errors if you provide an empty/null/invalid resource ID, + # and ignores the value otherwise. It's better to avoid setting it in + # the conversion in this direction at all. + # We don't bother processing storage_account_type because the + # rest version is case insensitive. + account = RestSystemCreatedStorageAccount( + storage_account_hns_enabled=storage.storage_account_hns, + storage_account_type=storage.storage_account_type, + ) + return RestStorageAccountDetails(system_created_storage_account=account) + else: + return RestStorageAccountDetails( + user_created_storage_account=RestUserCreatedStorageAccount( + arm_resource_id=RestArmResourceId(resource_id=storage) + ) + ) + + @classmethod + def _from_rest_object(cls, rest_obj: RestStorageAccountDetails) -> "Union[str, SystemCreatedStorageAccount]": + if not rest_obj: + return None + # TODO should we even bother check if both values are set and throw an error? This shouldn't be possible. + if rest_obj.system_created_storage_account: + resource_id = None + if rest_obj.system_created_storage_account.arm_resource_id: + resource_id = rest_obj.system_created_storage_account.arm_resource_id.resource_id + return SystemCreatedStorageAccount( + storage_account_hns=rest_obj.system_created_storage_account.storage_account_hns_enabled, + storage_account_type=StorageAccountType( + rest_obj.system_created_storage_account.storage_account_type.lower() + ), # TODO validate storage account type? + arm_resource_id=resource_id, + ) + elif rest_obj.user_created_storage_account: + return rest_obj.user_created_storage_account.arm_resource_id.resource_id + else: + return None # TODO should this throw an error instead? + # Per-region information for registries. -class RegistryRegionArmDetails: +@experimental +class RegistryRegionDetails: def __init__( self, *, @@ -68,7 +171,7 @@ def __init__( """ Details for each region a registry is in. - :param acr_details: List of ACR details. Each value can either be a + :param acr_details: List of ACR account details. Each value can either be a single string representing the arm_resource_id of a user-created acr_details object, or a entire SystemCreatedAcrAccount object. :type acr_details: List[Union[str, SystemCreatedAcrAccount]] @@ -85,46 +188,32 @@ def __init__( self.storage_config = storage_config @classmethod - def _from_rest_object(cls, rest_obj: RestRegistryRegionArmDetails) -> "RegistryRegionArmDetails": + def _from_rest_object(cls, rest_obj: RestRegistryRegionArmDetails) -> "RegistryRegionDetails": if not rest_obj: return None converted_acr_details = [] if rest_obj.acr_details: - converted_acr_details = [convert_rest_acr(acr) for acr in rest_obj.acr_details] + converted_acr_details = [SystemCreatedAcrAccount._from_rest_object( + acr) for acr in rest_obj.acr_details] storages = [] if rest_obj.storage_account_details: - storages = [convert_rest_storage(storages) for storages in rest_obj.storage_account_details] - return RegistryRegionArmDetails( + storages = [SystemCreatedStorageAccount._from_rest_object( + storages) for storages in rest_obj.storage_account_details] + return RegistryRegionDetails( acr_config=converted_acr_details, location=rest_obj.location, storage_config=storages ) - -def convert_rest_acr(rest_obj: RestAcrDetails) -> "Union[str, SystemCreatedAcrAccount]": - if not rest_obj: - return None - # TODO should we even bother check if both values are set and throw an error? This shouldn't be possible. - if rest_obj.system_created_acr_account: - return SystemCreatedAcrAccount( - acr_account_sku=rest_obj.system_created_acr_account.acr_account_sku, - arm_resource_id=rest_obj.system_created_acr_account.arm_resource_id, - ) - if rest_obj.user_created_acr_account: - return rest_obj.user_created_acr_account - return None # TODO should this throw an error instead? - - -def convert_rest_storage(rest_obj: RestStorageAccountDetails) -> "Union[str, SystemCreatedStorageAccount]": - if not rest_obj: - return None - # TODO should we even bother check if both values are set and throw an error? This shouldn't be possible. - if rest_obj.system_created_storage_account: - return SystemCreatedStorageAccount( - storage_account_hns=rest_obj.system_created_storage_account.storage_account_hns_enabled, - storage_account_type=StorageAccountType( - rest_obj.system_created_storage_account.storage_account_type.lower() - ), # TODO validate storage account type? - arm_resource_id=rest_obj.system_created_storage_account.arm_resource_id, + def _to_rest_object(self) -> RestRegistryRegionArmDetails: + converted_acr_details = [] + if self.acr_config: + converted_acr_details = [SystemCreatedAcrAccount._to_rest_object( + acr) for acr in self.acr_config] + storages = [] + if self.storage_config: + storages = [SystemCreatedStorageAccount._to_rest_object( + storage) for storage in self.storage_config] + return RestRegistryRegionArmDetails( + acr_details=converted_acr_details, + location=self.location, + storage_account_details=storages, ) - if rest_obj.user_created_storage_account: - return rest_obj.user_created_storage_account - return None # TODO should this throw an error instead? diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py index 91184b944e2c..1d9c22313bb5 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py @@ -2,23 +2,29 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- -# pylint: disable=protected-access +# pylint: disable=protected-access,unused-argument from typing import Dict, Iterable -from azure.ai.ml._restclient.v2022_10_01_preview import AzureMachineLearningWorkspaces as ServiceClient102022 -from azure.ai.ml._restclient.v2022_10_01_preview.models import Registry as RestRegistry -from azure.ai.ml._scope_dependent_operations import OperationsContainer, OperationScope +from azure.ai.ml._restclient.v2022_10_01_preview import \ + AzureMachineLearningWorkspaces as ServiceClient102022 +from azure.ai.ml._scope_dependent_operations import (OperationsContainer, + OperationScope) from azure.ai.ml._utils._logger_utils import OpsLogger from azure.ai.ml.entities import Registry -from azure.ai.ml.exceptions import ErrorCategory, ErrorTarget, ValidationException +from azure.ai.ml.exceptions import (ErrorCategory, ErrorTarget, + ValidationException) from azure.core.credentials import TokenCredential from azure.core.polling import LROPoller +from azure.ai.ml._utils._experimental import experimental +from .._utils._azureml_polling import AzureMLPolling +from ..constants._common import LROConfigurations + ops_logger = OpsLogger(__name__) module_logger = ops_logger.module_logger - +@experimental class RegistryOperations: """RegistryOperations. @@ -45,18 +51,17 @@ def __init__( self.containerRegistry = "none" self._init_kwargs = kwargs - # @monitor_with_activity(logger, "Registry.List", ActivityType.PUBLICAPI) + #@ monitor_with_activity(logger, "Registry.List", ActivityType.PUBLICAPI) def list(self) -> Iterable[Registry]: """List all registries that the user has access to in the current - resource group or subscription. + resource group. - :param scope: scope of the listing, "resource_group" or "subscription", defaults to "resource_group" - :type scope: str, optional :return: An iterator like instance of Registry objects :rtype: ~azure.core.paging.ItemPaged[Registry] """ - return self._operation.list_by_subscription(cls=lambda objs: [Registry._from_rest_object(obj) for obj in objs]) + return self._operation.list(cls=lambda objs: [Registry._from_rest_object(obj) for obj in objs], \ + resource_group_name=self._resource_group_name) # @monitor_with_activity(logger, "Registry.Get", ActivityType.PUBLICAPI) def get(self, name: str = None) -> Registry: @@ -87,11 +92,40 @@ def _check_registry_name(self, name) -> str: ) return registry_name + def _get_polling(self, name): + """Return the polling with custom poll interval.""" + path_format_arguments = { + "registryName": name, + "resourceGroupName": self._resource_group_name, + } + return AzureMLPolling( + LROConfigurations.POLL_INTERVAL, + path_format_arguments=path_format_arguments, + ) + # @monitor_with_activity(logger, "Registry.BeginCreate", ActivityType.PUBLICAPI) - def begin_create_or_update( + def begin_create( self, registry: Registry, - update_dependent_resources: bool = False, **kwargs: Dict, - ) -> LROPoller[RestRegistry]: - raise NotImplementedError("Placeholder until implemented in subsequent task.") + ) -> LROPoller[Registry]: + """Create a new Azure Machine Learning Registry. + + Returns the registry if already exists. + + :param registry: Registry definition. + :type registry: Registry + :return: A poller to track the operation status. + :rtype: LROPoller + """ + registry_data = registry._to_rest_object() + poller = self._operation.begin_create_or_update( + resource_group_name=self._resource_group_name, + registry_name=registry.name, + body=registry_data, + polling=self._get_polling(registry.name), + cls=lambda response, deserialized, headers: Registry._from_rest_object( + deserialized), + ) + + return poller diff --git a/sdk/ml/azure-ai-ml/tests/conftest.py b/sdk/ml/azure-ai-ml/tests/conftest.py index 3b88f84166c6..2bb4d8e73620 100644 --- a/sdk/ml/azure-ai-ml/tests/conftest.py +++ b/sdk/ml/azure-ai-ml/tests/conftest.py @@ -10,36 +10,37 @@ from unittest.mock import Mock import pytest -from pytest_mock import MockFixture -from test_utilities.constants import Test_Registry_Name, Test_Resource_Group, Test_Subscription, Test_Workspace_Name - from azure.ai.ml import MLClient, load_component, load_job -from azure.ai.ml._restclient.registry_discovery import AzureMachineLearningWorkspaces as ServiceClientRegistryDiscovery -from azure.ai.ml._scope_dependent_operations import OperationScope, OperationConfig +from azure.ai.ml._restclient.registry_discovery import \ + AzureMachineLearningWorkspaces as ServiceClientRegistryDiscovery +from azure.ai.ml._scope_dependent_operations import (OperationConfig, + OperationScope) from azure.ai.ml._utils._asset_utils import get_object_hash from azure.ai.ml._utils.utils import hash_dict from azure.ai.ml.constants._common import GitProperties from azure.ai.ml.entities import AzureBlobDatastore, Component from azure.ai.ml.entities._assets import Data, Model -from azure.ai.ml.entities._component.parallel_component import ParallelComponent +from azure.ai.ml.entities._component.parallel_component import \ + ParallelComponent from azure.ai.ml.entities._credentials import NoneCredentialConfiguration from azure.ai.ml.entities._job.job_name_generator import generate_job_name from azure.ai.ml.operations._run_history_constants import RunHistoryConstants from azure.core.exceptions import ResourceNotFoundError -from azure.identity import ClientSecretCredential, DefaultAzureCredential, AzureCliCredential - -from devtools_testutils import ( - test_proxy, - is_live, - add_general_string_sanitizer, - add_body_key_sanitizer, - add_remove_header_sanitizer, - set_custom_default_matcher, - add_general_regex_sanitizer, -) -from devtools_testutils.proxy_fixtures import VariableRecorder, variable_recorder +from azure.identity import (AzureCliCredential, ClientSecretCredential, + DefaultAzureCredential) +from devtools_testutils import (add_body_key_sanitizer, + add_general_regex_sanitizer, + add_general_string_sanitizer, + add_remove_header_sanitizer, is_live, + set_custom_default_matcher, test_proxy) from devtools_testutils.fake_credentials import FakeTokenCredential from devtools_testutils.helpers import is_live_and_not_recording +from devtools_testutils.proxy_fixtures import (VariableRecorder, + variable_recorder) +from pytest_mock import MockFixture + +from test_utilities.constants import (Test_Registry_Name, Test_Resource_Group, + Test_Subscription, Test_Workspace_Name) E2E_TEST_LOGGING_ENABLED = "E2E_TEST_LOGGING_ENABLED" test_folder = Path(os.path.abspath(__file__)).parent.absolute() @@ -60,19 +61,30 @@ def fake_datastore_key() -> str: @pytest.fixture(autouse=True) def add_sanitizers(test_proxy, fake_datastore_key): add_remove_header_sanitizer(headers="x-azureml-token,Log-URL") - set_custom_default_matcher(excluded_headers="x-ms-meta-name,x-ms-meta-version") + set_custom_default_matcher( + excluded_headers="x-ms-meta-name,x-ms-meta-version") add_body_key_sanitizer(json_path="$.key", value=fake_datastore_key) add_body_key_sanitizer(json_path="$....key", value=fake_datastore_key) - add_body_key_sanitizer(json_path="$.properties.properties.['mlflow.source.git.repoURL']", value="fake_git_url") - add_body_key_sanitizer(json_path="$.properties.properties.['mlflow.source.git.branch']", value="fake_git_branch") - add_body_key_sanitizer(json_path="$.properties.properties.['mlflow.source.git.commit']", value="fake_git_commit") - add_body_key_sanitizer(json_path="$.properties.properties.hash_sha256", value="0000000000000") - add_body_key_sanitizer(json_path="$.properties.properties.hash_version", value="0000000000000") - add_body_key_sanitizer(json_path="$.properties.properties.['azureml.git.dirty']", value="fake_git_dirty_value") - add_general_regex_sanitizer(value="", regex=f"\\u0026tid={os.environ.get('ML_TENANT_ID')}") - add_general_string_sanitizer(value="", target=f"&tid={os.environ.get('ML_TENANT_ID')}") - add_general_regex_sanitizer(value="00000000000000000000000000000000", regex="\\/LocalUpload\\/(\\S{32})\\/?", group_for_replace="1") - add_general_regex_sanitizer(value="00000000000000000000000000000000", regex="\\/az-ml-artifacts\\/(\\S{32})\\/", group_for_replace="1") + add_body_key_sanitizer( + json_path="$.properties.properties.['mlflow.source.git.repoURL']", value="fake_git_url") + add_body_key_sanitizer( + json_path="$.properties.properties.['mlflow.source.git.branch']", value="fake_git_branch") + add_body_key_sanitizer( + json_path="$.properties.properties.['mlflow.source.git.commit']", value="fake_git_commit") + add_body_key_sanitizer( + json_path="$.properties.properties.hash_sha256", value="0000000000000") + add_body_key_sanitizer( + json_path="$.properties.properties.hash_version", value="0000000000000") + add_body_key_sanitizer( + json_path="$.properties.properties.['azureml.git.dirty']", value="fake_git_dirty_value") + add_general_regex_sanitizer( + value="", regex=f"\\u0026tid={os.environ.get('ML_TENANT_ID')}") + add_general_string_sanitizer( + value="", target=f"&tid={os.environ.get('ML_TENANT_ID')}") + add_general_regex_sanitizer(value="00000000000000000000000000000000", + regex="\\/LocalUpload\\/(\\S{32})\\/?", group_for_replace="1") + add_general_regex_sanitizer(value="00000000000000000000000000000000", + regex="\\/az-ml-artifacts\\/(\\S{32})\\/", group_for_replace="1") def pytest_addoption(parser): @@ -95,10 +107,12 @@ def mock_workspace_scope() -> OperationScope: subscription_id=Test_Subscription, resource_group_name=Test_Resource_Group, workspace_name=Test_Workspace_Name ) + @pytest.fixture def mock_operation_config() -> OperationConfig: yield OperationConfig(True) + @pytest.fixture def sanitized_environment_variables(environment_variables, fake_datastore_key) -> dict: sanitizings = { @@ -125,7 +139,8 @@ def mock_registry_scope() -> OperationScope: @pytest.fixture def mock_machinelearning_client(mocker: MockFixture) -> MLClient: # TODO(1628638): remove when 2022_02 api is available in ARM - mocker.patch("azure.ai.ml.operations.JobOperations._get_workspace_url", return_value="xxx") + mocker.patch( + "azure.ai.ml.operations.JobOperations._get_workspace_url", return_value="xxx") yield MLClient( credential=Mock(spec_set=DefaultAzureCredential), subscription_id=Test_Subscription, @@ -250,10 +265,10 @@ def only_registry_client(e2e_ws_scope: OperationScope, auth: ClientSecretCredent @pytest.fixture -def crud_registry_client(e2e_ws_scope: OperationScope) -> MLClient: +def crud_registry_client(e2e_ws_scope: OperationScope, auth: ClientSecretCredential) -> MLClient: """return a machine learning client using default e2e testing workspace""" return MLClient( - credential=get_auth(), + credential=auth, subscription_id=e2e_ws_scope.subscription_id, resource_group_name=e2e_ws_scope.resource_group_name, logging_enable=getenv(E2E_TEST_LOGGING_ENABLED), @@ -290,7 +305,8 @@ def data_with_2_versions(client: MLClient) -> str: @pytest.fixture def batch_endpoint_model(client: MLClient) -> Model: name = "sklearn_regression_model" - model = Model(name=name, version="1", path="tests/test_configs/batch_setup/batch_endpoint_model") + model = Model(name=name, version="1", + path="tests/test_configs/batch_setup/batch_endpoint_model") try: model = client.models.get(name, "1") @@ -316,7 +332,8 @@ def light_gbm_model(client: MLClient) -> Model: job = client.jobs.create_or_update(job) job_status = job.status while job_status not in RunHistoryConstants.TERMINAL_STATUSES: - print(f"Job status is {job_status}, waiting for 30 seconds for the job to finish.") + print( + f"Job status is {job_status}, waiting for 30 seconds for the job to finish.") time.sleep(30) job_status = client.jobs.get(job_name).status @@ -346,21 +363,24 @@ def batch_inference(client: MLClient) -> ParallelComponent: @pytest.fixture def pipeline_samples_e2e_registered_train_components(client: MLClient) -> Component: return _load_or_create_component( - client, path=test_folder / "./test_configs/dsl_pipeline/e2e_registered_components/train.yml" + client, path=test_folder / + "./test_configs/dsl_pipeline/e2e_registered_components/train.yml" ) @pytest.fixture def pipeline_samples_e2e_registered_score_components(client: MLClient) -> Component: return _load_or_create_component( - client, path=test_folder / "./test_configs/dsl_pipeline/e2e_registered_components/score.yml" + client, path=test_folder / + "./test_configs/dsl_pipeline/e2e_registered_components/score.yml" ) @pytest.fixture def pipeline_samples_e2e_registered_eval_components(client: MLClient) -> Component: return _load_or_create_component( - client, path=test_folder / "./test_configs/dsl_pipeline/e2e_registered_components/eval.yml" + client, path=test_folder / + "./test_configs/dsl_pipeline/e2e_registered_components/eval.yml" ) @@ -371,9 +391,11 @@ def generate_hash(): return str(uuid.uuid4()) if is_live_and_not_recording(): - mocker.patch("azure.ai.ml._artifacts._artifact_utilities.get_object_hash", side_effect=generate_hash) + mocker.patch( + "azure.ai.ml._artifacts._artifact_utilities.get_object_hash", side_effect=generate_hash) elif not is_live(): - mocker.patch("azure.ai.ml._artifacts._artifact_utilities.get_object_hash", return_value="00000000000000000000000000000000") + mocker.patch("azure.ai.ml._artifacts._artifact_utilities.get_object_hash", + return_value="00000000000000000000000000000000") @pytest.fixture @@ -386,9 +408,11 @@ def generate_uuid(*args, **kwargs): return real_uuid if is_live(): - mocker.patch("azure.ai.ml.entities._assets.asset._get_random_name", side_effect=generate_uuid) + mocker.patch( + "azure.ai.ml.entities._assets.asset._get_random_name", side_effect=generate_uuid) else: - mocker.patch("azure.ai.ml.entities._assets.asset._get_random_name", return_value=fake_uuid) + mocker.patch( + "azure.ai.ml.entities._assets.asset._get_random_name", return_value=fake_uuid) @pytest.fixture @@ -397,13 +421,16 @@ def mock_component_hash(mocker: MockFixture): def generate_compononent_hash(*args, **kwargs): dict_hash = hash_dict(*args, **kwargs) - add_general_string_sanitizer(value=fake_component_hash, target=dict_hash) + add_general_string_sanitizer( + value=fake_component_hash, target=dict_hash) return dict_hash if is_live(): - mocker.patch("azure.ai.ml.entities._component.component.hash_dict", side_effect=generate_compononent_hash) + mocker.patch("azure.ai.ml.entities._component.component.hash_dict", + side_effect=generate_compononent_hash) else: - mocker.patch("azure.ai.ml.entities._component.component.hash_dict", return_value=fake_component_hash) + mocker.patch("azure.ai.ml.entities._component.component.hash_dict", + return_value=fake_component_hash) @pytest.fixture @@ -421,7 +448,8 @@ def generate_mock_workspace_deployment_name(name: str): @pytest.fixture def mock_workspace_dependent_resource_name_generator(mocker: MockFixture, variable_recorder: VariableRecorder): def generate_mock_workspace_dependent_resource_name(workspace_name: str, resource_type: str): - deployment_name = get_name_for_dependent_resource(workspace_name, resource_type) + deployment_name = get_name_for_dependent_resource( + workspace_name, resource_type) return variable_recorder.get_or_record(f"{resource_type}_name", deployment_name) mocker.patch( @@ -444,7 +472,8 @@ def generate_and_sanitize_job_name(*args, **kwargs): "azure.ai.ml.entities._job.to_rest_functions.generate_job_name", side_effect=generate_and_sanitize_job_name ) else: - mocker.patch("azure.ai.ml.entities._job.to_rest_functions.generate_job_name", return_value=fake_job_name) + mocker.patch("azure.ai.ml.entities._job.to_rest_functions.generate_job_name", + return_value=fake_job_name) def _load_or_create_component(client: MLClient, path: str) -> Component: @@ -496,7 +525,8 @@ def credentialless_datastore(client: MLClient, storage_account_name: str) -> Azu try: credentialless_ds = client.datastores.get(name=ds_name) except ResourceNotFoundError: - ds = AzureBlobDatastore(name=ds_name, account_name=storage_account_name, container_name=container_name) + ds = AzureBlobDatastore( + name=ds_name, account_name=storage_account_name, container_name=container_name) credentialless_ds = client.datastores.create_or_update(ds) assert isinstance(credentialless_ds.credentials, NoneCredentialConfiguration) @@ -513,24 +543,29 @@ def credentialless_datastore(client: MLClient, storage_account_name: str) -> Azu @pytest.fixture() def enable_pipeline_private_preview_features(mocker: MockFixture): - mocker.patch("azure.ai.ml.entities._job.pipeline.pipeline_job.is_private_preview_enabled", return_value=True) - mocker.patch("azure.ai.ml.dsl._pipeline_component_builder.is_private_preview_enabled", return_value=True) + mocker.patch( + "azure.ai.ml.entities._job.pipeline.pipeline_job.is_private_preview_enabled", return_value=True) + mocker.patch( + "azure.ai.ml.dsl._pipeline_component_builder.is_private_preview_enabled", return_value=True) @pytest.fixture() def enable_environment_id_arm_expansion(mocker: MockFixture): - mocker.patch("azure.ai.ml.operations._operation_orchestrator.is_private_preview_enabled", return_value=False) + mocker.patch( + "azure.ai.ml.operations._operation_orchestrator.is_private_preview_enabled", return_value=False) @pytest.fixture(autouse=True) def remove_git_props(mocker: MockFixture): - mocker.patch("azure.ai.ml.operations._job_operations.get_git_properties", return_value={}) + mocker.patch( + "azure.ai.ml.operations._job_operations.get_git_properties", return_value={}) @pytest.fixture() def enable_internal_components(): from azure.ai.ml._utils.utils import try_enable_internal_components - from azure.ai.ml.constants._common import AZUREML_INTERNAL_COMPONENTS_ENV_VAR + from azure.ai.ml.constants._common import \ + AZUREML_INTERNAL_COMPONENTS_ENV_VAR from azure.ai.ml.dsl._utils import environment_variable_overwrite with environment_variable_overwrite(AZUREML_INTERNAL_COMPONENTS_ENV_VAR, "True"): diff --git a/sdk/ml/azure-ai-ml/tests/recordings/registry/e2etests/test_registry.pyTestRegistrytest_registry_list_and_get.json b/sdk/ml/azure-ai-ml/tests/recordings/registry/e2etests/test_registry.pyTestRegistrytest_registry_list_and_get.json new file mode 100644 index 000000000000..18af1a3bf373 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/recordings/registry/e2etests/test_registry.pyTestRegistrytest_registry_list_and_get.json @@ -0,0 +1,591 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/registries/e2etesttest_705707027391?api-version=2022-10-01-preview", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "Content-Length": "357", + "Content-Type": "application/json", + "User-Agent": "azure-ai-ml/0.1.0 azsdk-python-mgmt-machinelearningservices/0.1.0 Python/3.9.12 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": { + "tags": {}, + "location": "WestCentralUS", + "identity": { + "type": "SystemAssigned" + }, + "properties": { + "regionDetails": [ + { + "acrDetails": [ + { + "systemCreatedAcrAccount": { + "acrAccountSku": "Premium" + } + } + ], + "location": "WestCentralUS", + "storageAccountDetails": [ + { + "systemCreatedStorageAccount": { + "storageAccountHnsEnabled": false, + "storageAccountType": "standard_lrs" + } + } + ] + } + ] + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "Azure-AsyncOperation": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/f2ae5f98-042b-4984-b6a8-b24c9f63ab1b?api-version=2022-10-01-preview\u0026type=async", + "Cache-Control": "no-cache", + "Content-Length": "0", + "Date": "Thu, 29 Sep 2022 17:07:45 GMT", + "Expires": "-1", + "Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/f2ae5f98-042b-4984-b6a8-b24c9f63ab1b?api-version=2022-10-01-preview\u0026type=location", + "Pragma": "no-cache", + "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "x-aml-cluster": "vienna-westcentralus-02", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "92421a22-7799-4030-b6df-2bb54aafbe12", + "x-ms-ratelimit-remaining-subscription-writes": "1198", + "x-ms-response-type": "standard", + "x-ms-routing-request-id": "CANADAEAST:20220929T170745Z:92421a22-7799-4030-b6df-2bb54aafbe12", + "x-request-time": "0.186" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/f2ae5f98-042b-4984-b6a8-b24c9f63ab1b?api-version=2022-10-01-preview\u0026type=async", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azure-ai-ml/0.1.0 azsdk-python-mgmt-machinelearningservices/0.1.0 Python/3.9.12 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Encoding": "gzip", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 29 Sep 2022 17:07:50 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "Vary": "Accept-Encoding", + "x-aml-cluster": "vienna-westcentralus-02", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "cd2526b9-03e6-464f-8183-40eec478c24c", + "x-ms-ratelimit-remaining-subscription-reads": "11999", + "x-ms-response-type": "standard", + "x-ms-routing-request-id": "CANADAEAST:20220929T170750Z:cd2526b9-03e6-464f-8183-40eec478c24c", + "x-request-time": "0.301" + }, + "ResponseBody": { + "status": "InProgress" + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/f2ae5f98-042b-4984-b6a8-b24c9f63ab1b?api-version=2022-10-01-preview\u0026type=async", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azure-ai-ml/0.1.0 azsdk-python-mgmt-machinelearningservices/0.1.0 Python/3.9.12 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Encoding": "gzip", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 29 Sep 2022 17:07:55 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "Vary": "Accept-Encoding", + "x-aml-cluster": "vienna-westcentralus-02", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "5ec37a53-0306-476e-ba2d-9998d49961b2", + "x-ms-ratelimit-remaining-subscription-reads": "11998", + "x-ms-response-type": "standard", + "x-ms-routing-request-id": "CANADAEAST:20220929T170756Z:5ec37a53-0306-476e-ba2d-9998d49961b2", + "x-request-time": "0.175" + }, + "ResponseBody": { + "status": "InProgress" + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/f2ae5f98-042b-4984-b6a8-b24c9f63ab1b?api-version=2022-10-01-preview\u0026type=async", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azure-ai-ml/0.1.0 azsdk-python-mgmt-machinelearningservices/0.1.0 Python/3.9.12 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Encoding": "gzip", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 29 Sep 2022 17:08:00 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "Vary": "Accept-Encoding", + "x-aml-cluster": "vienna-westcentralus-02", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "4551986a-4486-4131-bad8-975d90144725", + "x-ms-ratelimit-remaining-subscription-reads": "11997", + "x-ms-response-type": "standard", + "x-ms-routing-request-id": "CANADAEAST:20220929T170801Z:4551986a-4486-4131-bad8-975d90144725", + "x-request-time": "0.046" + }, + "ResponseBody": { + "status": "InProgress" + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/f2ae5f98-042b-4984-b6a8-b24c9f63ab1b?api-version=2022-10-01-preview\u0026type=async", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azure-ai-ml/0.1.0 azsdk-python-mgmt-machinelearningservices/0.1.0 Python/3.9.12 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Encoding": "gzip", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 29 Sep 2022 17:08:06 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "Vary": "Accept-Encoding", + "x-aml-cluster": "vienna-westcentralus-02", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "3b5678d7-3d4f-4342-8386-2d9824395992", + "x-ms-ratelimit-remaining-subscription-reads": "11996", + "x-ms-response-type": "standard", + "x-ms-routing-request-id": "CANADAEAST:20220929T170806Z:3b5678d7-3d4f-4342-8386-2d9824395992", + "x-request-time": "0.043" + }, + "ResponseBody": { + "status": "InProgress" + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/f2ae5f98-042b-4984-b6a8-b24c9f63ab1b?api-version=2022-10-01-preview\u0026type=async", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azure-ai-ml/0.1.0 azsdk-python-mgmt-machinelearningservices/0.1.0 Python/3.9.12 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Encoding": "gzip", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 29 Sep 2022 17:08:11 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "Vary": "Accept-Encoding", + "x-aml-cluster": "vienna-westcentralus-02", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "9ebe5c4b-99e0-47dd-a741-4416a81d6e31", + "x-ms-ratelimit-remaining-subscription-reads": "11995", + "x-ms-response-type": "standard", + "x-ms-routing-request-id": "CANADAEAST:20220929T170812Z:9ebe5c4b-99e0-47dd-a741-4416a81d6e31", + "x-request-time": "0.041" + }, + "ResponseBody": { + "status": "InProgress" + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/f2ae5f98-042b-4984-b6a8-b24c9f63ab1b?api-version=2022-10-01-preview\u0026type=async", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azure-ai-ml/0.1.0 azsdk-python-mgmt-machinelearningservices/0.1.0 Python/3.9.12 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Encoding": "gzip", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 29 Sep 2022 17:08:16 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "Vary": "Accept-Encoding", + "x-aml-cluster": "vienna-westcentralus-02", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "c23c85e4-510d-4524-855c-e03921979d97", + "x-ms-ratelimit-remaining-subscription-reads": "11994", + "x-ms-response-type": "standard", + "x-ms-routing-request-id": "CANADAEAST:20220929T170817Z:c23c85e4-510d-4524-855c-e03921979d97", + "x-request-time": "0.042" + }, + "ResponseBody": { + "status": "InProgress" + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/f2ae5f98-042b-4984-b6a8-b24c9f63ab1b?api-version=2022-10-01-preview\u0026type=async", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azure-ai-ml/0.1.0 azsdk-python-mgmt-machinelearningservices/0.1.0 Python/3.9.12 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Encoding": "gzip", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 29 Sep 2022 17:08:22 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "Vary": "Accept-Encoding", + "x-aml-cluster": "vienna-westcentralus-02", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "26c6c9e4-0234-44f3-b86f-ab4a74065696", + "x-ms-ratelimit-remaining-subscription-reads": "11993", + "x-ms-response-type": "standard", + "x-ms-routing-request-id": "CANADAEAST:20220929T170822Z:26c6c9e4-0234-44f3-b86f-ab4a74065696", + "x-request-time": "0.042" + }, + "ResponseBody": { + "status": "InProgress" + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/f2ae5f98-042b-4984-b6a8-b24c9f63ab1b?api-version=2022-10-01-preview\u0026type=async", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azure-ai-ml/0.1.0 azsdk-python-mgmt-machinelearningservices/0.1.0 Python/3.9.12 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Encoding": "gzip", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 29 Sep 2022 17:08:27 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "Vary": "Accept-Encoding", + "x-aml-cluster": "vienna-westcentralus-02", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "9a6abfd0-696c-4ff8-84a3-c7b61aedb0f4", + "x-ms-ratelimit-remaining-subscription-reads": "11992", + "x-ms-response-type": "standard", + "x-ms-routing-request-id": "CANADAEAST:20220929T170827Z:9a6abfd0-696c-4ff8-84a3-c7b61aedb0f4", + "x-request-time": "0.042" + }, + "ResponseBody": { + "status": "InProgress" + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/f2ae5f98-042b-4984-b6a8-b24c9f63ab1b?api-version=2022-10-01-preview\u0026type=async", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azure-ai-ml/0.1.0 azsdk-python-mgmt-machinelearningservices/0.1.0 Python/3.9.12 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Encoding": "gzip", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 29 Sep 2022 17:08:32 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "Vary": "Accept-Encoding", + "x-aml-cluster": "vienna-westcentralus-02", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "c3779063-cd37-4679-9b56-2909dc42a64e", + "x-ms-ratelimit-remaining-subscription-reads": "11991", + "x-ms-response-type": "standard", + "x-ms-routing-request-id": "CANADAEAST:20220929T170832Z:c3779063-cd37-4679-9b56-2909dc42a64e", + "x-request-time": "0.044" + }, + "ResponseBody": { + "status": "InProgress" + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/providers/Microsoft.MachineLearningServices/locations/WestCentralUS/registryOperationsStatus/f2ae5f98-042b-4984-b6a8-b24c9f63ab1b?api-version=2022-10-01-preview\u0026type=async", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azure-ai-ml/0.1.0 azsdk-python-mgmt-machinelearningservices/0.1.0 Python/3.9.12 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Encoding": "gzip", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 29 Sep 2022 17:08:37 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "Vary": "Accept-Encoding", + "x-aml-cluster": "vienna-westcentralus-02", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "6b82c72f-f58f-43eb-9983-426500640705", + "x-ms-ratelimit-remaining-subscription-reads": "11990", + "x-ms-response-type": "standard", + "x-ms-routing-request-id": "CANADAEAST:20220929T170838Z:6b82c72f-f58f-43eb-9983-426500640705", + "x-request-time": "0.072" + }, + "ResponseBody": { + "status": "Succeeded", + "percentComplete": 100.0 + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/registries/e2etesttest_705707027391?api-version=2022-10-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azure-ai-ml/0.1.0 azsdk-python-mgmt-machinelearningservices/0.1.0 Python/3.9.12 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Encoding": "gzip", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 29 Sep 2022 17:08:37 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "Vary": [ + "Accept-Encoding", + "Accept-Encoding" + ], + "x-aml-cluster": "vienna-westcentralus-02", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "cc29bd4f-cf27-4e60-acaa-f8f044b075d8", + "x-ms-ratelimit-remaining-subscription-reads": "11989", + "x-ms-response-type": "standard", + "x-ms-routing-request-id": "CANADAEAST:20220929T170838Z:cc29bd4f-cf27-4e60-acaa-f8f044b075d8", + "x-request-time": "0.028" + }, + "ResponseBody": { + "tags": {}, + "location": "westcentralus", + "identity": { + "type": "SystemAssigned", + "principalId": "4145ae13-afeb-4b54-9dda-af6da70763d7", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47" + }, + "id": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/registries/e2etesttest_705707027391", + "name": "e2etesttest_705707027391", + "type": "Microsoft.MachineLearningServices/registries", + "properties": { + "regionDetails": [ + { + "location": "westcentralus", + "storageAccountDetails": [ + { + "existingStorageAccount": null, + "newStorageAccount": null, + "userCreatedStorageAccount": null, + "systemCreatedStorageAccount": { + "storageAccountName": "e2etefc43d7f562374b77910", + "storageAccountType": "standard_lrs", + "storageAccountHnsEnabled": false, + "armResourceId": { + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/azureml-rg-e2etesttest_705707027391_33d29349-537c-4556-99e8-452e1fdfa09b/providers/Microsoft.Storage/storageAccounts/e2etefc43d7f562374b77910" + } + } + } + ], + "acrDetails": [ + { + "existingAcrAccount": null, + "newAcrAccount": null, + "userCreatedAcrAccount": null, + "systemCreatedAcrAccount": { + "acrAccountName": "e2eted3d61676157e4a35b88", + "acrAccountSku": "Premium", + "armResourceId": { + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/azureml-rg-e2etesttest_705707027391_33d29349-537c-4556-99e8-452e1fdfa09b/providers/Microsoft.ContainerRegistry/registries/e2eted3d61676157e4a35b88" + } + } + } + ] + } + ], + "intellectualPropertyPublisher": null, + "publicNetworkAccess": "Enabled", + "discoveryUrl": "https://westcentralus.api.azureml.ms/registrymanagement/v1.0/registries/e2etesttest_705707027391/discovery", + "managedResourceGroup": { + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/azureml-rg-e2etesttest_705707027391_33d29349-537c-4556-99e8-452e1fdfa09b" + }, + "managedResourceGroupTags": {}, + "mlFlowRegistryUri": "azureml://westcentralus.api.azureml.ms/mlflow/v1.0/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/registries/e2etesttest_705707027391" + }, + "systemData": null + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/registries/e2etesttest_705707027391?api-version=2022-10-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azure-ai-ml/0.1.0 azsdk-python-mgmt-machinelearningservices/0.1.0 Python/3.9.12 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Encoding": "gzip", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 29 Sep 2022 17:08:38 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Request-Context": "appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "Vary": [ + "Accept-Encoding", + "Accept-Encoding" + ], + "x-aml-cluster": "vienna-westcentralus-02", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "57912334-f517-410f-ab11-e011ce27a6ae", + "x-ms-ratelimit-remaining-subscription-reads": "11988", + "x-ms-response-type": "standard", + "x-ms-routing-request-id": "CANADAEAST:20220929T170838Z:57912334-f517-410f-ab11-e011ce27a6ae", + "x-request-time": "0.021" + }, + "ResponseBody": { + "tags": {}, + "location": "westcentralus", + "identity": { + "type": "SystemAssigned", + "principalId": "4145ae13-afeb-4b54-9dda-af6da70763d7", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47" + }, + "id": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/registries/e2etesttest_705707027391", + "name": "e2etesttest_705707027391", + "type": "Microsoft.MachineLearningServices/registries", + "properties": { + "regionDetails": [ + { + "location": "westcentralus", + "storageAccountDetails": [ + { + "existingStorageAccount": null, + "newStorageAccount": null, + "userCreatedStorageAccount": null, + "systemCreatedStorageAccount": { + "storageAccountName": "e2etefc43d7f562374b77910", + "storageAccountType": "standard_lrs", + "storageAccountHnsEnabled": false, + "armResourceId": { + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/azureml-rg-e2etesttest_705707027391_33d29349-537c-4556-99e8-452e1fdfa09b/providers/Microsoft.Storage/storageAccounts/e2etefc43d7f562374b77910" + } + } + } + ], + "acrDetails": [ + { + "existingAcrAccount": null, + "newAcrAccount": null, + "userCreatedAcrAccount": null, + "systemCreatedAcrAccount": { + "acrAccountName": "e2eted3d61676157e4a35b88", + "acrAccountSku": "Premium", + "armResourceId": { + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/azureml-rg-e2etesttest_705707027391_33d29349-537c-4556-99e8-452e1fdfa09b/providers/Microsoft.ContainerRegistry/registries/e2eted3d61676157e4a35b88" + } + } + } + ] + } + ], + "intellectualPropertyPublisher": null, + "publicNetworkAccess": "Enabled", + "discoveryUrl": "https://westcentralus.api.azureml.ms/registrymanagement/v1.0/registries/e2etesttest_705707027391/discovery", + "managedResourceGroup": { + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/azureml-rg-e2etesttest_705707027391_33d29349-537c-4556-99e8-452e1fdfa09b" + }, + "managedResourceGroupTags": {}, + "mlFlowRegistryUri": "azureml://westcentralus.api.azureml.ms/mlflow/v1.0/subscriptions/00000000-0000-0000-0000-000000000/resourceGroups/00000/providers/Microsoft.MachineLearningServices/registries/e2etesttest_705707027391" + }, + "systemData": null + } + } + ], + "Variables": { + "reg_name": "test_705707027391" + } +} diff --git a/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationstest_create.json b/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationstest_create.json new file mode 100644 index 000000000000..cd55b4ada4ca --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationstest_create.json @@ -0,0 +1,6 @@ +{ + "Entries": [], + "Variables": { + "reg_name": "test_581157562016" + } +} diff --git a/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationstest_create_on_existing.json b/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationstest_create_on_existing.json new file mode 100644 index 000000000000..9f39439495eb --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationstest_create_on_existing.json @@ -0,0 +1,6 @@ +{ + "Entries": [], + "Variables": { + "reg_name": "test_193498710107" + } +} diff --git a/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationstest_get.json b/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationstest_get.json new file mode 100644 index 000000000000..b0773d1648b6 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationstest_get.json @@ -0,0 +1,6 @@ +{ + "Entries": [], + "Variables": { + "reg_name": "test_786088764204" + } +} diff --git a/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_create.json b/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_create.json new file mode 100644 index 000000000000..0584d2453661 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_create.json @@ -0,0 +1,6 @@ +{ + "Entries": [], + "Variables": { + "reg_name": "test_43941251721" + } +} diff --git a/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_create_on_existing.json b/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_create_on_existing.json new file mode 100644 index 000000000000..c840730a855b --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_create_on_existing.json @@ -0,0 +1,6 @@ +{ + "Entries": [], + "Variables": { + "reg_name": "test_9409789972" + } +} diff --git a/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_get.json b/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_get.json new file mode 100644 index 000000000000..9077e05b4edd --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/recordings/registry/unittests/test_registry_operations.pyTestRegistryOperationtest_get.json @@ -0,0 +1,6 @@ +{ + "Entries": [], + "Variables": { + "reg_name": "test_993554130716" + } +} diff --git a/sdk/ml/azure-ai-ml/tests/registry/e2etests/WIP_test_registry.py b/sdk/ml/azure-ai-ml/tests/registry/e2etests/WIP_test_registry.py deleted file mode 100644 index 49a062168d31..000000000000 --- a/sdk/ml/azure-ai-ml/tests/registry/e2etests/WIP_test_registry.py +++ /dev/null @@ -1,27 +0,0 @@ -# # --------------------------------------------------------- -# # Copyright (c) Microsoft Corporation. All rights reserved. -# # --------------------------------------------------------- - -# import pytest -# from tests.conftest import crud_registry_client - -# from azure.ai.ml import MLClient -# from azure.ai.ml.entities._registry.registry import Registry -# from azure.core.paging import ItemPaged - - -# @pytest.mark.e2etest -# @pytest.mark.mlc -# class TestRegistry: -# # Need to implement more verbs for this to be functional - testing on hardcoded registry within pipeline causes authorization errors -# # However this test passed locally -# def WIP_test_registry_list_and_get( -# self, crud_registry_client: MLClient, randstr: Callable[[], str], location: str -# ) -> None: -# reg_name = "TestRegistryOperations" - -# registry = crud_registry_client.registries.get(reg_name) -# assert registry.name == reg_name - -# registry_list = crud_registry_client.registries.list() -# assert isinstance(registry_list, ItemPaged) diff --git a/sdk/ml/azure-ai-ml/tests/registry/e2etests/test_registry.py b/sdk/ml/azure-ai-ml/tests/registry/e2etests/test_registry.py new file mode 100644 index 000000000000..4b8a7e33f3a2 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/registry/e2etests/test_registry.py @@ -0,0 +1,41 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- +from typing import Callable + +import pytest +from azure.ai.ml import MLClient, load_registry +from azure.ai.ml.constants._common import LROConfigurations +from azure.core.paging import ItemPaged +from devtools_testutils import AzureRecordedTestCase, recorded_by_proxy + + +@pytest.mark.e2etest +@pytest.mark.usefixtures("recorded_test") +class TestRegistry(AzureRecordedTestCase): + @pytest.mark.e2etest + def test_registry_list_and_get( + self, + crud_registry_client: MLClient, + randstr: Callable[[], str], + ) -> None: + reg_name = f"e2etest{randstr('reg_name')}" + params_override = [ + { + "name": reg_name, + } + ] + reg = load_registry( + source="./tests/test_configs/registry/registry_valid_min.yaml", params_override=params_override + ) + registry = crud_registry_client.registries.begin_create(registry=reg).result( + timeout=LROConfigurations.POLLING_TIMEOUT + ) + assert registry.name == reg_name + assert registry.identity.type == "SystemAssigned" + + registry_list = crud_registry_client.registries.list() + assert isinstance(registry_list, ItemPaged) + + registry = crud_registry_client.registries.get(name=reg_name) + assert registry.name == reg_name diff --git a/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_autorest.py b/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_autorest.py deleted file mode 100644 index fd97afba91ca..000000000000 --- a/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_autorest.py +++ /dev/null @@ -1,123 +0,0 @@ -import pytest - -from azure.ai.ml._restclient.v2022_10_01_preview.models import AcrDetails -from azure.ai.ml._restclient.v2022_10_01_preview.models import Registry as RestRegistry -from azure.ai.ml._restclient.v2022_10_01_preview.models import ( - RegistryProperties, - RegistryRegionArmDetails, - StorageAccountDetails, -) -from azure.ai.ml._restclient.v2022_10_01_preview.models import StorageAccountType as RestStorageAccountType -from azure.ai.ml._restclient.v2022_10_01_preview.models import SystemCreatedAcrAccount, SystemCreatedStorageAccount -from azure.ai.ml.constants._registry import StorageAccountType - -# from azure.ai.ml.entities._util import load_from_dict -from azure.ai.ml.entities import Registry - - -@pytest.mark.unittest -class TestRegistrySchema: - """Hi is this test randomly failing for you, due to the following error? - - > super(Registry, self).__init__(tags=tags, **kwargs) - E TypeError: __init__() missing 1 required keyword-only argument: 'location - - That probably means that you downloaded a new version of the 10-01-preview regions.json - file located in the autorest directory. Don't do that, the original doesn't work for local testing. - If you must anyway, remove 'location' value from the properties list of the 'RegistryTrackedResource' - definition, and regenerate you autorest files.""" - - def test_deserialize_from_autorest_object(self) -> None: - # TODO Implement this once Regisy._from_rest_object is implemented - - loc_1 = "USEast" - tags = {"test": "registry"} - name = "registry name" - # id = "registry id" - description = "registry description" - # There are two places in a registry where tags can live. Which do we care about? - interior_tags = {"properties": "have tags"} - pna = "Enabled" - discovery_url = "www.here-be-registries.com" - ipp = "a publisher name" - mrg = "MRG ID" - registry_uri = "example mlflow uri" - loc_2 = "The Moon" - acr_id_1 = "acr id 1" - sku = "a sku value" - acr_id_2 = "acr id 2" - storage_id_1 = "storage id 1" - storage_id_2 = "storage id 2" - hns = False - - rest_registry = RestRegistry( - location=loc_1, - tags=tags, - name=name, - id="registry id", - properties=RegistryProperties( - description=description, - tags=interior_tags, - public_network_access=pna, - discovery_url=discovery_url, - intellectual_property_publisher=ipp, - managed_resource_group=mrg, - ml_flow_registry_uri=registry_uri, - region_details=[ - RegistryRegionArmDetails( - location=loc_2, - acr_details=[ - AcrDetails(user_created_acr_account=acr_id_1), - AcrDetails( - system_created_acr_account=SystemCreatedAcrAccount( - acr_account_sku=sku, arm_resource_id=acr_id_2 - ) - ), - ], - storage_account_details=[ - StorageAccountDetails(user_created_storage_account=storage_id_1), - StorageAccountDetails( - system_created_storage_account=SystemCreatedStorageAccount( - arm_resource_id=storage_id_2, - storage_account_hns_enabled=hns, - storage_account_type=RestStorageAccountType.PREMIUM_LRS, - ) - ), - ], - ) - ], - ), - ) - registry_entity = Registry._from_rest_object(rest_registry) - - assert registry_entity - assert registry_entity.description == description - assert registry_entity.location == loc_1 - assert registry_entity.tags == interior_tags - # assert registry_entity.name == name # TODO Local workspace obj doesn't record name besides pushing up to super class. Should we? - # assert registry_entity.id == id # TODO Local workspace obj doesn't record id. Should we? - assert registry_entity.public_network_access == pna - assert registry_entity.discovery_url == discovery_url - assert registry_entity.intellectual_property_publisher == ipp - assert registry_entity.managed_resource_group == mrg - assert registry_entity.mlflow_registry_uri == registry_uri - - assert registry_entity.region_details - details = registry_entity.region_details - assert len(details) == 1 - assert details[0].location == loc_2 - assert details[0].acr_config - assert details[0].storage_config - - acrs = details[0].acr_config - assert len(acrs) == 2 - assert acrs[0] == acr_id_1 - assert acrs[1].arm_resource_id == acr_id_2 - assert acrs[1].acr_account_sku == sku - - storages = details[0].storage_config - assert len(storages) == 2 - assert storages[0] == storage_id_1 - assert storages[1].arm_resource_id == storage_id_2 - assert storages[1].storage_account_hns == hns - assert storages[1].storage_account_type == StorageAccountType.PREMIUM_LRS diff --git a/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_entity.py b/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_entity.py index b0e459417c7a..1827017a6e41 100644 --- a/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_entity.py +++ b/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_entity.py @@ -1,23 +1,27 @@ import pytest -from azure.ai.ml._restclient.v2022_10_01_preview.models import AcrDetails +from azure.ai.ml._restclient.v2022_10_01_preview.models import AcrDetails, RegistryProperties, StorageAccountDetails, UserCreatedAcrAccount, UserCreatedStorageAccount from azure.ai.ml._restclient.v2022_10_01_preview.models import Registry as RestRegistry -from azure.ai.ml._restclient.v2022_10_01_preview.models import RegistryProperties from azure.ai.ml._restclient.v2022_10_01_preview.models import RegistryRegionArmDetails as RestRegistryRegionArmDetails -from azure.ai.ml._restclient.v2022_10_01_preview.models import StorageAccountDetails from azure.ai.ml._restclient.v2022_10_01_preview.models import StorageAccountType as RestStorageAccountType -from azure.ai.ml._restclient.v2022_10_01_preview.models import SystemCreatedAcrAccount, SystemCreatedStorageAccount +from azure.ai.ml._restclient.v2022_10_01_preview.models import SystemCreatedAcrAccount as RestSystemCreatedAcrAccount +from azure.ai.ml._restclient.v2022_10_01_preview.models import SystemCreatedStorageAccount as RestSystemCreatedStorageAccount +from azure.ai.ml._restclient.v2022_10_01_preview.models import ArmResourceId as RestArmResourceId from azure.ai.ml.constants._registry import StorageAccountType # from azure.ai.ml.entities._util import load_from_dict -from azure.ai.ml.entities import Registry, RegistryRegionArmDetails +from azure.ai.ml.entities import Registry, RegistryRegionDetails, SystemCreatedAcrAccount, SystemCreatedStorageAccount +# Define a bunch of constants to use in crafting test values. loc_1 = "USEast" -tags = {"test": "registry"} +exterior_tags = {"test": "registry"} name = "registry name" # id = "registry id" description = "registry description" -# There are two places in a registry where tags can live. Which do we care about? +# There are two places in a registry where tags can live. We only care about +# tags set at the top level, AKA the 'exterior_tags' defined above/ +# These interior tags only exists to show that the value technically +# exists due to swagger-side inheritance in the autotest. interior_tags = {"properties": "have tags"} pna = "Enabled" discovery_url = "www.here-be-registries.com" @@ -38,7 +42,7 @@ @pytest.mark.unittest -class TestRegistrySchema: +class TestRegistryEntity: """Hi. Is this test unexpectedly failing for you due to the following error? > super(Registry, self).__init__(tags=tags, **kwargs) @@ -52,7 +56,7 @@ class TestRegistrySchema: def test_deserialize_from_autorest_object(self) -> None: rest_registry = RestRegistry( location=loc_1, - tags=tags, + tags=exterior_tags, name=name, id="registry id", properties=RegistryProperties( @@ -67,18 +71,18 @@ def test_deserialize_from_autorest_object(self) -> None: RestRegistryRegionArmDetails( location=loc_2, acr_details=[ - AcrDetails(user_created_acr_account=acr_id_1), + AcrDetails(user_created_acr_account=UserCreatedAcrAccount(arm_resource_id=RestArmResourceId(resource_id=acr_id_1))), AcrDetails( - system_created_acr_account=SystemCreatedAcrAccount( - acr_account_sku=sku, arm_resource_id=acr_id_2 + system_created_acr_account=RestSystemCreatedAcrAccount( + acr_account_sku=sku, arm_resource_id=RestArmResourceId(resource_id=acr_id_2) ) ), ], storage_account_details=[ - StorageAccountDetails(user_created_storage_account=storage_id_1), + StorageAccountDetails(user_created_storage_account=UserCreatedStorageAccount(arm_resource_id=RestArmResourceId(resource_id=storage_id_1))), StorageAccountDetails( - system_created_storage_account=SystemCreatedStorageAccount( - arm_resource_id=storage_id_2, + system_created_storage_account=RestSystemCreatedStorageAccount( + arm_resource_id=RestArmResourceId(resource_id=storage_id_2), storage_account_hns_enabled=hns, storage_account_type=RestStorageAccountType.PREMIUM_LRS, ) @@ -93,7 +97,7 @@ def test_deserialize_from_autorest_object(self) -> None: assert registry_entity assert registry_entity.description == description assert registry_entity.location == loc_1 - assert registry_entity.tags == interior_tags + assert registry_entity.tags == exterior_tags # TODO https://dev.azure.com/msdata/Vienna/_workitems/edit/1971490/ # assert registry_entity.name == name # TODO Local workspace obj doesn't record name besides pushing up to super class. Should we? # assert registry_entity.id == id # TODO Local workspace obj doesn't record id. Should we? @@ -103,8 +107,8 @@ def test_deserialize_from_autorest_object(self) -> None: assert registry_entity.managed_resource_group == mrg assert registry_entity.mlflow_registry_uri == registry_uri - assert registry_entity.region_details - details = registry_entity.region_details + assert registry_entity.replication_locations + details = registry_entity.replication_locations assert len(details) == 1 assert details[0].location == loc_2 assert details[0].acr_config @@ -128,7 +132,7 @@ def test_registry_load_from_dict(self): "name": name, "location": loc_1, "description": description, - "tags": tags, + "tags": exterior_tags, "public_network_access": pna, "replication_locations": [{"location": loc_1, "storage_config": [storage_id_1]}], "container_registry": acr_id_1, @@ -138,23 +142,76 @@ def test_registry_load_from_dict(self): assert registry assert registry.location == loc_1 assert registry.description == description - assert registry.tags == tags + assert registry.tags == exterior_tags assert registry.public_network_access == pna - assert registry.region_details[0].acr_config[0] == acr_id_1 - assert registry.region_details[0].location == loc_1 - assert registry.region_details[0].storage_config[0] == storage_id_1 - - def test_registry_load_from_dict_failure_cases(self): - # TODO https://dev.azure.com/msdata/Vienna/_workitems/edit/1971490/ - pass + assert registry.replication_locations[0].acr_config[0] == acr_id_1 + assert registry.replication_locations[0].location == loc_1 + assert registry.replication_locations[0].storage_config[0] == storage_id_1 def test_registry_dictonary_modifier(self): - details = [1, 2, 3] - input1 = {"replication_locations": details} - Registry._convert_yaml_dict_to_entity_input(input1) - assert input1["region_details"] == details - details = [type("", (), {})()] # empty object for attribute addition testing input2 = {"replication_locations": details, "container_registry": "123"} Registry._convert_yaml_dict_to_entity_input(input2) - assert input2["region_details"][0].acr_config == ["123"] + assert input2["replication_locations"][0].acr_config == ["123"] + + def test_system_acr_serialization(self): + user_acr = "some user id" + system_acr = SystemCreatedAcrAccount(acr_account_sku="prEmiUm", arm_resource_id="some system id") + rest_user_acr = SystemCreatedAcrAccount._to_rest_object(user_acr) + rest_system_acr = SystemCreatedAcrAccount._to_rest_object(system_acr) + + assert isinstance(rest_user_acr, AcrDetails) + assert isinstance(rest_system_acr, AcrDetails) + + assert rest_user_acr.user_created_acr_account.arm_resource_id.resource_id == "some user id" + # Ensure that arm_resource_id is never set by entity->rest converter. + assert rest_system_acr.system_created_acr_account.arm_resource_id == None + assert rest_system_acr.system_created_acr_account.acr_account_sku == "Premium" + + new_user_acr = SystemCreatedAcrAccount._from_rest_object(rest_user_acr) + new_system_acr = SystemCreatedAcrAccount._from_rest_object(rest_system_acr) + # ... but still test that ID is set in the other direction + rest_system_acr.system_created_acr_account.arm_resource_id = RestArmResourceId(resource_id="another id") + new_system_acr_2 = SystemCreatedAcrAccount._from_rest_object(rest_system_acr) + assert new_user_acr == "some user id" + assert new_system_acr.acr_account_sku == "Premium" + assert new_system_acr.arm_resource_id == None + assert new_system_acr_2.arm_resource_id == "another id" + + def test_system_storage_serialization(self): + user_storage = "some user storage id" + system_storage = SystemCreatedStorageAccount(storage_account_hns=True, storage_account_type=StorageAccountType.PREMIUM_LRS, arm_resource_id="some managed storage id") + + rest_user_storage = SystemCreatedStorageAccount._to_rest_object(user_storage) + rest_system_storage = SystemCreatedStorageAccount._to_rest_object(system_storage) + assert rest_user_storage.user_created_storage_account.arm_resource_id.resource_id == "some user storage id" + assert rest_system_storage.system_created_storage_account.storage_account_hns_enabled == True + assert rest_system_storage.system_created_storage_account.storage_account_type == StorageAccountType.PREMIUM_LRS + # Ensure that arm_resource_id is never set by entity->rest converter. + assert rest_system_storage.system_created_storage_account.arm_resource_id == None + + # ... but still test that ID is set in the other direction + rest_system_storage.system_created_storage_account.arm_resource_id = RestArmResourceId(resource_id="another storage id") + new_user_storage = SystemCreatedStorageAccount._from_rest_object(rest_user_storage) + new_system_storage = SystemCreatedStorageAccount._from_rest_object(rest_system_storage) + + assert new_user_storage == "some user storage id" + assert new_system_storage.arm_resource_id == "another storage id" + assert new_system_storage.storage_account_hns == True + assert new_system_storage.storage_account_type == StorageAccountType.PREMIUM_LRS + + def test_system_region_details_serialization(self): + region_detail = RegistryRegionDetails(acr_config=[SystemCreatedAcrAccount(acr_account_sku="Premium")], + location="USEast2", + storage_config=[SystemCreatedStorageAccount(storage_account_hns=False, storage_account_type=StorageAccountType.PREMIUM_LRS)]) + rest_region_detail = region_detail._to_rest_object() + + assert rest_region_detail.acr_details[0].system_created_acr_account.acr_account_sku == "Premium" + assert rest_region_detail.location == "USEast2" + assert rest_region_detail.storage_account_details[0].system_created_storage_account.storage_account_hns_enabled == False + + new_region_detail = RegistryRegionDetails._from_rest_object(rest_region_detail) + + assert new_region_detail.acr_config[0].acr_account_sku == "Premium" + assert new_region_detail.location == "USEast2" + assert new_region_detail.storage_config[0].storage_account_type == StorageAccountType.PREMIUM_LRS diff --git a/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_operations.py b/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_operations.py index 4687f66a2743..acb5d372d5b3 100644 --- a/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_operations.py +++ b/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_operations.py @@ -2,13 +2,13 @@ from unittest.mock import DEFAULT, Mock, call, patch import pytest -from pytest_mock import MockFixture - +from azure.ai.ml import load_registry from azure.ai.ml._scope_dependent_operations import OperationScope from azure.ai.ml.entities._registry.registry import Registry from azure.ai.ml.operations import RegistryOperations from azure.core.exceptions import ResourceExistsError from azure.core.polling import LROPoller +from pytest_mock import MockFixture @pytest.fixture @@ -27,16 +27,30 @@ def mock_registry_operation( @pytest.mark.unittest -class TestRegistryOperation: +class TestRegistryOperations: def test_list(self, mock_registry_operation: RegistryOperations) -> None: mock_registry_operation.list() - mock_registry_operation._operation.list_by_subscription.assert_called_once() + mock_registry_operation._operation.list.assert_called_once() - def test_get(self, mock_registry_operation: RegistryOperations) -> None: - mock_registry_operation.get("random_name") + def test_get(self, mock_registry_operation: RegistryOperations, randstr: Callable[[], str]) -> None: + mock_registry_operation.get(f"unittest_{randstr('reg_name')}") mock_registry_operation._operation.get.assert_called_once() def test_check_registry_name(self, mock_registry_operation: RegistryOperations): mock_registry_operation._default_registry_name = None with pytest.raises(Exception): mock_registry_operation._check_registry_name(None) + + def test_create(self, mock_registry_operation: RegistryOperations, randstr: Callable[[], str]) -> None: + reg_name = f"unittest{randstr('reg_name')}" + params_override = [ + { + "name": reg_name + } + ] + reg = load_registry( + source="./tests/test_configs/registry/registry_valid_min.yaml", params_override=params_override + ) + # valid creation of new registry + mock_registry_operation.begin_create(registry=reg) + mock_registry_operation._operation.begin_create_or_update.assert_called_once() \ No newline at end of file diff --git a/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_schema.py b/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_schema.py index e0a648732810..bf0ba8c452c7 100644 --- a/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_schema.py +++ b/sdk/ml/azure-ai-ml/tests/registry/unittests/test_registry_schema.py @@ -7,7 +7,7 @@ from azure.ai.ml._schema.registry import RegistrySchema from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY, PublicNetworkAccess from azure.ai.ml.constants._registry import AcrAccountSku, StorageAccountType -from azure.ai.ml.entities import RegistryRegionArmDetails, SystemCreatedAcrAccount, SystemCreatedStorageAccount +from azure.ai.ml.entities import RegistryRegionDetails, SystemCreatedAcrAccount, SystemCreatedStorageAccount from azure.ai.ml.entities._util import load_from_dict @@ -34,18 +34,13 @@ def test_deserialize_from_yaml(self) -> None: assert len(registry["replication_locations"]) == 1 detail = registry["replication_locations"][0] - assert isinstance(detail, RegistryRegionArmDetails) + assert isinstance(detail, RegistryRegionDetails) assert detail.location == "EastUS" storages = detail.storage_config - assert len(storages) == 2 - assert ( - storages[0] - == "/subscriptions/sub_id/resourceGroups/some_rg/providers/Microsoft.Storage/storageAccounts/some_storage_account" - ) - assert isinstance(storages[1], SystemCreatedStorageAccount) - assert not storages[1].storage_account_hns - assert storages[1].storage_account_type == StorageAccountType.STANDARD_RAGRS + assert isinstance(storages, SystemCreatedStorageAccount) + assert not storages.storage_account_hns + assert storages.storage_account_type == StorageAccountType.STANDARD_RAGRS def test_deserialize_from_yaml_with_system_acr(self) -> None: path = Path("./tests/test_configs/registry/registry_valid_2.yaml") @@ -76,7 +71,8 @@ def test_deserialize_bad_storage_account_type(self) -> None: load_from_dict(RegistrySchema, target, context) assert e_info assert isinstance(e_info._excinfo[1], ValidationError) - assert "Value 'NOT_A_REAL_ACCOUNT_TYPE' passed is not in set" in e_info._excinfo[1].messages[0] + assert "NOT_A_REAL_ACCOUNT_TYPE" in e_info._excinfo[1].messages[0] + assert "passed is not in set" in e_info._excinfo[1].messages[0] def test_deserialize_bad_arm_resource_id(self) -> None: path = Path("./tests/test_configs/registry/registry_bad_arm_resource_id.yaml") diff --git a/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_bad_arm_resource_id.yaml b/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_bad_arm_resource_id.yaml index d8845907450f..1d0b15118cfd 100644 --- a/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_bad_arm_resource_id.yaml +++ b/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_bad_arm_resource_id.yaml @@ -11,6 +11,4 @@ replication_locations: - location: EastUS storage_config: - /subscriptions/sub_id/resourceGroups/some_rg/providers/Microsoft.Storage/storageAccounts/some_storage_account - - storage_account_hns: False - storage_account_type: Standard_RAGRS container_registry: not/a/real/resource/id diff --git a/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_bad_storage_account_type.yaml b/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_bad_storage_account_type.yaml index bc28dfc010f7..51addc202880 100644 --- a/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_bad_storage_account_type.yaml +++ b/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_bad_storage_account_type.yaml @@ -10,7 +10,6 @@ intellectual_property_publisher: registry_publisher replication_locations: - location: EastUS storage_config: - - /subscriptions/sub_id/resourceGroups/some_rg/providers/Microsoft.Storage/storageAccounts/some_storage_account - - storage_account_hns: False + storage_account_hns: False storage_account_type: NOT_A_REAL_ACCOUNT_TYPE container_registry: /subscriptions/sub_id/resourceGroups/some_rg/providers/Microsoft.ContainerRegistry/registries/acr_id diff --git a/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_valid.yaml b/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_valid.yaml index 70c0805cc4ff..43215451ee87 100644 --- a/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_valid.yaml +++ b/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_valid.yaml @@ -10,7 +10,6 @@ intellectual_property_publisher: registry_publisher replication_locations: - location: EastUS storage_config: - - /subscriptions/sub_id/resourceGroups/some_rg/providers/Microsoft.Storage/storageAccounts/some_storage_account - - storage_account_hns: False - storage_account_type: Standard_RAGRS + storage_account_hns: False + storage_account_type: Standard_RAGRS container_registry: /subscriptions/sub_id/resourceGroups/some_rg/providers/Microsoft.ContainerRegistry/registries/acr_id diff --git a/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_valid_2.yaml b/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_valid_2.yaml index 095b73127176..5e4b8b911c90 100644 --- a/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_valid_2.yaml +++ b/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_valid_2.yaml @@ -11,7 +11,5 @@ replication_locations: - location: EastUS storage_config: - /subscriptions/sub_id/resourceGroups/some_rg/providers/Microsoft.Storage/storageAccounts/some_storage_account - - storage_account_hns: False - storage_account_type: Standard_RAGRS container_registry: acr_account_sku: premium diff --git a/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_valid_3.yaml b/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_valid_3.yaml index b853a9d1b19e..6176eefbe123 100644 --- a/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_valid_3.yaml +++ b/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_valid_3.yaml @@ -10,6 +10,5 @@ intellectual_property_publisher: registry_publisher replication_locations: - location: EastUS storage_config: - - /subscriptions/sub_id/resourceGroups/some_rg/providers/Microsoft.Storage/storageAccounts/some_storage_account - - storage_account_hns: False + storage_account_hns: False storage_account_type: Standard_RAGRS diff --git a/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_valid_min.yaml b/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_valid_min.yaml new file mode 100644 index 000000000000..1603bd15d47b --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/test_configs/registry/registry_valid_min.yaml @@ -0,0 +1,5 @@ +description: This is a registry description +name: registry_name +location: WestCentralUS +replication_locations: + - location: WestCentralUS