Skip to content

Commit

Permalink
Update auto-gen code for 2022-10-01-preview API version (#26873)
Browse files Browse the repository at this point in the history
* Update autorest code for 2022-10-01-preview API version
  • Loading branch information
luigiw authored Oct 18, 2022
1 parent deef2db commit b200856
Show file tree
Hide file tree
Showing 23 changed files with 1,932 additions and 941 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
registry_name: str,
name: str,
code_name: str,
**kwargs: Any
) -> None:
cls = kwargs.pop('cls', None) # type: ClsType[None]
Expand All @@ -158,7 +158,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements
subscription_id=self._config.subscription_id,
resource_group_name=resource_group_name,
registry_name=registry_name,
name=name,
code_name=code_name,
api_version=api_version,
template_url=self._delete_initial.metadata['url'],
)
Expand Down Expand Up @@ -186,15 +186,15 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements
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/{codeName}"} # type: ignore


@distributed_trace_async
async def begin_delete( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
registry_name: str,
name: str,
code_name: str,
**kwargs: Any
) -> AsyncLROPoller[None]:
"""Delete container.
Expand All @@ -205,8 +205,8 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements
:type resource_group_name: str
:param registry_name: Name of Azure Machine Learning registry.
:type registry_name: str
:param name: Container name.
:type name: str
:param code_name: Container name.
:type code_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
Expand All @@ -231,7 +231,7 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements
raw_result = await self._delete_initial(
resource_group_name=resource_group_name,
registry_name=registry_name,
name=name,
code_name=code_name,
api_version=api_version,
cls=lambda x,y,z: x,
**kwargs
Expand All @@ -243,7 +243,7 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, None, {})


if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs)
if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
elif polling is False: polling_method = AsyncNoPolling()
else: polling_method = polling
if cont_token:
Expand All @@ -255,14 +255,14 @@ def get_long_running_output(pipeline_response):
)
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/{codeName}"} # type: ignore

@distributed_trace_async
async def get(
self,
resource_group_name: str,
registry_name: str,
name: str,
code_name: str,
**kwargs: Any
) -> "_models.CodeContainer":
"""Get container.
Expand All @@ -273,8 +273,8 @@ async def get(
:type resource_group_name: str
:param registry_name: Name of Azure Machine Learning registry.
:type registry_name: str
:param name: Container name.
:type name: str
:param code_name: Container name.
:type code_name: 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
Expand All @@ -293,7 +293,7 @@ async def get(
subscription_id=self._config.subscription_id,
resource_group_name=resource_group_name,
registry_name=registry_name,
name=name,
code_name=code_name,
api_version=api_version,
template_url=self.get.metadata['url'],
)
Expand All @@ -319,14 +319,14 @@ 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/{codeName}"} # type: ignore


async def _create_or_update_initial(
self,
resource_group_name: str,
registry_name: str,
name: str,
code_name: str,
body: "_models.CodeContainer",
**kwargs: Any
) -> "_models.CodeContainer":
Expand All @@ -345,7 +345,7 @@ async def _create_or_update_initial(
subscription_id=self._config.subscription_id,
resource_group_name=resource_group_name,
registry_name=registry_name,
name=name,
code_name=code_name,
api_version=api_version,
content_type=content_type,
json=_json,
Expand Down Expand Up @@ -380,15 +380,15 @@ 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/{codeName}"} # type: ignore


@distributed_trace_async
async def begin_create_or_update(
self,
resource_group_name: str,
registry_name: str,
name: str,
code_name: str,
body: "_models.CodeContainer",
**kwargs: Any
) -> AsyncLROPoller["_models.CodeContainer"]:
Expand All @@ -400,8 +400,8 @@ async def begin_create_or_update(
:type resource_group_name: str
:param registry_name: Name of Azure Machine Learning registry.
:type registry_name: str
:param name: Container name.
:type name: str
:param code_name: Container name.
:type code_name: str
:param body: Container entity to create or update.
:type body: ~azure.mgmt.machinelearningservices.models.CodeContainer
:keyword callable cls: A custom type or function that will be passed the direct response
Expand Down Expand Up @@ -431,7 +431,7 @@ async def begin_create_or_update(
raw_result = await self._create_or_update_initial(
resource_group_name=resource_group_name,
registry_name=registry_name,
name=name,
code_name=code_name,
body=body,
api_version=api_version,
content_type=content_type,
Expand All @@ -448,7 +448,7 @@ def get_long_running_output(pipeline_response):
return deserialized


if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs)
if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs)
elif polling is False: polling_method = AsyncNoPolling()
else: polling_method = polling
if cont_token:
Expand All @@ -460,4 +460,4 @@ def get_long_running_output(pipeline_response):
)
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/{codeName}"} # type: ignore
Loading

0 comments on commit b200856

Please sign in to comment.