11# coding=utf-8
22# --------------------------------------------------------------------------
3- # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.6.6, generator: @autorest/python@5.6.4 )
3+ # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.6.6, generator: @autorest/python@5.11.0 )
44# Changes may cause incorrect behavior and will be lost if the code is regenerated.
55# --------------------------------------------------------------------------
66
7- from typing import Any
7+ from copy import deepcopy
8+ from typing import Any , Awaitable
89
910from azure .core import AsyncPipelineClient
10- from azure .core .pipeline . transport import AsyncHttpResponse , HttpRequest
11+ from azure .core .rest import AsyncHttpResponse , HttpRequest
1112from msrest import Deserializer , Serializer
1213
13- from ._configuration import ContainerRegistryConfiguration
14- from .operations import ContainerRegistryOperations
15- from .operations import ContainerRegistryBlobOperations
16- from .operations import AuthenticationOperations
1714from .. import models
15+ from ._configuration import ContainerRegistryConfiguration
16+ from .operations import AuthenticationOperations , ContainerRegistryBlobOperations , ContainerRegistryOperations
1817
19-
20- class ContainerRegistry (object ):
18+ class ContainerRegistry :
2119 """Metadata API definition for the Azure Container Registry runtime.
2220
2321 :ivar container_registry: ContainerRegistryOperations operations
2422 :vartype container_registry: container_registry.aio.operations.ContainerRegistryOperations
2523 :ivar container_registry_blob: ContainerRegistryBlobOperations operations
26- :vartype container_registry_blob: container_registry.aio.operations.ContainerRegistryBlobOperations
24+ :vartype container_registry_blob:
25+ container_registry.aio.operations.ContainerRegistryBlobOperations
2726 :ivar authentication: AuthenticationOperations operations
2827 :vartype authentication: container_registry.aio.operations.AuthenticationOperations
2928 :param url: Registry login URL.
@@ -35,38 +34,48 @@ def __init__(
3534 url : str ,
3635 ** kwargs : Any
3736 ) -> None :
38- base_url = '{url}'
39- self ._config = ContainerRegistryConfiguration (url , ** kwargs )
40- self ._client = AsyncPipelineClient (base_url = base_url , config = self ._config , ** kwargs )
37+ _base_url = '{url}'
38+ self ._config = ContainerRegistryConfiguration (url = url , ** kwargs )
39+ self ._client = AsyncPipelineClient (base_url = _base_url , config = self ._config , ** kwargs )
4140
4241 client_models = {k : v for k , v in models .__dict__ .items () if isinstance (v , type )}
4342 self ._serialize = Serializer (client_models )
44- self ._serialize .client_side_validation = False
4543 self ._deserialize = Deserializer (client_models )
44+ self ._serialize .client_side_validation = False
45+ self .container_registry = ContainerRegistryOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
46+ self .container_registry_blob = ContainerRegistryBlobOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
47+ self .authentication = AuthenticationOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
4648
47- self .container_registry = ContainerRegistryOperations (
48- self ._client , self ._config , self ._serialize , self ._deserialize )
49- self .container_registry_blob = ContainerRegistryBlobOperations (
50- self ._client , self ._config , self ._serialize , self ._deserialize )
51- self .authentication = AuthenticationOperations (
52- self ._client , self ._config , self ._serialize , self ._deserialize )
5349
54- async def _send_request (self , http_request : HttpRequest , ** kwargs : Any ) -> AsyncHttpResponse :
50+ def _send_request (
51+ self ,
52+ request : HttpRequest ,
53+ ** kwargs : Any
54+ ) -> Awaitable [AsyncHttpResponse ]:
5555 """Runs the network request through the client's chained policies.
5656
57- :param http_request: The network request you want to make. Required.
58- :type http_request: ~azure.core.pipeline.transport.HttpRequest
59- :keyword bool stream: Whether the response payload will be streamed. Defaults to True.
57+ >>> from azure.core.rest import HttpRequest
58+ >>> request = HttpRequest("GET", "https://www.example.org/")
59+ <HttpRequest [GET], url: 'https://www.example.org/'>
60+ >>> response = await client._send_request(request)
61+ <AsyncHttpResponse: 200 OK>
62+
63+ For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
64+
65+ :param request: The network request you want to make. Required.
66+ :type request: ~azure.core.rest.HttpRequest
67+ :keyword bool stream: Whether the response payload will be streamed. Defaults to False.
6068 :return: The response of your network call. Does not do error handling on your response.
61- :rtype: ~azure.core.pipeline.transport .AsyncHttpResponse
69+ :rtype: ~azure.core.rest .AsyncHttpResponse
6270 """
71+
72+ request_copy = deepcopy (request )
6373 path_format_arguments = {
64- ' url' : self ._serialize .url ("self._config.url" , self ._config .url , 'str' , skip_quote = True ),
74+ " url" : self ._serialize .url ("self._config.url" , self ._config .url , 'str' , skip_quote = True ),
6575 }
66- http_request .url = self ._client .format_url (http_request .url , ** path_format_arguments )
67- stream = kwargs .pop ("stream" , True )
68- pipeline_response = await self ._client ._pipeline .run (http_request , stream = stream , ** kwargs )
69- return pipeline_response .http_response
76+
77+ request_copy .url = self ._client .format_url (request_copy .url , ** path_format_arguments )
78+ return self ._client .send_request (request_copy , ** kwargs )
7079
7180 async def close (self ) -> None :
7281 await self ._client .close ()
0 commit comments