Skip to content

Commit 9cd93fb

Browse files
authored
[acr] regen with autorest 5.11.0, bump min core dep to 1.20.0 (#21600)
1 parent 8e98c7f commit 9cd93fb

21 files changed

+3325
-1791
lines changed

sdk/containerregistry/azure-containerregistry/azure/containerregistry/_generated/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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

sdk/containerregistry/azure-containerregistry/azure/containerregistry/_generated/_configuration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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

@@ -31,9 +31,9 @@ def __init__(
3131
**kwargs # type: Any
3232
):
3333
# type: (...) -> None
34+
super(ContainerRegistryConfiguration, self).__init__(**kwargs)
3435
if url is None:
3536
raise ValueError("Parameter 'url' must not be None.")
36-
super(ContainerRegistryConfiguration, self).__init__(**kwargs)
3737

3838
self.url = url
3939
kwargs.setdefault('sdk_moniker', 'containerregistry/{}'.format(VERSION))

sdk/containerregistry/azure-containerregistry/azure/containerregistry/_generated/_container_registry.py

Lines changed: 38 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
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 copy import deepcopy
78
from typing import TYPE_CHECKING
89

910
from azure.core import PipelineClient
1011
from msrest import Deserializer, Serializer
1112

13+
from . import models
14+
from ._configuration import ContainerRegistryConfiguration
15+
from .operations import AuthenticationOperations, ContainerRegistryBlobOperations, ContainerRegistryOperations
16+
1217
if TYPE_CHECKING:
1318
# pylint: disable=unused-import,ungrouped-imports
1419
from typing import Any
1520

16-
from azure.core.pipeline.transport import HttpRequest, HttpResponse
17-
18-
from ._configuration import ContainerRegistryConfiguration
19-
from .operations import ContainerRegistryOperations
20-
from .operations import ContainerRegistryBlobOperations
21-
from .operations import AuthenticationOperations
22-
from . import models
23-
21+
from azure.core.rest import HttpRequest, HttpResponse
2422

2523
class ContainerRegistry(object):
2624
"""Metadata API definition for the Azure Container Registry runtime.
@@ -41,39 +39,49 @@ def __init__(
4139
**kwargs # type: Any
4240
):
4341
# type: (...) -> None
44-
base_url = '{url}'
45-
self._config = ContainerRegistryConfiguration(url, **kwargs)
46-
self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs)
42+
_base_url = '{url}'
43+
self._config = ContainerRegistryConfiguration(url=url, **kwargs)
44+
self._client = PipelineClient(base_url=_base_url, config=self._config, **kwargs)
4745

4846
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
4947
self._serialize = Serializer(client_models)
50-
self._serialize.client_side_validation = False
5148
self._deserialize = Deserializer(client_models)
49+
self._serialize.client_side_validation = False
50+
self.container_registry = ContainerRegistryOperations(self._client, self._config, self._serialize, self._deserialize)
51+
self.container_registry_blob = ContainerRegistryBlobOperations(self._client, self._config, self._serialize, self._deserialize)
52+
self.authentication = AuthenticationOperations(self._client, self._config, self._serialize, self._deserialize)
5253

53-
self.container_registry = ContainerRegistryOperations(
54-
self._client, self._config, self._serialize, self._deserialize)
55-
self.container_registry_blob = ContainerRegistryBlobOperations(
56-
self._client, self._config, self._serialize, self._deserialize)
57-
self.authentication = AuthenticationOperations(
58-
self._client, self._config, self._serialize, self._deserialize)
5954

60-
def _send_request(self, http_request, **kwargs):
61-
# type: (HttpRequest, Any) -> HttpResponse
55+
def _send_request(
56+
self,
57+
request, # type: HttpRequest
58+
**kwargs # type: Any
59+
):
60+
# type: (...) -> HttpResponse
6261
"""Runs the network request through the client's chained policies.
6362
64-
:param http_request: The network request you want to make. Required.
65-
:type http_request: ~azure.core.pipeline.transport.HttpRequest
66-
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
63+
>>> from azure.core.rest import HttpRequest
64+
>>> request = HttpRequest("GET", "https://www.example.org/")
65+
<HttpRequest [GET], url: 'https://www.example.org/'>
66+
>>> response = client._send_request(request)
67+
<HttpResponse: 200 OK>
68+
69+
For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
70+
71+
:param request: The network request you want to make. Required.
72+
:type request: ~azure.core.rest.HttpRequest
73+
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
6774
:return: The response of your network call. Does not do error handling on your response.
68-
:rtype: ~azure.core.pipeline.transport.HttpResponse
75+
:rtype: ~azure.core.rest.HttpResponse
6976
"""
77+
78+
request_copy = deepcopy(request)
7079
path_format_arguments = {
71-
'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True),
80+
"url": self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True),
7281
}
73-
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
74-
stream = kwargs.pop("stream", True)
75-
pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs)
76-
return pipeline_response.http_response
82+
83+
request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
84+
return self._client.send_request(request_copy, **kwargs)
7785

7886
def close(self):
7987
# type: () -> None
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# --------------------------------------------------------------------------
2+
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.6.6, generator: @autorest/python@5.11.0)
3+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
4+
# --------------------------------------------------------------------------
5+
6+
from azure.core.pipeline.transport import HttpRequest
7+
8+
def _convert_request(request, files=None):
9+
data = request.content if not files else None
10+
request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data)
11+
if files:
12+
request.set_formdata_body(files)
13+
return request
14+
15+
def _format_url_section(template, **kwargs):
16+
components = template.split("/")
17+
while components:
18+
try:
19+
return template.format(**kwargs)
20+
except KeyError as key:
21+
formatted_components = template.split("/")
22+
components = [
23+
c for c in formatted_components if "{}".format(key.args[0]) not in c
24+
]
25+
template = "/".join(components)
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
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

77
from ._container_registry import ContainerRegistry
88
__all__ = ['ContainerRegistry']
9+
10+
try:
11+
from ._patch import patch_sdk # type: ignore
12+
patch_sdk()
13+
except ImportError:
14+
pass

sdk/containerregistry/azure-containerregistry/azure/containerregistry/_generated/aio/_configuration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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

@@ -26,9 +26,9 @@ def __init__(
2626
url: str,
2727
**kwargs: Any
2828
) -> None:
29+
super(ContainerRegistryConfiguration, self).__init__(**kwargs)
2930
if url is None:
3031
raise ValueError("Parameter 'url' must not be None.")
31-
super(ContainerRegistryConfiguration, self).__init__(**kwargs)
3232

3333
self.url = url
3434
kwargs.setdefault('sdk_moniker', 'containerregistry/{}'.format(VERSION))

sdk/containerregistry/azure-containerregistry/azure/containerregistry/_generated/aio/_container_registry.py

Lines changed: 39 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,28 @@
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

910
from azure.core import AsyncPipelineClient
10-
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
11+
from azure.core.rest import AsyncHttpResponse, HttpRequest
1112
from 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
1714
from .. 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()

sdk/containerregistry/azure-containerregistry/azure/containerregistry/_generated/aio/operations/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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

0 commit comments

Comments
 (0)