Skip to content

Commit ce6e35d

Browse files
author
SDKAuto
committed
CodeGen from PR 26059 in Azure/azure-rest-api-specs
Merge 67ad22b39adb1c6cbb7343e86eaafb36b24e6c42 into 4c38cb9966cd6afbb03c7e9b14997720a728baee
1 parent 98fb30a commit ce6e35d

File tree

94 files changed

+13467
-1067
lines changed

Some content is hidden

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

94 files changed

+13467
-1067
lines changed
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "270d3cd664cca3ddc8511f92d3851a715e2c61db",
2+
"commit": "fd24ab8b273cde9cd1f608c6ac69fd352679f3e0",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4-
"autorest": "3.9.2",
4+
"autorest": "3.9.7",
55
"use": [
6-
"@autorest/python@6.2.16",
7-
"@autorest/modelerfour@4.24.3"
6+
"@autorest/python@6.7.1",
7+
"@autorest/modelerfour@4.26.2"
88
],
9-
"autorest_command": "autorest specification/hybridcompute/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 --tag=package-2022-03 --use=@autorest/python@6.2.16 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
9+
"autorest_command": "autorest specification/hybridcompute/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.7.1 --use=@autorest/modelerfour@4.26.2 --version=3.9.7 --version-tolerant=False",
1010
"readme": "specification/hybridcompute/resource-manager/readme.md"
1111
}

sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_configuration.py

Lines changed: 3 additions & 9 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
@@ -35,14 +29,14 @@ class HybridComputeManagementClientConfiguration(Configuration): # pylint: disa
3529
:type credential: ~azure.core.credentials.TokenCredential
3630
:param subscription_id: The ID of the target subscription. Required.
3731
:type subscription_id: str
38-
:keyword api_version: Api Version. Default value is "2022-03-10". Note that overriding this
39-
default value may result in unsupported behavior.
32+
:keyword api_version: Api Version. Default value is "2023-10-03-preview". Note that overriding
33+
this default value may result in unsupported behavior.
4034
:paramtype api_version: str
4135
"""
4236

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

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

sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_hybrid_compute_management_client.py

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,16 @@
1616
from ._configuration import HybridComputeManagementClientConfiguration
1717
from ._serialization import Deserializer, Serializer
1818
from .operations import (
19+
AgentVersionOperations,
20+
ExtensionMetadataOperations,
1921
HybridComputeManagementClientOperationsMixin,
22+
HybridIdentityMetadataOperations,
23+
LicenseProfilesOperations,
24+
LicensesOperations,
2025
MachineExtensionsOperations,
26+
MachineRunCommandsOperations,
2127
MachinesOperations,
28+
NetworkProfileOperations,
2229
Operations,
2330
PrivateEndpointConnectionsOperations,
2431
PrivateLinkResourcesOperations,
@@ -35,12 +42,27 @@ class HybridComputeManagementClient(
3542
): # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
3643
"""The Hybrid Compute Management Client.
3744
45+
:ivar licenses: LicensesOperations operations
46+
:vartype licenses: azure.mgmt.hybridcompute.operations.LicensesOperations
3847
:ivar machines: MachinesOperations operations
3948
:vartype machines: azure.mgmt.hybridcompute.operations.MachinesOperations
49+
:ivar license_profiles: LicenseProfilesOperations operations
50+
:vartype license_profiles: azure.mgmt.hybridcompute.operations.LicenseProfilesOperations
4051
:ivar machine_extensions: MachineExtensionsOperations operations
4152
:vartype machine_extensions: azure.mgmt.hybridcompute.operations.MachineExtensionsOperations
53+
:ivar extension_metadata: ExtensionMetadataOperations operations
54+
:vartype extension_metadata: azure.mgmt.hybridcompute.operations.ExtensionMetadataOperations
4255
:ivar operations: Operations operations
4356
:vartype operations: azure.mgmt.hybridcompute.operations.Operations
57+
:ivar network_profile: NetworkProfileOperations operations
58+
:vartype network_profile: azure.mgmt.hybridcompute.operations.NetworkProfileOperations
59+
:ivar hybrid_identity_metadata: HybridIdentityMetadataOperations operations
60+
:vartype hybrid_identity_metadata:
61+
azure.mgmt.hybridcompute.operations.HybridIdentityMetadataOperations
62+
:ivar agent_version: AgentVersionOperations operations
63+
:vartype agent_version: azure.mgmt.hybridcompute.operations.AgentVersionOperations
64+
:ivar machine_run_commands: MachineRunCommandsOperations operations
65+
:vartype machine_run_commands: azure.mgmt.hybridcompute.operations.MachineRunCommandsOperations
4466
:ivar private_link_scopes: PrivateLinkScopesOperations operations
4567
:vartype private_link_scopes: azure.mgmt.hybridcompute.operations.PrivateLinkScopesOperations
4668
:ivar private_link_resources: PrivateLinkResourcesOperations operations
@@ -55,8 +77,8 @@ class HybridComputeManagementClient(
5577
:type subscription_id: str
5678
:param base_url: Service URL. Default value is "https://management.azure.com".
5779
:type base_url: str
58-
:keyword api_version: Api Version. Default value is "2022-03-10". Note that overriding this
59-
default value may result in unsupported behavior.
80+
:keyword api_version: Api Version. Default value is "2023-10-03-preview". Note that overriding
81+
this default value may result in unsupported behavior.
6082
:paramtype api_version: str
6183
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
6284
Retry-After header is present.
@@ -72,17 +94,32 @@ def __init__(
7294
self._config = HybridComputeManagementClientConfiguration(
7395
credential=credential, subscription_id=subscription_id, **kwargs
7496
)
75-
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
97+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
7698

7799
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
78100
self._serialize = Serializer(client_models)
79101
self._deserialize = Deserializer(client_models)
80102
self._serialize.client_side_validation = False
103+
self.licenses = LicensesOperations(self._client, self._config, self._serialize, self._deserialize)
81104
self.machines = MachinesOperations(self._client, self._config, self._serialize, self._deserialize)
105+
self.license_profiles = LicenseProfilesOperations(
106+
self._client, self._config, self._serialize, self._deserialize
107+
)
82108
self.machine_extensions = MachineExtensionsOperations(
83109
self._client, self._config, self._serialize, self._deserialize
84110
)
111+
self.extension_metadata = ExtensionMetadataOperations(
112+
self._client, self._config, self._serialize, self._deserialize
113+
)
85114
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
115+
self.network_profile = NetworkProfileOperations(self._client, self._config, self._serialize, self._deserialize)
116+
self.hybrid_identity_metadata = HybridIdentityMetadataOperations(
117+
self._client, self._config, self._serialize, self._deserialize
118+
)
119+
self.agent_version = AgentVersionOperations(self._client, self._config, self._serialize, self._deserialize)
120+
self.machine_run_commands = MachineRunCommandsOperations(
121+
self._client, self._config, self._serialize, self._deserialize
122+
)
86123
self.private_link_scopes = PrivateLinkScopesOperations(
87124
self._client, self._config, self._serialize, self._deserialize
88125
)
@@ -122,5 +159,5 @@ def __enter__(self) -> "HybridComputeManagementClient":
122159
self._client.__enter__()
123160
return self
124161

125-
def __exit__(self, *exc_details) -> None:
162+
def __exit__(self, *exc_details: Any) -> None:
126163
self._client.__exit__(*exc_details)

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

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
629629
if xml_desc.get("attr", False):
630630
if xml_ns:
631631
ET.register_namespace(xml_prefix, xml_ns)
632-
xml_name = "{}{}".format(xml_ns, xml_name)
632+
xml_name = "{{{}}}{}".format(xml_ns, xml_name)
633633
serialized.set(xml_name, new_attr) # type: ignore
634634
continue
635635
if xml_desc.get("text", False):
@@ -662,8 +662,9 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
662662
_serialized.update(_new_attr) # type: ignore
663663
_new_attr = _new_attr[k] # type: ignore
664664
_serialized = _serialized[k]
665-
except ValueError:
666-
continue
665+
except ValueError as err:
666+
if isinstance(err, SerializationError):
667+
raise
667668

668669
except (AttributeError, KeyError, TypeError) as err:
669670
msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj))
@@ -741,6 +742,8 @@ def query(self, name, data, data_type, **kwargs):
741742
742743
:param data: The data to be serialized.
743744
:param str data_type: The type to be serialized from.
745+
:keyword bool skip_quote: Whether to skip quote the serialized result.
746+
Defaults to False.
744747
:rtype: str
745748
:raises: TypeError if serialization fails.
746749
:raises: ValueError if data is None
@@ -749,10 +752,8 @@ def query(self, name, data, data_type, **kwargs):
749752
# Treat the list aside, since we don't want to encode the div separator
750753
if data_type.startswith("["):
751754
internal_data_type = data_type[1:-1]
752-
data = [self.serialize_data(d, internal_data_type, **kwargs) if d is not None else "" for d in data]
753-
if not kwargs.get("skip_quote", False):
754-
data = [quote(str(d), safe="") for d in data]
755-
return str(self.serialize_iter(data, internal_data_type, **kwargs))
755+
do_quote = not kwargs.get("skip_quote", False)
756+
return str(self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs))
756757

757758
# Not a list, regular serialization
758759
output = self.serialize_data(data, data_type, **kwargs)
@@ -891,6 +892,8 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs):
891892
not be None or empty.
892893
:param str div: If set, this str will be used to combine the elements
893894
in the iterable into a combined string. Default is 'None'.
895+
:keyword bool do_quote: Whether to quote the serialized result of each iterable element.
896+
Defaults to False.
894897
:rtype: list, str
895898
"""
896899
if isinstance(data, str):
@@ -903,9 +906,14 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs):
903906
for d in data:
904907
try:
905908
serialized.append(self.serialize_data(d, iter_type, **kwargs))
906-
except ValueError:
909+
except ValueError as err:
910+
if isinstance(err, SerializationError):
911+
raise
907912
serialized.append(None)
908913

914+
if kwargs.get("do_quote", False):
915+
serialized = ["" if s is None else quote(str(s), safe="") for s in serialized]
916+
909917
if div:
910918
serialized = ["" if s is None else str(s) for s in serialized]
911919
serialized = div.join(serialized)
@@ -950,7 +958,9 @@ def serialize_dict(self, attr, dict_type, **kwargs):
950958
for key, value in attr.items():
951959
try:
952960
serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs)
953-
except ValueError:
961+
except ValueError as err:
962+
if isinstance(err, SerializationError):
963+
raise
954964
serialized[self.serialize_unicode(key)] = None
955965

956966
if "xml" in serialization_ctxt:
@@ -1271,7 +1281,7 @@ def _extract_name_from_internal_type(internal_type):
12711281
xml_name = internal_type_xml_map.get("name", internal_type.__name__)
12721282
xml_ns = internal_type_xml_map.get("ns", None)
12731283
if xml_ns:
1274-
xml_name = "{}{}".format(xml_ns, xml_name)
1284+
xml_name = "{{{}}}{}".format(xml_ns, xml_name)
12751285
return xml_name
12761286

12771287

@@ -1295,7 +1305,7 @@ def xml_key_extractor(attr, attr_desc, data):
12951305
# Integrate namespace if necessary
12961306
xml_ns = xml_desc.get("ns", internal_type_xml_map.get("ns", None))
12971307
if xml_ns:
1298-
xml_name = "{}{}".format(xml_ns, xml_name)
1308+
xml_name = "{{{}}}{}".format(xml_ns, xml_name)
12991309

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

sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_vendor.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# --------------------------------------------------------------------------
77

88
from abc import ABC
9-
from typing import List, TYPE_CHECKING, cast
9+
from typing import TYPE_CHECKING
1010

1111
from azure.core.pipeline.transport import HttpRequest
1212

@@ -27,18 +27,6 @@ def _convert_request(request, files=None):
2727
return request
2828

2929

30-
def _format_url_section(template, **kwargs):
31-
components = template.split("/")
32-
while components:
33-
try:
34-
return template.format(**kwargs)
35-
except KeyError as key:
36-
# Need the cast, as for some reasons "split" is typed as list[str | Any]
37-
formatted_components = cast(List[str], template.split("/"))
38-
components = [c for c in formatted_components if "{}".format(key.args[0]) not in c]
39-
template = "/".join(components)
40-
41-
4230
class HybridComputeManagementClientMixinABC(ABC):
4331
"""DO NOT use this class. It is for internal typing use only."""
4432

sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_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 = "8.0.0"
9+
VERSION = "1.0.0b1"

sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/aio/_configuration.py

Lines changed: 3 additions & 9 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
@@ -35,14 +29,14 @@ class HybridComputeManagementClientConfiguration(Configuration): # pylint: disa
3529
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
3630
:param subscription_id: The ID of the target subscription. Required.
3731
:type subscription_id: str
38-
:keyword api_version: Api Version. Default value is "2022-03-10". Note that overriding this
39-
default value may result in unsupported behavior.
32+
:keyword api_version: Api Version. Default value is "2023-10-03-preview". Note that overriding
33+
this default value may result in unsupported behavior.
4034
:paramtype api_version: str
4135
"""
4236

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

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

0 commit comments

Comments
 (0)