Skip to content

Commit c5afc3a

Browse files
author
SDKAuto
committed
CodeGen from PR 22777 in Azure/azure-rest-api-specs
Merge d0847561eb2f769001dc61c566d83498a080fd7d into 1e71ad94aeb8843559d59d863c895770560d7c93
1 parent 3140a89 commit c5afc3a

File tree

373 files changed

+10523
-10831
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

373 files changed

+10523
-10831
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "2c4244e5bcb8939167b79f633cdc17a1f0eae9be",
2+
"commit": "0743528e237288b7eaae4c121645f574c5c99d09",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"autorest": "3.9.2",
55
"use": [
6-
"@autorest/python@6.2.16",
6+
"@autorest/python@6.5.0",
77
"@autorest/modelerfour@4.24.3"
88
],
9-
"autorest_command": "autorest specification/containerregistry/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.2.16 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
9+
"autorest_command": "autorest specification/containerregistry/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.5.0 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
1010
"readme": "specification/containerregistry/resource-manager/readme.md"
1111
}

sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/_container_registry_management_client.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,34 @@ def agent_pools(self):
178178
self._config.api_version = api_version
179179
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
180180

181+
@property
182+
def archive_versions(self):
183+
"""Instance depends on the API version:
184+
185+
* 2023-01-01-preview: :class:`ArchiveVersionsOperations<azure.mgmt.containerregistry.v2023_01_01_preview.operations.ArchiveVersionsOperations>`
186+
"""
187+
api_version = self._get_api_version('archive_versions')
188+
if api_version == '2023-01-01-preview':
189+
from .v2023_01_01_preview.operations import ArchiveVersionsOperations as OperationClass
190+
else:
191+
raise ValueError("API version {} does not have operation group 'archive_versions'".format(api_version))
192+
self._config.api_version = api_version
193+
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
194+
195+
@property
196+
def archives(self):
197+
"""Instance depends on the API version:
198+
199+
* 2023-01-01-preview: :class:`ArchivesOperations<azure.mgmt.containerregistry.v2023_01_01_preview.operations.ArchivesOperations>`
200+
"""
201+
api_version = self._get_api_version('archives')
202+
if api_version == '2023-01-01-preview':
203+
from .v2023_01_01_preview.operations import ArchivesOperations as OperationClass
204+
else:
205+
raise ValueError("API version {} does not have operation group 'archives'".format(api_version))
206+
self._config.api_version = api_version
207+
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
208+
181209
@property
182210
def build_steps(self):
183211
"""Instance depends on the API version:

sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/_serialization.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
631631
if xml_desc.get("attr", False):
632632
if xml_ns:
633633
ET.register_namespace(xml_prefix, xml_ns)
634-
xml_name = "{}{}".format(xml_ns, xml_name)
634+
xml_name = "{{{}}}{}".format(xml_ns, xml_name)
635635
serialized.set(xml_name, new_attr) # type: ignore
636636
continue
637637
if xml_desc.get("text", False):
@@ -1273,7 +1273,7 @@ def _extract_name_from_internal_type(internal_type):
12731273
xml_name = internal_type_xml_map.get("name", internal_type.__name__)
12741274
xml_ns = internal_type_xml_map.get("ns", None)
12751275
if xml_ns:
1276-
xml_name = "{}{}".format(xml_ns, xml_name)
1276+
xml_name = "{{{}}}{}".format(xml_ns, xml_name)
12771277
return xml_name
12781278

12791279

@@ -1297,7 +1297,7 @@ def xml_key_extractor(attr, attr_desc, data):
12971297
# Integrate namespace if necessary
12981298
xml_ns = xml_desc.get("ns", internal_type_xml_map.get("ns", None))
12991299
if xml_ns:
1300-
xml_name = "{}{}".format(xml_ns, xml_name)
1300+
xml_name = "{{{}}}{}".format(xml_ns, xml_name)
13011301

13021302
# If it's an attribute, that's simple
13031303
if xml_desc.get("attr", False):

sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/_version.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33
# Copyright (c) Microsoft Corporation. All rights reserved.
44
# Licensed under the MIT License. See License.txt in the project root for
55
# license information.
6-
#
7-
# Code generated by Microsoft (R) AutoRest Code Generator.
8-
# Changes may cause incorrect behavior and will be lost if the code is
9-
# regenerated.
106
# --------------------------------------------------------------------------
117

12-
VERSION = "10.1.0"
8+
VERSION = "0.1.0"

sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/aio/_container_registry_management_client.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,34 @@ def agent_pools(self):
178178
self._config.api_version = api_version
179179
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
180180

181+
@property
182+
def archive_versions(self):
183+
"""Instance depends on the API version:
184+
185+
* 2023-01-01-preview: :class:`ArchiveVersionsOperations<azure.mgmt.containerregistry.v2023_01_01_preview.aio.operations.ArchiveVersionsOperations>`
186+
"""
187+
api_version = self._get_api_version('archive_versions')
188+
if api_version == '2023-01-01-preview':
189+
from ..v2023_01_01_preview.aio.operations import ArchiveVersionsOperations as OperationClass
190+
else:
191+
raise ValueError("API version {} does not have operation group 'archive_versions'".format(api_version))
192+
self._config.api_version = api_version
193+
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
194+
195+
@property
196+
def archives(self):
197+
"""Instance depends on the API version:
198+
199+
* 2023-01-01-preview: :class:`ArchivesOperations<azure.mgmt.containerregistry.v2023_01_01_preview.aio.operations.ArchivesOperations>`
200+
"""
201+
api_version = self._get_api_version('archives')
202+
if api_version == '2023-01-01-preview':
203+
from ..v2023_01_01_preview.aio.operations import ArchivesOperations as OperationClass
204+
else:
205+
raise ValueError("API version {} does not have operation group 'archives'".format(api_version))
206+
self._config.api_version = api_version
207+
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
208+
181209
@property
182210
def build_steps(self):
183211
"""Instance depends on the API version:

sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/_configuration.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
import sys
109
from typing import Any, TYPE_CHECKING
1110

1211
from azure.core.configuration import Configuration
@@ -15,11 +14,6 @@
1514

1615
from ._version import VERSION
1716

18-
if sys.version_info >= (3, 8):
19-
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
20-
else:
21-
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
22-
2317
if TYPE_CHECKING:
2418
# pylint: disable=unused-import,ungrouped-imports
2519
from azure.core.credentials import TokenCredential
@@ -42,7 +36,7 @@ class ContainerRegistryManagementClientConfiguration(Configuration): # pylint:
4236

4337
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
4438
super(ContainerRegistryManagementClientConfiguration, self).__init__(**kwargs)
45-
api_version: Literal["2017-03-01"] = kwargs.pop("api_version", "2017-03-01")
39+
api_version: str = kwargs.pop("api_version", "2017-03-01")
4640

4741
if credential is None:
4842
raise ValueError("Parameter 'credential' must not be None.")

sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/_container_registry_management_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def __init__(
5252
self._config = ContainerRegistryManagementClientConfiguration(
5353
credential=credential, subscription_id=subscription_id, **kwargs
5454
)
55-
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
55+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
5656

5757
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
5858
self._serialize = Serializer(client_models)
@@ -90,5 +90,5 @@ def __enter__(self) -> "ContainerRegistryManagementClient":
9090
self._client.__enter__()
9191
return self
9292

93-
def __exit__(self, *exc_details) -> None:
93+
def __exit__(self, *exc_details: Any) -> None:
9494
self._client.__exit__(*exc_details)
Lines changed: 18 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,20 @@
1-
# coding=utf-8
2-
# --------------------------------------------------------------------------
3-
#
4-
# Copyright (c) Microsoft Corporation. All rights reserved.
5-
#
6-
# The MIT License (MIT)
7-
#
8-
# Permission is hereby granted, free of charge, to any person obtaining a copy
9-
# of this software and associated documentation files (the ""Software""), to
10-
# deal in the Software without restriction, including without limitation the
11-
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
12-
# sell copies of the Software, and to permit persons to whom the Software is
13-
# furnished to do so, subject to the following conditions:
14-
#
15-
# The above copyright notice and this permission notice shall be included in
16-
# all copies or substantial portions of the Software.
17-
#
18-
# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23-
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
24-
# IN THE SOFTWARE.
25-
#
26-
# --------------------------------------------------------------------------
1+
# ------------------------------------
2+
# Copyright (c) Microsoft Corporation.
3+
# Licensed under the MIT License.
4+
# ------------------------------------
5+
"""Customize generated code here.
6+
7+
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
8+
"""
9+
from typing import List
10+
11+
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
12+
2713

28-
# This file is used for handwritten extensions to the generated code. Example:
29-
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
3014
def patch_sdk():
31-
pass
15+
"""Do not remove from this file.
16+
17+
`patch_sdk` is a last resort escape hatch that allows you to do customizations
18+
you can't accomplish using the techniques described in
19+
https://aka.ms/azsdk/python/dpcodegen/python/customize
20+
"""

sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
VERSION = "10.1.0"
9+
VERSION = "1.0.0b1"

sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/aio/_configuration.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
import sys
109
from typing import Any, TYPE_CHECKING
1110

1211
from azure.core.configuration import Configuration
@@ -15,11 +14,6 @@
1514

1615
from .._version import VERSION
1716

18-
if sys.version_info >= (3, 8):
19-
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
20-
else:
21-
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
22-
2317
if TYPE_CHECKING:
2418
# pylint: disable=unused-import,ungrouped-imports
2519
from azure.core.credentials_async import AsyncTokenCredential
@@ -42,7 +36,7 @@ class ContainerRegistryManagementClientConfiguration(Configuration): # pylint:
4236

4337
def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None:
4438
super(ContainerRegistryManagementClientConfiguration, self).__init__(**kwargs)
45-
api_version: Literal["2017-03-01"] = kwargs.pop("api_version", "2017-03-01")
39+
api_version: str = kwargs.pop("api_version", "2017-03-01")
4640

4741
if credential is None:
4842
raise ValueError("Parameter 'credential' must not be None.")

0 commit comments

Comments
 (0)