From 8aa138141104056897e9627345764bb6bcb4df47 Mon Sep 17 00:00:00 2001 From: AutoPrFromHttpClientPython Date: Thu, 29 Jan 2026 05:04:07 +0000 Subject: [PATCH 1/4] Update dependencies --- packages/autorest.python/package.json | 2 +- packages/typespec-python/package.json | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/autorest.python/package.json b/packages/autorest.python/package.json index d1ef88e2f0..3f2b534a4a 100644 --- a/packages/autorest.python/package.json +++ b/packages/autorest.python/package.json @@ -29,7 +29,7 @@ }, "homepage": "https://github.com/Azure/autorest.python/blob/main/README.md", "dependencies": { - "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTgwOTQ5MC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.26.0.tgz", + "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTgxMTk4OC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.26.1.tgz", "@autorest/system-requirements": "~1.0.2", "fs-extra": "~11.2.0", "tsx": "~4.19.1" diff --git a/packages/typespec-python/package.json b/packages/typespec-python/package.json index 1c40139ad1..57902eb9bb 100644 --- a/packages/typespec-python/package.json +++ b/packages/typespec-python/package.json @@ -58,16 +58,16 @@ "@typespec/streams": ">=0.78.0 <1.0.0", "@typespec/xml": ">=0.78.0 <1.0.0", "@azure-tools/typespec-azure-core": ">=0.64.0 <1.0.0", - "@azure-tools/typespec-azure-resource-manager": ">=0.64.0 <1.0.0", - "@azure-tools/typespec-autorest": ">=0.64.0 <1.0.0", + "@azure-tools/typespec-azure-resource-manager": ">=0.64.1 <1.0.0", + "@azure-tools/typespec-autorest": ">=0.64.1 <1.0.0", "@azure-tools/typespec-azure-rulesets": ">=0.64.0 <1.0.0", - "@azure-tools/typespec-client-generator-core": ">=0.64.4 <1.0.0" + "@azure-tools/typespec-client-generator-core": ">=0.64.5 <1.0.0" }, "dependencies": { "js-yaml": "~4.1.0", "semver": "~7.6.2", "tsx": "~4.19.1", - "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTgwOTQ5MC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.26.0.tgz", + "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTgxMTk4OC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.26.1.tgz", "fs-extra": "~11.2.0" }, "devDependencies": { @@ -81,13 +81,13 @@ "@typespec/streams": "~0.78.0", "@typespec/tspd": "~0.70.0", "@typespec/xml": "~0.78.0", - "@azure-tools/typespec-azure-resource-manager": "~0.64.0", + "@azure-tools/typespec-azure-resource-manager": "~0.64.1", "@azure-tools/typespec-azure-core": "~0.64.0", "@azure-tools/typespec-azure-rulesets": "~0.64.0", - "@azure-tools/typespec-autorest": "~0.64.0", - "@azure-tools/typespec-client-generator-core": "~0.64.4", + "@azure-tools/typespec-autorest": "~0.64.1", + "@azure-tools/typespec-client-generator-core": "~0.64.5", "@azure-tools/azure-http-specs": "0.1.0-alpha.36", - "@typespec/http-specs": "0.1.0-alpha.32-dev.1", + "@typespec/http-specs": "0.1.0-alpha.31", "@typespec/spector": "0.1.0-alpha.22", "@typespec/spec-api": "0.1.0-alpha.12", "@types/js-yaml": "~4.0.5", From 640f610de207b0bd3fa5e51bfe1a8d57696d4bfa Mon Sep 17 00:00:00 2001 From: AutoPrFromHttpClientPython Date: Thu, 29 Jan 2026 05:06:19 +0000 Subject: [PATCH 2/4] Update dependencies (2026-01-29 05:06:19) --- .../test_model_base_xml_serialization.py | 92 ++++++------------- pnpm-lock.yaml | 92 +++++++++---------- 2 files changed, 76 insertions(+), 108 deletions(-) diff --git a/packages/typespec-python/test/generic_mock_api_tests/unittests/test_model_base_xml_serialization.py b/packages/typespec-python/test/generic_mock_api_tests/unittests/test_model_base_xml_serialization.py index 78912e305b..12011df99b 100644 --- a/packages/typespec-python/test/generic_mock_api_tests/unittests/test_model_base_xml_serialization.py +++ b/packages/typespec-python/test/generic_mock_api_tests/unittests/test_model_base_xml_serialization.py @@ -523,12 +523,10 @@ def __init__(self, *args, **kwargs): class TestXmlSerialization: def test_basic(self): """Test an ultra basic XML.""" - basic_xml = ET.fromstring( - """ + basic_xml = ET.fromstring(""" 37 - """ - ) + """) class XmlModel(Model): age: int = rest_field(xml={"name": "Age"}) @@ -544,12 +542,8 @@ def __init__(self, *args, **kwargs): def test_basic_unicode(self): """Test a XML with unicode.""" - basic_xml = ET.fromstring( - """ - """.encode( - "utf-8" - ) - ) + basic_xml = ET.fromstring(""" + """.encode("utf-8")) class XmlModel(Model): language: str = rest_field(xml={"name": "language", "attribute": True}) @@ -589,13 +583,11 @@ def __init__(self, *args, **kwargs): def test_type_basic(self): """Test basic types.""" - basic_xml = ET.fromstring( - """ + basic_xml = ET.fromstring(""" 37 true - """ - ) + """) class XmlModel(Model): age: int = rest_field(name="age", xml={"name": "Age"}) @@ -611,10 +603,8 @@ def __init__(self, *args, **kwargs): def test_basic_text(self): """Test a XML with unicode.""" - basic_xml = ET.fromstring( - """ - I am text""" - ) + basic_xml = ET.fromstring(""" + I am text""") class XmlModel(Model): language: str = rest_field(name="language", xml={"name": "language", "attribute": True}) @@ -630,15 +620,13 @@ def __init__(self, *args, **kwargs): def test_dict_type(self): """Test dict type.""" - basic_xml = ET.fromstring( - """ + basic_xml = ET.fromstring(""" value1 value2 - """ - ) + """) class XmlModel(Model): metadata: Dict[str, str] = rest_field(name="Metadata", xml={"name": "Metadata"}) @@ -658,8 +646,7 @@ def __init__(self, *args, **kwargs): def test_additional_properties(self): """Test additional properties.""" - basic_xml = ET.fromstring( - """ + basic_xml = ET.fromstring(""" test text @@ -672,8 +659,7 @@ def test_additional_properties(self): a b - """ - ) + """) class XmlModel(Model): name: str = rest_field(name="name", xml={"name": "Name"}) @@ -696,15 +682,13 @@ def __init__(self, *args, **kwargs): def test_list_wrapped_basic_types(self): """Test XML list and wrap, items is basic type and there is no itemsName.""" - basic_xml = ET.fromstring( - """ + basic_xml = ET.fromstring(""" granny fuji - """ - ) + """) class AppleBarrel(Model): good_apples: List[str] = rest_field(name="GoodApples", xml={"name": "GoodApples"}) @@ -720,13 +704,11 @@ def __init__(self, *args, **kwargs): def test_list_not_wrapped_basic_types(self): """Test XML list and no wrap, items is basic type and there is no itemsName.""" - basic_xml = ET.fromstring( - """ + basic_xml = ET.fromstring(""" granny fuji - """ - ) + """) class AppleBarrel(Model): good_apples: List[str] = rest_field(name="GoodApples", xml={"name": "GoodApples", "unwrapped": True}) @@ -742,15 +724,13 @@ def __init__(self, *args, **kwargs): def test_list_wrapped_basic_types_items_name(self): """Test XML list and wrap, items is basic type and itemsName.""" - basic_xml = ET.fromstring( - """ + basic_xml = ET.fromstring(""" granny fuji - """ - ) + """) class AppleBarrel(Model): good_apples: List[str] = rest_field(name="GoodApples", xml={"name": "GoodApples", "itemsName": "string"}) @@ -766,13 +746,11 @@ def __init__(self, *args, **kwargs): def test_list_not_wrapped_basic_types_items_name(self): """Test XML list and no wrap, items is basic type and itemsName.""" - basic_xml = ET.fromstring( - """ + basic_xml = ET.fromstring(""" granny fuji - """ - ) + """) class AppleBarrel(Model): good_apples: List[str] = rest_field( @@ -791,15 +769,13 @@ def __init__(self, *args, **kwargs): def test_list_wrapped_complex_types(self): """Test XML list and wrap, items is ref.""" - basic_xml = ET.fromstring( - """ + basic_xml = ET.fromstring(""" - """ - ) + """) class Apple(Model): name: str = rest_field(name="name", xml={"name": "name", "attribute": True}) @@ -824,13 +800,11 @@ def __init__(self, *args, **kwargs): def test_list_not_wrapped_complex_types(self): """Test XML list and wrap, items is ref.""" - basic_xml = ET.fromstring( - """ + basic_xml = ET.fromstring(""" - """ - ) + """) class Apple(Model): name: str = rest_field(name="name", xml={"name": "name", "attribute": True}) @@ -852,13 +826,11 @@ def __init__(self, *args, **kwargs): def test_two_complex_same_type(self): """Two different attribute are same type""" - basic_xml = ET.fromstring( - """ + basic_xml = ET.fromstring(""" - """ - ) + """) class Apple(Model): name: str = rest_field(name="name", xml={"name": "name", "attribute": True}) @@ -883,12 +855,10 @@ def __init__(self, *args, **kwargs): def test_basic_namespace(self): """Test an ultra basic XML.""" - basic_xml = ET.fromstring( - """ + basic_xml = ET.fromstring(""" 37 - """ - ) + """) class XmlModel(Model): age: int = rest_field( @@ -912,8 +882,7 @@ def __init__(self, *args, **kwargs): def test_complex_namespace(self): """Test recursive namespace.""" - basic_xml = ET.fromstring( - """ + basic_xml = ET.fromstring(""" lmazuel @@ -926,8 +895,7 @@ def test_complex_namespace(self): 12 - """ - ) + """) class QueueDescriptionResponseAuthor(Model): name: str = rest_field(name="name", xml={"ns": "http://www.w3.org/2005/Atom"}) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d609397122..0a58512170 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -60,8 +60,8 @@ importers: specifier: ~1.0.2 version: 1.0.2 '@typespec/http-client-python': - specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTgwOTQ5MC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.26.0.tgz - version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTgwOTQ5MC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.26.0.tgz(sci46xezvetolgxhmxjjwvt7o4) + specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTgxMTk4OC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.26.1.tgz + version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTgxMTk4OC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.26.1.tgz(pyd672ib3v6bthqtwhqpae7pk4) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -82,8 +82,8 @@ importers: packages/typespec-python: dependencies: '@typespec/http-client-python': - specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTgwOTQ5MC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.26.0.tgz - version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTgwOTQ5MC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.26.0.tgz(sci46xezvetolgxhmxjjwvt7o4) + specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTgxMTk4OC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.26.1.tgz + version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTgxMTk4OC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.26.1.tgz(pyd672ib3v6bthqtwhqpae7pk4) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -101,20 +101,20 @@ importers: specifier: 0.1.0-alpha.36 version: 0.1.0-alpha.36(76dotbmzpfj2ua2zbinupv72ei) '@azure-tools/typespec-autorest': - specifier: ~0.64.0 - version: 0.64.0(5qtuclgmanejzupoeh5fzi2ury) + specifier: ~0.64.1 + version: 0.64.1(jzo7kuo6fjo5kkcajadlzhggh4) '@azure-tools/typespec-azure-core': specifier: ~0.64.0 version: 0.64.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/http@1.8.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/streams@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))))(@typespec/rest@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/http@1.8.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/streams@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))))) '@azure-tools/typespec-azure-resource-manager': - specifier: ~0.64.0 - version: 0.64.0(musqkchxaiwlrfknjzwcx7owku) + specifier: ~0.64.1 + version: 0.64.1(musqkchxaiwlrfknjzwcx7owku) '@azure-tools/typespec-azure-rulesets': specifier: ~0.64.0 - version: 0.64.0(@azure-tools/typespec-azure-core@0.64.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/http@1.8.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/streams@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))))(@typespec/rest@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/http@1.8.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/streams@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))))))(@azure-tools/typespec-azure-resource-manager@0.64.0(musqkchxaiwlrfknjzwcx7owku))(@azure-tools/typespec-client-generator-core@0.64.4(7qbtfjmv7njzcmhkwsmpv6cgrq))(@typespec/compiler@1.8.0(@types/node@24.1.0)) + version: 0.64.0(@azure-tools/typespec-azure-core@0.64.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/http@1.8.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/streams@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))))(@typespec/rest@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/http@1.8.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/streams@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))))))(@azure-tools/typespec-azure-resource-manager@0.64.1(musqkchxaiwlrfknjzwcx7owku))(@azure-tools/typespec-client-generator-core@0.64.5(7qbtfjmv7njzcmhkwsmpv6cgrq))(@typespec/compiler@1.8.0(@types/node@24.1.0)) '@azure-tools/typespec-client-generator-core': - specifier: ~0.64.4 - version: 0.64.4(7qbtfjmv7njzcmhkwsmpv6cgrq) + specifier: ~0.64.5 + version: 0.64.5(7qbtfjmv7njzcmhkwsmpv6cgrq) '@types/fs-extra': specifier: 11.0.4 version: 11.0.4 @@ -140,8 +140,8 @@ importers: specifier: ^1.8.0 version: 1.8.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/streams@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))) '@typespec/http-specs': - specifier: 0.1.0-alpha.32-dev.1 - version: 0.1.0-alpha.32-dev.1(@types/node@24.1.0)(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/http@1.8.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/streams@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))))(@typespec/rest@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/http@1.8.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/streams@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0)))))(@typespec/streams@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0)))(@typespec/versioning@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0)))(@typespec/xml@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))) + specifier: 0.1.0-alpha.31 + version: 0.1.0-alpha.31(@types/node@24.1.0)(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/http@1.8.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/streams@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))))(@typespec/rest@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/http@1.8.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/streams@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0)))))(@typespec/streams@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0)))(@typespec/versioning@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0)))(@typespec/xml@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))) '@typespec/openapi': specifier: ^1.8.0 version: 1.8.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/http@1.8.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/streams@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0)))) @@ -220,13 +220,13 @@ packages: '@typespec/versioning': ^0.78.0 '@typespec/xml': ^0.78.0 - '@azure-tools/typespec-autorest@0.64.0': - resolution: {integrity: sha512-zC2e3px+BqGJvE9DeW00S0PZmkydorB3Hm6Fb2vlJUdmHuTTSochPiZFJF7LHNsAL8sDu7azSHzypESFdN0FmA==} + '@azure-tools/typespec-autorest@0.64.1': + resolution: {integrity: sha512-WzSRiX0XS7hCL+uiivLBYMbirEUenxNzPT4giF0J+r54CVNXq/u8PLnA/06F5EHkXPa92swF4BxB1vFWB2TKow==} engines: {node: '>=20.0.0'} peerDependencies: '@azure-tools/typespec-azure-core': ^0.64.0 - '@azure-tools/typespec-azure-resource-manager': ^0.64.0 - '@azure-tools/typespec-client-generator-core': ^0.64.0 + '@azure-tools/typespec-azure-resource-manager': ^0.64.1 + '@azure-tools/typespec-client-generator-core': ^0.64.4 '@typespec/compiler': ^1.8.0 '@typespec/http': ^1.8.0 '@typespec/openapi': ^1.8.0 @@ -245,8 +245,8 @@ packages: '@typespec/http': ^1.8.0 '@typespec/rest': ^0.78.0 - '@azure-tools/typespec-azure-resource-manager@0.64.0': - resolution: {integrity: sha512-1HwGo3Nt8ksafoPp1rFOopSzgh68SFsyVNCauzjO8ftf0fEqhRXo70OaGwP6wmTZJsLnW7u1DbrBNu6b0z2sOQ==} + '@azure-tools/typespec-azure-resource-manager@0.64.1': + resolution: {integrity: sha512-qQV/+ZVF1h8PsTNKhmKYyb+vSCgnLA8SoGeEE1oOrevGrrp9VgtOMAZ2xIxj6DpU90QU/8t2+r5P/gcQUV1iqw==} engines: {node: '>=20.0.0'} peerDependencies: '@azure-tools/typespec-azure-core': ^0.64.0 @@ -265,8 +265,8 @@ packages: '@azure-tools/typespec-client-generator-core': ^0.64.0 '@typespec/compiler': ^1.8.0 - '@azure-tools/typespec-client-generator-core@0.64.4': - resolution: {integrity: sha512-ZAYdbTe47VVff3MarJTXXiu/xg4iIilipJbjbqROIYbNkXcnIyZSC1IYDkzKHU3qgYrEyHuBjoVZc7rkxAtOLA==} + '@azure-tools/typespec-client-generator-core@0.64.5': + resolution: {integrity: sha512-RaATxsnc9ztdMPoIZ2SuyH97dIGY0BWGKcJBf0hBY+8J3de9o+QH796NA9OsiW+8J9ycCEooDbh/rkAspvA4xA==} engines: {node: '>=20.0.0'} peerDependencies: '@azure-tools/typespec-azure-core': ^0.64.0 @@ -1698,16 +1698,16 @@ packages: peerDependencies: '@typespec/compiler': ^1.8.0 - '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTgwOTQ5MC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.26.0.tgz': - resolution: {tarball: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTgwOTQ5MC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.26.0.tgz} - version: 0.26.0 + '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTgxMTk4OC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.26.1.tgz': + resolution: {tarball: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTgxMTk4OC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.26.1.tgz} + version: 0.26.1 engines: {node: '>=20.0.0'} peerDependencies: - '@azure-tools/typespec-autorest': '>=0.64.0 <1.0.0' + '@azure-tools/typespec-autorest': '>=0.64.1 <1.0.0' '@azure-tools/typespec-azure-core': '>=0.64.0 <1.0.0' - '@azure-tools/typespec-azure-resource-manager': '>=0.64.0 <1.0.0' + '@azure-tools/typespec-azure-resource-manager': '>=0.64.1 <1.0.0' '@azure-tools/typespec-azure-rulesets': '>=0.64.0 <1.0.0' - '@azure-tools/typespec-client-generator-core': '>=0.64.4 <1.0.0' + '@azure-tools/typespec-client-generator-core': '>=0.64.5 <1.0.0' '@typespec/compiler': ^1.8.0 '@typespec/events': '>=0.78.0 <1.0.0' '@typespec/http': ^1.8.0 @@ -1718,15 +1718,15 @@ packages: '@typespec/versioning': '>=0.78.0 <1.0.0' '@typespec/xml': '>=0.78.0 <1.0.0' - '@typespec/http-specs@0.1.0-alpha.32-dev.1': - resolution: {integrity: sha512-b+uzFhToERrmV154eqnCoQiw4Jekn+DRamfZVAl7ndVeayDq9zLNZyPnCmeU1+bdKxUGO8WoGkpA9BeGP3teeA==} + '@typespec/http-specs@0.1.0-alpha.31': + resolution: {integrity: sha512-ji+Zt4wB8NnVw3cFiE+LmkXCTfBWEq1xwBQrxJ83q28NQeKBMOVxynjiCz344gxOCcEfhAX4mwKcYeJUKAFVYQ==} engines: {node: '>=16.0.0'} peerDependencies: '@typespec/compiler': ^1.8.0 '@typespec/http': ^1.8.0 - '@typespec/rest': ^0.78.0 || >=0.79.0-dev <0.79.0 - '@typespec/versioning': ^0.78.0 || >=0.79.0-dev <0.79.0 - '@typespec/xml': ^0.78.0 || >=0.79.0-dev <0.79.0 + '@typespec/rest': ^0.78.0 + '@typespec/versioning': ^0.78.0 + '@typespec/xml': ^0.78.0 '@typespec/http@1.8.0': resolution: {integrity: sha512-ZKa4RISabwL8cUAmE3BkoNmtCYRjerO0+1Ba6XdDJKG+vJC5EGM2hkDf+ZmYsYZgrX0cvbhPXUKKh28zBV60hw==} @@ -4924,11 +4924,11 @@ snapshots: - '@typespec/streams' - supports-color - '@azure-tools/typespec-autorest@0.64.0(5qtuclgmanejzupoeh5fzi2ury)': + '@azure-tools/typespec-autorest@0.64.1(jzo7kuo6fjo5kkcajadlzhggh4)': dependencies: '@azure-tools/typespec-azure-core': 0.64.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/http@1.8.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/streams@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))))(@typespec/rest@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/http@1.8.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/streams@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))))) - '@azure-tools/typespec-azure-resource-manager': 0.64.0(musqkchxaiwlrfknjzwcx7owku) - '@azure-tools/typespec-client-generator-core': 0.64.4(7qbtfjmv7njzcmhkwsmpv6cgrq) + '@azure-tools/typespec-azure-resource-manager': 0.64.1(musqkchxaiwlrfknjzwcx7owku) + '@azure-tools/typespec-client-generator-core': 0.64.5(7qbtfjmv7njzcmhkwsmpv6cgrq) '@typespec/compiler': 1.8.0(@types/node@24.1.0) '@typespec/http': 1.8.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/streams@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))) '@typespec/openapi': 1.8.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/http@1.8.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/streams@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0)))) @@ -4943,7 +4943,7 @@ snapshots: '@typespec/http': 1.8.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/streams@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))) '@typespec/rest': 0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/http@1.8.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/streams@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0)))) - '@azure-tools/typespec-azure-resource-manager@0.64.0(musqkchxaiwlrfknjzwcx7owku)': + '@azure-tools/typespec-azure-resource-manager@0.64.1(musqkchxaiwlrfknjzwcx7owku)': dependencies: '@azure-tools/typespec-azure-core': 0.64.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/http@1.8.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/streams@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))))(@typespec/rest@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/http@1.8.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/streams@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))))) '@typespec/compiler': 1.8.0(@types/node@24.1.0) @@ -4954,14 +4954,14 @@ snapshots: change-case: 5.4.4 pluralize: 8.0.0 - '@azure-tools/typespec-azure-rulesets@0.64.0(@azure-tools/typespec-azure-core@0.64.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/http@1.8.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/streams@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))))(@typespec/rest@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/http@1.8.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/streams@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))))))(@azure-tools/typespec-azure-resource-manager@0.64.0(musqkchxaiwlrfknjzwcx7owku))(@azure-tools/typespec-client-generator-core@0.64.4(7qbtfjmv7njzcmhkwsmpv6cgrq))(@typespec/compiler@1.8.0(@types/node@24.1.0))': + '@azure-tools/typespec-azure-rulesets@0.64.0(@azure-tools/typespec-azure-core@0.64.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/http@1.8.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/streams@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))))(@typespec/rest@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/http@1.8.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/streams@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))))))(@azure-tools/typespec-azure-resource-manager@0.64.1(musqkchxaiwlrfknjzwcx7owku))(@azure-tools/typespec-client-generator-core@0.64.5(7qbtfjmv7njzcmhkwsmpv6cgrq))(@typespec/compiler@1.8.0(@types/node@24.1.0))': dependencies: '@azure-tools/typespec-azure-core': 0.64.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/http@1.8.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/streams@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))))(@typespec/rest@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/http@1.8.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/streams@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))))) - '@azure-tools/typespec-azure-resource-manager': 0.64.0(musqkchxaiwlrfknjzwcx7owku) - '@azure-tools/typespec-client-generator-core': 0.64.4(7qbtfjmv7njzcmhkwsmpv6cgrq) + '@azure-tools/typespec-azure-resource-manager': 0.64.1(musqkchxaiwlrfknjzwcx7owku) + '@azure-tools/typespec-client-generator-core': 0.64.5(7qbtfjmv7njzcmhkwsmpv6cgrq) '@typespec/compiler': 1.8.0(@types/node@24.1.0) - '@azure-tools/typespec-client-generator-core@0.64.4(7qbtfjmv7njzcmhkwsmpv6cgrq)': + '@azure-tools/typespec-client-generator-core@0.64.5(7qbtfjmv7njzcmhkwsmpv6cgrq)': dependencies: '@azure-tools/typespec-azure-core': 0.64.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/http@1.8.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/streams@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))))(@typespec/rest@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/http@1.8.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/streams@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))))) '@typespec/compiler': 1.8.0(@types/node@24.1.0) @@ -6510,13 +6510,13 @@ snapshots: dependencies: '@typespec/compiler': 1.8.0(@types/node@24.1.0) - '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTgwOTQ5MC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.26.0.tgz(sci46xezvetolgxhmxjjwvt7o4)': + '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTgxMTk4OC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.26.1.tgz(pyd672ib3v6bthqtwhqpae7pk4)': dependencies: - '@azure-tools/typespec-autorest': 0.64.0(5qtuclgmanejzupoeh5fzi2ury) + '@azure-tools/typespec-autorest': 0.64.1(jzo7kuo6fjo5kkcajadlzhggh4) '@azure-tools/typespec-azure-core': 0.64.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/http@1.8.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/streams@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))))(@typespec/rest@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/http@1.8.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/streams@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))))) - '@azure-tools/typespec-azure-resource-manager': 0.64.0(musqkchxaiwlrfknjzwcx7owku) - '@azure-tools/typespec-azure-rulesets': 0.64.0(@azure-tools/typespec-azure-core@0.64.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/http@1.8.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/streams@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))))(@typespec/rest@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/http@1.8.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/streams@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))))))(@azure-tools/typespec-azure-resource-manager@0.64.0(musqkchxaiwlrfknjzwcx7owku))(@azure-tools/typespec-client-generator-core@0.64.4(7qbtfjmv7njzcmhkwsmpv6cgrq))(@typespec/compiler@1.8.0(@types/node@24.1.0)) - '@azure-tools/typespec-client-generator-core': 0.64.4(7qbtfjmv7njzcmhkwsmpv6cgrq) + '@azure-tools/typespec-azure-resource-manager': 0.64.1(musqkchxaiwlrfknjzwcx7owku) + '@azure-tools/typespec-azure-rulesets': 0.64.0(@azure-tools/typespec-azure-core@0.64.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/http@1.8.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/streams@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))))(@typespec/rest@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/http@1.8.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/streams@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))))))(@azure-tools/typespec-azure-resource-manager@0.64.1(musqkchxaiwlrfknjzwcx7owku))(@azure-tools/typespec-client-generator-core@0.64.5(7qbtfjmv7njzcmhkwsmpv6cgrq))(@typespec/compiler@1.8.0(@types/node@24.1.0)) + '@azure-tools/typespec-client-generator-core': 0.64.5(7qbtfjmv7njzcmhkwsmpv6cgrq) '@typespec/compiler': 1.8.0(@types/node@24.1.0) '@typespec/events': 0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0)) '@typespec/http': 1.8.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/streams@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))) @@ -6535,7 +6535,7 @@ snapshots: - bufferutil - utf-8-validate - '@typespec/http-specs@0.1.0-alpha.32-dev.1(@types/node@24.1.0)(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/http@1.8.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/streams@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))))(@typespec/rest@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/http@1.8.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/streams@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0)))))(@typespec/streams@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0)))(@typespec/versioning@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0)))(@typespec/xml@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0)))': + '@typespec/http-specs@0.1.0-alpha.31(@types/node@24.1.0)(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/http@1.8.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/streams@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))))(@typespec/rest@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/http@1.8.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/streams@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0)))))(@typespec/streams@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0)))(@typespec/versioning@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0)))(@typespec/xml@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0)))': dependencies: '@typespec/compiler': 1.8.0(@types/node@24.1.0) '@typespec/http': 1.8.0(@typespec/compiler@1.8.0(@types/node@24.1.0))(@typespec/streams@0.78.0(@typespec/compiler@1.8.0(@types/node@24.1.0))) From 065b1643850f7b649b83fc2a7761ae04b732dbb8 Mon Sep 17 00:00:00 2001 From: AutoPrFromHttpClientPython Date: Thu, 29 Jan 2026 05:12:00 +0000 Subject: [PATCH 3/4] Regenerate for typespec-python (2026-01-29 05:12:00) --- .../combined/operations/_operations.py | 4 +- .../encode-array/apiview-properties.json | 28 +- .../encode/array/models/__init__.py | 23 - .../encode/array/models/_models.py | 245 +--- .../property/aio/operations/_operations.py | 1010 --------------- .../array/property/operations/_operations.py | 1146 ----------------- .../test_array_property_operations.py | 88 -- .../test_array_property_operations_async.py | 88 -- .../encode/array/models/__init__.py | 23 - .../encode/array/models/_models.py | 245 +--- .../property/aio/operations/_operations.py | 986 -------------- .../array/property/operations/_operations.py | 1122 ---------------- 12 files changed, 5 insertions(+), 5003 deletions(-) diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-multi-service-shared-models/azure/resourcemanager/multiservicesharedmodels/combined/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-multi-service-shared-models/azure/resourcemanager/multiservicesharedmodels/combined/operations/_operations.py index 0eeb165fc0..763c73cd1d 100644 --- a/packages/typespec-python/test/azure/generated/azure-resource-manager-multi-service-shared-models/azure/resourcemanager/multiservicesharedmodels/combined/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-multi-service-shared-models/azure/resourcemanager/multiservicesharedmodels/combined/operations/_operations.py @@ -112,7 +112,7 @@ def build_storage_accounts_get_request( accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/storageAccounts/{accountName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -141,7 +141,7 @@ def build_storage_accounts_create_or_update_request( # pylint: disable=name-too accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/storageAccounts/{accountName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), diff --git a/packages/typespec-python/test/azure/generated/encode-array/apiview-properties.json b/packages/typespec-python/test/azure/generated/encode-array/apiview-properties.json index de0fda0f6d..7eb36b044e 100644 --- a/packages/typespec-python/test/azure/generated/encode-array/apiview-properties.json +++ b/packages/typespec-python/test/azure/generated/encode-array/apiview-properties.json @@ -2,19 +2,9 @@ "CrossLanguagePackageId": "Encode.Array", "CrossLanguageDefinitionId": { "encode.array.models.CommaDelimitedArrayProperty": "Encode.Array.CommaDelimitedArrayProperty", - "encode.array.models.CommaDelimitedEnumArrayProperty": "Encode.Array.CommaDelimitedEnumArrayProperty", - "encode.array.models.CommaDelimitedExtensibleEnumArrayProperty": "Encode.Array.CommaDelimitedExtensibleEnumArrayProperty", "encode.array.models.NewlineDelimitedArrayProperty": "Encode.Array.NewlineDelimitedArrayProperty", - "encode.array.models.NewlineDelimitedEnumArrayProperty": "Encode.Array.NewlineDelimitedEnumArrayProperty", - "encode.array.models.NewlineDelimitedExtensibleEnumArrayProperty": "Encode.Array.NewlineDelimitedExtensibleEnumArrayProperty", "encode.array.models.PipeDelimitedArrayProperty": "Encode.Array.PipeDelimitedArrayProperty", - "encode.array.models.PipeDelimitedEnumArrayProperty": "Encode.Array.PipeDelimitedEnumArrayProperty", - "encode.array.models.PipeDelimitedExtensibleEnumArrayProperty": "Encode.Array.PipeDelimitedExtensibleEnumArrayProperty", "encode.array.models.SpaceDelimitedArrayProperty": "Encode.Array.SpaceDelimitedArrayProperty", - "encode.array.models.SpaceDelimitedEnumArrayProperty": "Encode.Array.SpaceDelimitedEnumArrayProperty", - "encode.array.models.SpaceDelimitedExtensibleEnumArrayProperty": "Encode.Array.SpaceDelimitedExtensibleEnumArrayProperty", - "encode.array.models.Colors": "Encode.Array.Colors", - "encode.array.models.ColorsExtensibleEnum": "Encode.Array.ColorsExtensibleEnum", "encode.array.operations.PropertyOperations.comma_delimited": "Encode.Array.Property.commaDelimited", "encode.array.aio.operations.PropertyOperations.comma_delimited": "Encode.Array.Property.commaDelimited", "encode.array.operations.PropertyOperations.space_delimited": "Encode.Array.Property.spaceDelimited", @@ -22,22 +12,6 @@ "encode.array.operations.PropertyOperations.pipe_delimited": "Encode.Array.Property.pipeDelimited", "encode.array.aio.operations.PropertyOperations.pipe_delimited": "Encode.Array.Property.pipeDelimited", "encode.array.operations.PropertyOperations.newline_delimited": "Encode.Array.Property.newlineDelimited", - "encode.array.aio.operations.PropertyOperations.newline_delimited": "Encode.Array.Property.newlineDelimited", - "encode.array.operations.PropertyOperations.enum_comma_delimited": "Encode.Array.Property.enumCommaDelimited", - "encode.array.aio.operations.PropertyOperations.enum_comma_delimited": "Encode.Array.Property.enumCommaDelimited", - "encode.array.operations.PropertyOperations.enum_space_delimited": "Encode.Array.Property.enumSpaceDelimited", - "encode.array.aio.operations.PropertyOperations.enum_space_delimited": "Encode.Array.Property.enumSpaceDelimited", - "encode.array.operations.PropertyOperations.enum_pipe_delimited": "Encode.Array.Property.enumPipeDelimited", - "encode.array.aio.operations.PropertyOperations.enum_pipe_delimited": "Encode.Array.Property.enumPipeDelimited", - "encode.array.operations.PropertyOperations.enum_newline_delimited": "Encode.Array.Property.enumNewlineDelimited", - "encode.array.aio.operations.PropertyOperations.enum_newline_delimited": "Encode.Array.Property.enumNewlineDelimited", - "encode.array.operations.PropertyOperations.extensible_enum_comma_delimited": "Encode.Array.Property.extensibleEnumCommaDelimited", - "encode.array.aio.operations.PropertyOperations.extensible_enum_comma_delimited": "Encode.Array.Property.extensibleEnumCommaDelimited", - "encode.array.operations.PropertyOperations.extensible_enum_space_delimited": "Encode.Array.Property.extensibleEnumSpaceDelimited", - "encode.array.aio.operations.PropertyOperations.extensible_enum_space_delimited": "Encode.Array.Property.extensibleEnumSpaceDelimited", - "encode.array.operations.PropertyOperations.extensible_enum_pipe_delimited": "Encode.Array.Property.extensibleEnumPipeDelimited", - "encode.array.aio.operations.PropertyOperations.extensible_enum_pipe_delimited": "Encode.Array.Property.extensibleEnumPipeDelimited", - "encode.array.operations.PropertyOperations.extensible_enum_newline_delimited": "Encode.Array.Property.extensibleEnumNewlineDelimited", - "encode.array.aio.operations.PropertyOperations.extensible_enum_newline_delimited": "Encode.Array.Property.extensibleEnumNewlineDelimited" + "encode.array.aio.operations.PropertyOperations.newline_delimited": "Encode.Array.Property.newlineDelimited" } } \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/encode-array/encode/array/models/__init__.py b/packages/typespec-python/test/azure/generated/encode-array/encode/array/models/__init__.py index 53dac38074..fee13926c8 100644 --- a/packages/typespec-python/test/azure/generated/encode-array/encode/array/models/__init__.py +++ b/packages/typespec-python/test/azure/generated/encode-array/encode/array/models/__init__.py @@ -15,22 +15,9 @@ from ._models import ( # type: ignore CommaDelimitedArrayProperty, - CommaDelimitedEnumArrayProperty, - CommaDelimitedExtensibleEnumArrayProperty, NewlineDelimitedArrayProperty, - NewlineDelimitedEnumArrayProperty, - NewlineDelimitedExtensibleEnumArrayProperty, PipeDelimitedArrayProperty, - PipeDelimitedEnumArrayProperty, - PipeDelimitedExtensibleEnumArrayProperty, SpaceDelimitedArrayProperty, - SpaceDelimitedEnumArrayProperty, - SpaceDelimitedExtensibleEnumArrayProperty, -) - -from ._enums import ( # type: ignore - Colors, - ColorsExtensibleEnum, ) from ._patch import __all__ as _patch_all from ._patch import * @@ -38,19 +25,9 @@ __all__ = [ "CommaDelimitedArrayProperty", - "CommaDelimitedEnumArrayProperty", - "CommaDelimitedExtensibleEnumArrayProperty", "NewlineDelimitedArrayProperty", - "NewlineDelimitedEnumArrayProperty", - "NewlineDelimitedExtensibleEnumArrayProperty", "PipeDelimitedArrayProperty", - "PipeDelimitedEnumArrayProperty", - "PipeDelimitedExtensibleEnumArrayProperty", "SpaceDelimitedArrayProperty", - "SpaceDelimitedEnumArrayProperty", - "SpaceDelimitedExtensibleEnumArrayProperty", - "Colors", - "ColorsExtensibleEnum", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/encode-array/encode/array/models/_models.py b/packages/typespec-python/test/azure/generated/encode-array/encode/array/models/_models.py index 41db8a6554..93c67ad2ba 100644 --- a/packages/typespec-python/test/azure/generated/encode-array/encode/array/models/_models.py +++ b/packages/typespec-python/test/azure/generated/encode-array/encode/array/models/_models.py @@ -7,13 +7,10 @@ # -------------------------------------------------------------------------- # pylint: disable=useless-super-delegation -from typing import Any, Mapping, TYPE_CHECKING, Union, overload +from typing import Any, Mapping, overload from .._utils.model_base import Model as _Model, rest_field -if TYPE_CHECKING: - from .. import models as _models - class CommaDelimitedArrayProperty(_Model): """CommaDelimitedArrayProperty. @@ -43,66 +40,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CommaDelimitedEnumArrayProperty(_Model): - """CommaDelimitedEnumArrayProperty. - - :ivar value: Required. - :vartype value: list[str or ~encode.array.models.Colors] - """ - - value: list[Union[str, "_models.Colors"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="commaDelimited" - ) - """Required.""" - - @overload - def __init__( - self, - *, - value: list[Union[str, "_models.Colors"]], - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class CommaDelimitedExtensibleEnumArrayProperty(_Model): # pylint: disable=name-too-long - """CommaDelimitedExtensibleEnumArrayProperty. - - :ivar value: Required. - :vartype value: list[str or ~encode.array.models.ColorsExtensibleEnum] - """ - - value: list[Union[str, "_models.ColorsExtensibleEnum"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="commaDelimited" - ) - """Required.""" - - @overload - def __init__( - self, - *, - value: list[Union[str, "_models.ColorsExtensibleEnum"]], - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - class NewlineDelimitedArrayProperty(_Model): """NewlineDelimitedArrayProperty. @@ -131,66 +68,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class NewlineDelimitedEnumArrayProperty(_Model): - """NewlineDelimitedEnumArrayProperty. - - :ivar value: Required. - :vartype value: list[str or ~encode.array.models.Colors] - """ - - value: list[Union[str, "_models.Colors"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="newlineDelimited" - ) - """Required.""" - - @overload - def __init__( - self, - *, - value: list[Union[str, "_models.Colors"]], - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class NewlineDelimitedExtensibleEnumArrayProperty(_Model): # pylint: disable=name-too-long - """NewlineDelimitedExtensibleEnumArrayProperty. - - :ivar value: Required. - :vartype value: list[str or ~encode.array.models.ColorsExtensibleEnum] - """ - - value: list[Union[str, "_models.ColorsExtensibleEnum"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="newlineDelimited" - ) - """Required.""" - - @overload - def __init__( - self, - *, - value: list[Union[str, "_models.ColorsExtensibleEnum"]], - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - class PipeDelimitedArrayProperty(_Model): """PipeDelimitedArrayProperty. @@ -219,66 +96,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PipeDelimitedEnumArrayProperty(_Model): - """PipeDelimitedEnumArrayProperty. - - :ivar value: Required. - :vartype value: list[str or ~encode.array.models.Colors] - """ - - value: list[Union[str, "_models.Colors"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="pipeDelimited" - ) - """Required.""" - - @overload - def __init__( - self, - *, - value: list[Union[str, "_models.Colors"]], - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class PipeDelimitedExtensibleEnumArrayProperty(_Model): - """PipeDelimitedExtensibleEnumArrayProperty. - - :ivar value: Required. - :vartype value: list[str or ~encode.array.models.ColorsExtensibleEnum] - """ - - value: list[Union[str, "_models.ColorsExtensibleEnum"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="pipeDelimited" - ) - """Required.""" - - @overload - def __init__( - self, - *, - value: list[Union[str, "_models.ColorsExtensibleEnum"]], - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - class SpaceDelimitedArrayProperty(_Model): """SpaceDelimitedArrayProperty. @@ -305,63 +122,3 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - - -class SpaceDelimitedEnumArrayProperty(_Model): - """SpaceDelimitedEnumArrayProperty. - - :ivar value: Required. - :vartype value: list[str or ~encode.array.models.Colors] - """ - - value: list[Union[str, "_models.Colors"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="spaceDelimited" - ) - """Required.""" - - @overload - def __init__( - self, - *, - value: list[Union[str, "_models.Colors"]], - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class SpaceDelimitedExtensibleEnumArrayProperty(_Model): # pylint: disable=name-too-long - """SpaceDelimitedExtensibleEnumArrayProperty. - - :ivar value: Required. - :vartype value: list[str or ~encode.array.models.ColorsExtensibleEnum] - """ - - value: list[Union[str, "_models.ColorsExtensibleEnum"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="spaceDelimited" - ) - """Required.""" - - @overload - def __init__( - self, - *, - value: list[Union[str, "_models.ColorsExtensibleEnum"]], - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) diff --git a/packages/typespec-python/test/azure/generated/encode-array/encode/array/property/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-array/encode/array/property/aio/operations/_operations.py index 85536486b7..8f477a4c50 100644 --- a/packages/typespec-python/test/azure/generated/encode-array/encode/array/property/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/encode-array/encode/array/property/aio/operations/_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -33,14 +32,6 @@ from ....aio._configuration import ArrayClientConfiguration from ...operations._operations import ( build_property_comma_delimited_request, - build_property_enum_comma_delimited_request, - build_property_enum_newline_delimited_request, - build_property_enum_pipe_delimited_request, - build_property_enum_space_delimited_request, - build_property_extensible_enum_comma_delimited_request, - build_property_extensible_enum_newline_delimited_request, - build_property_extensible_enum_pipe_delimited_request, - build_property_extensible_enum_space_delimited_request, build_property_newline_delimited_request, build_property_pipe_delimited_request, build_property_space_delimited_request, @@ -559,1004 +550,3 @@ async def newline_delimited( return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - - @overload - async def enum_comma_delimited( - self, body: _models3.CommaDelimitedEnumArrayProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.CommaDelimitedEnumArrayProperty: - """enum_comma_delimited. - - :param body: Required. - :type body: ~encode.array.models.CommaDelimitedEnumArrayProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: CommaDelimitedEnumArrayProperty. The CommaDelimitedEnumArrayProperty is compatible - with MutableMapping - :rtype: ~encode.array.models.CommaDelimitedEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def enum_comma_delimited( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.CommaDelimitedEnumArrayProperty: - """enum_comma_delimited. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: CommaDelimitedEnumArrayProperty. The CommaDelimitedEnumArrayProperty is compatible - with MutableMapping - :rtype: ~encode.array.models.CommaDelimitedEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def enum_comma_delimited( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.CommaDelimitedEnumArrayProperty: - """enum_comma_delimited. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: CommaDelimitedEnumArrayProperty. The CommaDelimitedEnumArrayProperty is compatible - with MutableMapping - :rtype: ~encode.array.models.CommaDelimitedEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def enum_comma_delimited( - self, body: Union[_models3.CommaDelimitedEnumArrayProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models3.CommaDelimitedEnumArrayProperty: - """enum_comma_delimited. - - :param body: Is one of the following types: CommaDelimitedEnumArrayProperty, JSON, IO[bytes] - Required. - :type body: ~encode.array.models.CommaDelimitedEnumArrayProperty or JSON or IO[bytes] - :return: CommaDelimitedEnumArrayProperty. The CommaDelimitedEnumArrayProperty is compatible - with MutableMapping - :rtype: ~encode.array.models.CommaDelimitedEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models3.CommaDelimitedEnumArrayProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_enum_comma_delimited_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models3.CommaDelimitedEnumArrayProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def enum_space_delimited( - self, body: _models3.SpaceDelimitedEnumArrayProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.SpaceDelimitedEnumArrayProperty: - """enum_space_delimited. - - :param body: Required. - :type body: ~encode.array.models.SpaceDelimitedEnumArrayProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: SpaceDelimitedEnumArrayProperty. The SpaceDelimitedEnumArrayProperty is compatible - with MutableMapping - :rtype: ~encode.array.models.SpaceDelimitedEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def enum_space_delimited( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.SpaceDelimitedEnumArrayProperty: - """enum_space_delimited. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: SpaceDelimitedEnumArrayProperty. The SpaceDelimitedEnumArrayProperty is compatible - with MutableMapping - :rtype: ~encode.array.models.SpaceDelimitedEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def enum_space_delimited( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.SpaceDelimitedEnumArrayProperty: - """enum_space_delimited. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: SpaceDelimitedEnumArrayProperty. The SpaceDelimitedEnumArrayProperty is compatible - with MutableMapping - :rtype: ~encode.array.models.SpaceDelimitedEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def enum_space_delimited( - self, body: Union[_models3.SpaceDelimitedEnumArrayProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models3.SpaceDelimitedEnumArrayProperty: - """enum_space_delimited. - - :param body: Is one of the following types: SpaceDelimitedEnumArrayProperty, JSON, IO[bytes] - Required. - :type body: ~encode.array.models.SpaceDelimitedEnumArrayProperty or JSON or IO[bytes] - :return: SpaceDelimitedEnumArrayProperty. The SpaceDelimitedEnumArrayProperty is compatible - with MutableMapping - :rtype: ~encode.array.models.SpaceDelimitedEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models3.SpaceDelimitedEnumArrayProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_enum_space_delimited_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models3.SpaceDelimitedEnumArrayProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def enum_pipe_delimited( - self, body: _models3.PipeDelimitedEnumArrayProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.PipeDelimitedEnumArrayProperty: - """enum_pipe_delimited. - - :param body: Required. - :type body: ~encode.array.models.PipeDelimitedEnumArrayProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PipeDelimitedEnumArrayProperty. The PipeDelimitedEnumArrayProperty is compatible with - MutableMapping - :rtype: ~encode.array.models.PipeDelimitedEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def enum_pipe_delimited( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.PipeDelimitedEnumArrayProperty: - """enum_pipe_delimited. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PipeDelimitedEnumArrayProperty. The PipeDelimitedEnumArrayProperty is compatible with - MutableMapping - :rtype: ~encode.array.models.PipeDelimitedEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def enum_pipe_delimited( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.PipeDelimitedEnumArrayProperty: - """enum_pipe_delimited. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: PipeDelimitedEnumArrayProperty. The PipeDelimitedEnumArrayProperty is compatible with - MutableMapping - :rtype: ~encode.array.models.PipeDelimitedEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def enum_pipe_delimited( - self, body: Union[_models3.PipeDelimitedEnumArrayProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models3.PipeDelimitedEnumArrayProperty: - """enum_pipe_delimited. - - :param body: Is one of the following types: PipeDelimitedEnumArrayProperty, JSON, IO[bytes] - Required. - :type body: ~encode.array.models.PipeDelimitedEnumArrayProperty or JSON or IO[bytes] - :return: PipeDelimitedEnumArrayProperty. The PipeDelimitedEnumArrayProperty is compatible with - MutableMapping - :rtype: ~encode.array.models.PipeDelimitedEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models3.PipeDelimitedEnumArrayProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_enum_pipe_delimited_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models3.PipeDelimitedEnumArrayProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def enum_newline_delimited( - self, body: _models3.NewlineDelimitedEnumArrayProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.NewlineDelimitedEnumArrayProperty: - """enum_newline_delimited. - - :param body: Required. - :type body: ~encode.array.models.NewlineDelimitedEnumArrayProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: NewlineDelimitedEnumArrayProperty. The NewlineDelimitedEnumArrayProperty is compatible - with MutableMapping - :rtype: ~encode.array.models.NewlineDelimitedEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def enum_newline_delimited( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.NewlineDelimitedEnumArrayProperty: - """enum_newline_delimited. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: NewlineDelimitedEnumArrayProperty. The NewlineDelimitedEnumArrayProperty is compatible - with MutableMapping - :rtype: ~encode.array.models.NewlineDelimitedEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def enum_newline_delimited( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.NewlineDelimitedEnumArrayProperty: - """enum_newline_delimited. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: NewlineDelimitedEnumArrayProperty. The NewlineDelimitedEnumArrayProperty is compatible - with MutableMapping - :rtype: ~encode.array.models.NewlineDelimitedEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def enum_newline_delimited( - self, body: Union[_models3.NewlineDelimitedEnumArrayProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models3.NewlineDelimitedEnumArrayProperty: - """enum_newline_delimited. - - :param body: Is one of the following types: NewlineDelimitedEnumArrayProperty, JSON, IO[bytes] - Required. - :type body: ~encode.array.models.NewlineDelimitedEnumArrayProperty or JSON or IO[bytes] - :return: NewlineDelimitedEnumArrayProperty. The NewlineDelimitedEnumArrayProperty is compatible - with MutableMapping - :rtype: ~encode.array.models.NewlineDelimitedEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models3.NewlineDelimitedEnumArrayProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_enum_newline_delimited_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models3.NewlineDelimitedEnumArrayProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def extensible_enum_comma_delimited( - self, - body: _models3.CommaDelimitedExtensibleEnumArrayProperty, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models3.CommaDelimitedExtensibleEnumArrayProperty: - """extensible_enum_comma_delimited. - - :param body: Required. - :type body: ~encode.array.models.CommaDelimitedExtensibleEnumArrayProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: CommaDelimitedExtensibleEnumArrayProperty. The - CommaDelimitedExtensibleEnumArrayProperty is compatible with MutableMapping - :rtype: ~encode.array.models.CommaDelimitedExtensibleEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def extensible_enum_comma_delimited( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.CommaDelimitedExtensibleEnumArrayProperty: - """extensible_enum_comma_delimited. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: CommaDelimitedExtensibleEnumArrayProperty. The - CommaDelimitedExtensibleEnumArrayProperty is compatible with MutableMapping - :rtype: ~encode.array.models.CommaDelimitedExtensibleEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def extensible_enum_comma_delimited( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.CommaDelimitedExtensibleEnumArrayProperty: - """extensible_enum_comma_delimited. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: CommaDelimitedExtensibleEnumArrayProperty. The - CommaDelimitedExtensibleEnumArrayProperty is compatible with MutableMapping - :rtype: ~encode.array.models.CommaDelimitedExtensibleEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def extensible_enum_comma_delimited( - self, body: Union[_models3.CommaDelimitedExtensibleEnumArrayProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models3.CommaDelimitedExtensibleEnumArrayProperty: - """extensible_enum_comma_delimited. - - :param body: Is one of the following types: CommaDelimitedExtensibleEnumArrayProperty, JSON, - IO[bytes] Required. - :type body: ~encode.array.models.CommaDelimitedExtensibleEnumArrayProperty or JSON or IO[bytes] - :return: CommaDelimitedExtensibleEnumArrayProperty. The - CommaDelimitedExtensibleEnumArrayProperty is compatible with MutableMapping - :rtype: ~encode.array.models.CommaDelimitedExtensibleEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models3.CommaDelimitedExtensibleEnumArrayProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_extensible_enum_comma_delimited_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models3.CommaDelimitedExtensibleEnumArrayProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def extensible_enum_space_delimited( - self, - body: _models3.SpaceDelimitedExtensibleEnumArrayProperty, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models3.SpaceDelimitedExtensibleEnumArrayProperty: - """extensible_enum_space_delimited. - - :param body: Required. - :type body: ~encode.array.models.SpaceDelimitedExtensibleEnumArrayProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: SpaceDelimitedExtensibleEnumArrayProperty. The - SpaceDelimitedExtensibleEnumArrayProperty is compatible with MutableMapping - :rtype: ~encode.array.models.SpaceDelimitedExtensibleEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def extensible_enum_space_delimited( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.SpaceDelimitedExtensibleEnumArrayProperty: - """extensible_enum_space_delimited. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: SpaceDelimitedExtensibleEnumArrayProperty. The - SpaceDelimitedExtensibleEnumArrayProperty is compatible with MutableMapping - :rtype: ~encode.array.models.SpaceDelimitedExtensibleEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def extensible_enum_space_delimited( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.SpaceDelimitedExtensibleEnumArrayProperty: - """extensible_enum_space_delimited. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: SpaceDelimitedExtensibleEnumArrayProperty. The - SpaceDelimitedExtensibleEnumArrayProperty is compatible with MutableMapping - :rtype: ~encode.array.models.SpaceDelimitedExtensibleEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def extensible_enum_space_delimited( - self, body: Union[_models3.SpaceDelimitedExtensibleEnumArrayProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models3.SpaceDelimitedExtensibleEnumArrayProperty: - """extensible_enum_space_delimited. - - :param body: Is one of the following types: SpaceDelimitedExtensibleEnumArrayProperty, JSON, - IO[bytes] Required. - :type body: ~encode.array.models.SpaceDelimitedExtensibleEnumArrayProperty or JSON or IO[bytes] - :return: SpaceDelimitedExtensibleEnumArrayProperty. The - SpaceDelimitedExtensibleEnumArrayProperty is compatible with MutableMapping - :rtype: ~encode.array.models.SpaceDelimitedExtensibleEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models3.SpaceDelimitedExtensibleEnumArrayProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_extensible_enum_space_delimited_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models3.SpaceDelimitedExtensibleEnumArrayProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def extensible_enum_pipe_delimited( - self, - body: _models3.PipeDelimitedExtensibleEnumArrayProperty, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models3.PipeDelimitedExtensibleEnumArrayProperty: - """extensible_enum_pipe_delimited. - - :param body: Required. - :type body: ~encode.array.models.PipeDelimitedExtensibleEnumArrayProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PipeDelimitedExtensibleEnumArrayProperty. The PipeDelimitedExtensibleEnumArrayProperty - is compatible with MutableMapping - :rtype: ~encode.array.models.PipeDelimitedExtensibleEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def extensible_enum_pipe_delimited( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.PipeDelimitedExtensibleEnumArrayProperty: - """extensible_enum_pipe_delimited. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PipeDelimitedExtensibleEnumArrayProperty. The PipeDelimitedExtensibleEnumArrayProperty - is compatible with MutableMapping - :rtype: ~encode.array.models.PipeDelimitedExtensibleEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def extensible_enum_pipe_delimited( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.PipeDelimitedExtensibleEnumArrayProperty: - """extensible_enum_pipe_delimited. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: PipeDelimitedExtensibleEnumArrayProperty. The PipeDelimitedExtensibleEnumArrayProperty - is compatible with MutableMapping - :rtype: ~encode.array.models.PipeDelimitedExtensibleEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def extensible_enum_pipe_delimited( - self, body: Union[_models3.PipeDelimitedExtensibleEnumArrayProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models3.PipeDelimitedExtensibleEnumArrayProperty: - """extensible_enum_pipe_delimited. - - :param body: Is one of the following types: PipeDelimitedExtensibleEnumArrayProperty, JSON, - IO[bytes] Required. - :type body: ~encode.array.models.PipeDelimitedExtensibleEnumArrayProperty or JSON or IO[bytes] - :return: PipeDelimitedExtensibleEnumArrayProperty. The PipeDelimitedExtensibleEnumArrayProperty - is compatible with MutableMapping - :rtype: ~encode.array.models.PipeDelimitedExtensibleEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models3.PipeDelimitedExtensibleEnumArrayProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_extensible_enum_pipe_delimited_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models3.PipeDelimitedExtensibleEnumArrayProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def extensible_enum_newline_delimited( - self, - body: _models3.NewlineDelimitedExtensibleEnumArrayProperty, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models3.NewlineDelimitedExtensibleEnumArrayProperty: - """extensible_enum_newline_delimited. - - :param body: Required. - :type body: ~encode.array.models.NewlineDelimitedExtensibleEnumArrayProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: NewlineDelimitedExtensibleEnumArrayProperty. The - NewlineDelimitedExtensibleEnumArrayProperty is compatible with MutableMapping - :rtype: ~encode.array.models.NewlineDelimitedExtensibleEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def extensible_enum_newline_delimited( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.NewlineDelimitedExtensibleEnumArrayProperty: - """extensible_enum_newline_delimited. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: NewlineDelimitedExtensibleEnumArrayProperty. The - NewlineDelimitedExtensibleEnumArrayProperty is compatible with MutableMapping - :rtype: ~encode.array.models.NewlineDelimitedExtensibleEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def extensible_enum_newline_delimited( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.NewlineDelimitedExtensibleEnumArrayProperty: - """extensible_enum_newline_delimited. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: NewlineDelimitedExtensibleEnumArrayProperty. The - NewlineDelimitedExtensibleEnumArrayProperty is compatible with MutableMapping - :rtype: ~encode.array.models.NewlineDelimitedExtensibleEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def extensible_enum_newline_delimited( - self, body: Union[_models3.NewlineDelimitedExtensibleEnumArrayProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models3.NewlineDelimitedExtensibleEnumArrayProperty: - """extensible_enum_newline_delimited. - - :param body: Is one of the following types: NewlineDelimitedExtensibleEnumArrayProperty, JSON, - IO[bytes] Required. - :type body: ~encode.array.models.NewlineDelimitedExtensibleEnumArrayProperty or JSON or - IO[bytes] - :return: NewlineDelimitedExtensibleEnumArrayProperty. The - NewlineDelimitedExtensibleEnumArrayProperty is compatible with MutableMapping - :rtype: ~encode.array.models.NewlineDelimitedExtensibleEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models3.NewlineDelimitedExtensibleEnumArrayProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_extensible_enum_newline_delimited_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models3.NewlineDelimitedExtensibleEnumArrayProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-array/encode/array/property/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-array/encode/array/property/operations/_operations.py index b3d7b4d15f..24f598556d 100644 --- a/packages/typespec-python/test/azure/generated/encode-array/encode/array/property/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/encode-array/encode/array/property/operations/_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -108,150 +107,6 @@ def build_property_newline_delimited_request(**kwargs: Any) -> HttpRequest: return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) -def build_property_enum_comma_delimited_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/encode/array/property/enum/comma-delimited" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_property_enum_space_delimited_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/encode/array/property/enum/space-delimited" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_property_enum_pipe_delimited_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/encode/array/property/enum/pipe-delimited" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_property_enum_newline_delimited_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/encode/array/property/enum/newline-delimited" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_property_extensible_enum_comma_delimited_request( # pylint: disable=name-too-long - **kwargs: Any, -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/encode/array/property/extensible-enum/comma-delimited" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_property_extensible_enum_space_delimited_request( # pylint: disable=name-too-long - **kwargs: Any, -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/encode/array/property/extensible-enum/space-delimited" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_property_extensible_enum_pipe_delimited_request( # pylint: disable=name-too-long - **kwargs: Any, -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/encode/array/property/extensible-enum/pipe-delimited" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_property_extensible_enum_newline_delimited_request( # pylint: disable=name-too-long - **kwargs: Any, -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/encode/array/property/extensible-enum/newline-delimited" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - class PropertyOperations: """ .. warning:: @@ -760,1004 +615,3 @@ def newline_delimited( return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - - @overload - def enum_comma_delimited( - self, body: _models2.CommaDelimitedEnumArrayProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.CommaDelimitedEnumArrayProperty: - """enum_comma_delimited. - - :param body: Required. - :type body: ~encode.array.models.CommaDelimitedEnumArrayProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: CommaDelimitedEnumArrayProperty. The CommaDelimitedEnumArrayProperty is compatible - with MutableMapping - :rtype: ~encode.array.models.CommaDelimitedEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def enum_comma_delimited( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.CommaDelimitedEnumArrayProperty: - """enum_comma_delimited. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: CommaDelimitedEnumArrayProperty. The CommaDelimitedEnumArrayProperty is compatible - with MutableMapping - :rtype: ~encode.array.models.CommaDelimitedEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def enum_comma_delimited( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.CommaDelimitedEnumArrayProperty: - """enum_comma_delimited. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: CommaDelimitedEnumArrayProperty. The CommaDelimitedEnumArrayProperty is compatible - with MutableMapping - :rtype: ~encode.array.models.CommaDelimitedEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def enum_comma_delimited( - self, body: Union[_models2.CommaDelimitedEnumArrayProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models2.CommaDelimitedEnumArrayProperty: - """enum_comma_delimited. - - :param body: Is one of the following types: CommaDelimitedEnumArrayProperty, JSON, IO[bytes] - Required. - :type body: ~encode.array.models.CommaDelimitedEnumArrayProperty or JSON or IO[bytes] - :return: CommaDelimitedEnumArrayProperty. The CommaDelimitedEnumArrayProperty is compatible - with MutableMapping - :rtype: ~encode.array.models.CommaDelimitedEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.CommaDelimitedEnumArrayProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_enum_comma_delimited_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models2.CommaDelimitedEnumArrayProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def enum_space_delimited( - self, body: _models2.SpaceDelimitedEnumArrayProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.SpaceDelimitedEnumArrayProperty: - """enum_space_delimited. - - :param body: Required. - :type body: ~encode.array.models.SpaceDelimitedEnumArrayProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: SpaceDelimitedEnumArrayProperty. The SpaceDelimitedEnumArrayProperty is compatible - with MutableMapping - :rtype: ~encode.array.models.SpaceDelimitedEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def enum_space_delimited( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.SpaceDelimitedEnumArrayProperty: - """enum_space_delimited. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: SpaceDelimitedEnumArrayProperty. The SpaceDelimitedEnumArrayProperty is compatible - with MutableMapping - :rtype: ~encode.array.models.SpaceDelimitedEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def enum_space_delimited( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.SpaceDelimitedEnumArrayProperty: - """enum_space_delimited. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: SpaceDelimitedEnumArrayProperty. The SpaceDelimitedEnumArrayProperty is compatible - with MutableMapping - :rtype: ~encode.array.models.SpaceDelimitedEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def enum_space_delimited( - self, body: Union[_models2.SpaceDelimitedEnumArrayProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models2.SpaceDelimitedEnumArrayProperty: - """enum_space_delimited. - - :param body: Is one of the following types: SpaceDelimitedEnumArrayProperty, JSON, IO[bytes] - Required. - :type body: ~encode.array.models.SpaceDelimitedEnumArrayProperty or JSON or IO[bytes] - :return: SpaceDelimitedEnumArrayProperty. The SpaceDelimitedEnumArrayProperty is compatible - with MutableMapping - :rtype: ~encode.array.models.SpaceDelimitedEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.SpaceDelimitedEnumArrayProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_enum_space_delimited_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models2.SpaceDelimitedEnumArrayProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def enum_pipe_delimited( - self, body: _models2.PipeDelimitedEnumArrayProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.PipeDelimitedEnumArrayProperty: - """enum_pipe_delimited. - - :param body: Required. - :type body: ~encode.array.models.PipeDelimitedEnumArrayProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PipeDelimitedEnumArrayProperty. The PipeDelimitedEnumArrayProperty is compatible with - MutableMapping - :rtype: ~encode.array.models.PipeDelimitedEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def enum_pipe_delimited( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.PipeDelimitedEnumArrayProperty: - """enum_pipe_delimited. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PipeDelimitedEnumArrayProperty. The PipeDelimitedEnumArrayProperty is compatible with - MutableMapping - :rtype: ~encode.array.models.PipeDelimitedEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def enum_pipe_delimited( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.PipeDelimitedEnumArrayProperty: - """enum_pipe_delimited. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: PipeDelimitedEnumArrayProperty. The PipeDelimitedEnumArrayProperty is compatible with - MutableMapping - :rtype: ~encode.array.models.PipeDelimitedEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def enum_pipe_delimited( - self, body: Union[_models2.PipeDelimitedEnumArrayProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models2.PipeDelimitedEnumArrayProperty: - """enum_pipe_delimited. - - :param body: Is one of the following types: PipeDelimitedEnumArrayProperty, JSON, IO[bytes] - Required. - :type body: ~encode.array.models.PipeDelimitedEnumArrayProperty or JSON or IO[bytes] - :return: PipeDelimitedEnumArrayProperty. The PipeDelimitedEnumArrayProperty is compatible with - MutableMapping - :rtype: ~encode.array.models.PipeDelimitedEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.PipeDelimitedEnumArrayProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_enum_pipe_delimited_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models2.PipeDelimitedEnumArrayProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def enum_newline_delimited( - self, body: _models2.NewlineDelimitedEnumArrayProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.NewlineDelimitedEnumArrayProperty: - """enum_newline_delimited. - - :param body: Required. - :type body: ~encode.array.models.NewlineDelimitedEnumArrayProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: NewlineDelimitedEnumArrayProperty. The NewlineDelimitedEnumArrayProperty is compatible - with MutableMapping - :rtype: ~encode.array.models.NewlineDelimitedEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def enum_newline_delimited( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.NewlineDelimitedEnumArrayProperty: - """enum_newline_delimited. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: NewlineDelimitedEnumArrayProperty. The NewlineDelimitedEnumArrayProperty is compatible - with MutableMapping - :rtype: ~encode.array.models.NewlineDelimitedEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def enum_newline_delimited( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.NewlineDelimitedEnumArrayProperty: - """enum_newline_delimited. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: NewlineDelimitedEnumArrayProperty. The NewlineDelimitedEnumArrayProperty is compatible - with MutableMapping - :rtype: ~encode.array.models.NewlineDelimitedEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def enum_newline_delimited( - self, body: Union[_models2.NewlineDelimitedEnumArrayProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models2.NewlineDelimitedEnumArrayProperty: - """enum_newline_delimited. - - :param body: Is one of the following types: NewlineDelimitedEnumArrayProperty, JSON, IO[bytes] - Required. - :type body: ~encode.array.models.NewlineDelimitedEnumArrayProperty or JSON or IO[bytes] - :return: NewlineDelimitedEnumArrayProperty. The NewlineDelimitedEnumArrayProperty is compatible - with MutableMapping - :rtype: ~encode.array.models.NewlineDelimitedEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.NewlineDelimitedEnumArrayProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_enum_newline_delimited_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models2.NewlineDelimitedEnumArrayProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def extensible_enum_comma_delimited( - self, - body: _models2.CommaDelimitedExtensibleEnumArrayProperty, - *, - content_type: str = "application/json", - **kwargs: Any, - ) -> _models2.CommaDelimitedExtensibleEnumArrayProperty: - """extensible_enum_comma_delimited. - - :param body: Required. - :type body: ~encode.array.models.CommaDelimitedExtensibleEnumArrayProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: CommaDelimitedExtensibleEnumArrayProperty. The - CommaDelimitedExtensibleEnumArrayProperty is compatible with MutableMapping - :rtype: ~encode.array.models.CommaDelimitedExtensibleEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def extensible_enum_comma_delimited( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.CommaDelimitedExtensibleEnumArrayProperty: - """extensible_enum_comma_delimited. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: CommaDelimitedExtensibleEnumArrayProperty. The - CommaDelimitedExtensibleEnumArrayProperty is compatible with MutableMapping - :rtype: ~encode.array.models.CommaDelimitedExtensibleEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def extensible_enum_comma_delimited( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.CommaDelimitedExtensibleEnumArrayProperty: - """extensible_enum_comma_delimited. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: CommaDelimitedExtensibleEnumArrayProperty. The - CommaDelimitedExtensibleEnumArrayProperty is compatible with MutableMapping - :rtype: ~encode.array.models.CommaDelimitedExtensibleEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def extensible_enum_comma_delimited( - self, body: Union[_models2.CommaDelimitedExtensibleEnumArrayProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models2.CommaDelimitedExtensibleEnumArrayProperty: - """extensible_enum_comma_delimited. - - :param body: Is one of the following types: CommaDelimitedExtensibleEnumArrayProperty, JSON, - IO[bytes] Required. - :type body: ~encode.array.models.CommaDelimitedExtensibleEnumArrayProperty or JSON or IO[bytes] - :return: CommaDelimitedExtensibleEnumArrayProperty. The - CommaDelimitedExtensibleEnumArrayProperty is compatible with MutableMapping - :rtype: ~encode.array.models.CommaDelimitedExtensibleEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.CommaDelimitedExtensibleEnumArrayProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_extensible_enum_comma_delimited_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models2.CommaDelimitedExtensibleEnumArrayProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def extensible_enum_space_delimited( - self, - body: _models2.SpaceDelimitedExtensibleEnumArrayProperty, - *, - content_type: str = "application/json", - **kwargs: Any, - ) -> _models2.SpaceDelimitedExtensibleEnumArrayProperty: - """extensible_enum_space_delimited. - - :param body: Required. - :type body: ~encode.array.models.SpaceDelimitedExtensibleEnumArrayProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: SpaceDelimitedExtensibleEnumArrayProperty. The - SpaceDelimitedExtensibleEnumArrayProperty is compatible with MutableMapping - :rtype: ~encode.array.models.SpaceDelimitedExtensibleEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def extensible_enum_space_delimited( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.SpaceDelimitedExtensibleEnumArrayProperty: - """extensible_enum_space_delimited. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: SpaceDelimitedExtensibleEnumArrayProperty. The - SpaceDelimitedExtensibleEnumArrayProperty is compatible with MutableMapping - :rtype: ~encode.array.models.SpaceDelimitedExtensibleEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def extensible_enum_space_delimited( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.SpaceDelimitedExtensibleEnumArrayProperty: - """extensible_enum_space_delimited. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: SpaceDelimitedExtensibleEnumArrayProperty. The - SpaceDelimitedExtensibleEnumArrayProperty is compatible with MutableMapping - :rtype: ~encode.array.models.SpaceDelimitedExtensibleEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def extensible_enum_space_delimited( - self, body: Union[_models2.SpaceDelimitedExtensibleEnumArrayProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models2.SpaceDelimitedExtensibleEnumArrayProperty: - """extensible_enum_space_delimited. - - :param body: Is one of the following types: SpaceDelimitedExtensibleEnumArrayProperty, JSON, - IO[bytes] Required. - :type body: ~encode.array.models.SpaceDelimitedExtensibleEnumArrayProperty or JSON or IO[bytes] - :return: SpaceDelimitedExtensibleEnumArrayProperty. The - SpaceDelimitedExtensibleEnumArrayProperty is compatible with MutableMapping - :rtype: ~encode.array.models.SpaceDelimitedExtensibleEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.SpaceDelimitedExtensibleEnumArrayProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_extensible_enum_space_delimited_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models2.SpaceDelimitedExtensibleEnumArrayProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def extensible_enum_pipe_delimited( - self, - body: _models2.PipeDelimitedExtensibleEnumArrayProperty, - *, - content_type: str = "application/json", - **kwargs: Any, - ) -> _models2.PipeDelimitedExtensibleEnumArrayProperty: - """extensible_enum_pipe_delimited. - - :param body: Required. - :type body: ~encode.array.models.PipeDelimitedExtensibleEnumArrayProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PipeDelimitedExtensibleEnumArrayProperty. The PipeDelimitedExtensibleEnumArrayProperty - is compatible with MutableMapping - :rtype: ~encode.array.models.PipeDelimitedExtensibleEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def extensible_enum_pipe_delimited( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.PipeDelimitedExtensibleEnumArrayProperty: - """extensible_enum_pipe_delimited. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PipeDelimitedExtensibleEnumArrayProperty. The PipeDelimitedExtensibleEnumArrayProperty - is compatible with MutableMapping - :rtype: ~encode.array.models.PipeDelimitedExtensibleEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def extensible_enum_pipe_delimited( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.PipeDelimitedExtensibleEnumArrayProperty: - """extensible_enum_pipe_delimited. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: PipeDelimitedExtensibleEnumArrayProperty. The PipeDelimitedExtensibleEnumArrayProperty - is compatible with MutableMapping - :rtype: ~encode.array.models.PipeDelimitedExtensibleEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def extensible_enum_pipe_delimited( - self, body: Union[_models2.PipeDelimitedExtensibleEnumArrayProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models2.PipeDelimitedExtensibleEnumArrayProperty: - """extensible_enum_pipe_delimited. - - :param body: Is one of the following types: PipeDelimitedExtensibleEnumArrayProperty, JSON, - IO[bytes] Required. - :type body: ~encode.array.models.PipeDelimitedExtensibleEnumArrayProperty or JSON or IO[bytes] - :return: PipeDelimitedExtensibleEnumArrayProperty. The PipeDelimitedExtensibleEnumArrayProperty - is compatible with MutableMapping - :rtype: ~encode.array.models.PipeDelimitedExtensibleEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.PipeDelimitedExtensibleEnumArrayProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_extensible_enum_pipe_delimited_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models2.PipeDelimitedExtensibleEnumArrayProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def extensible_enum_newline_delimited( - self, - body: _models2.NewlineDelimitedExtensibleEnumArrayProperty, - *, - content_type: str = "application/json", - **kwargs: Any, - ) -> _models2.NewlineDelimitedExtensibleEnumArrayProperty: - """extensible_enum_newline_delimited. - - :param body: Required. - :type body: ~encode.array.models.NewlineDelimitedExtensibleEnumArrayProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: NewlineDelimitedExtensibleEnumArrayProperty. The - NewlineDelimitedExtensibleEnumArrayProperty is compatible with MutableMapping - :rtype: ~encode.array.models.NewlineDelimitedExtensibleEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def extensible_enum_newline_delimited( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.NewlineDelimitedExtensibleEnumArrayProperty: - """extensible_enum_newline_delimited. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: NewlineDelimitedExtensibleEnumArrayProperty. The - NewlineDelimitedExtensibleEnumArrayProperty is compatible with MutableMapping - :rtype: ~encode.array.models.NewlineDelimitedExtensibleEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def extensible_enum_newline_delimited( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.NewlineDelimitedExtensibleEnumArrayProperty: - """extensible_enum_newline_delimited. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: NewlineDelimitedExtensibleEnumArrayProperty. The - NewlineDelimitedExtensibleEnumArrayProperty is compatible with MutableMapping - :rtype: ~encode.array.models.NewlineDelimitedExtensibleEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def extensible_enum_newline_delimited( - self, body: Union[_models2.NewlineDelimitedExtensibleEnumArrayProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models2.NewlineDelimitedExtensibleEnumArrayProperty: - """extensible_enum_newline_delimited. - - :param body: Is one of the following types: NewlineDelimitedExtensibleEnumArrayProperty, JSON, - IO[bytes] Required. - :type body: ~encode.array.models.NewlineDelimitedExtensibleEnumArrayProperty or JSON or - IO[bytes] - :return: NewlineDelimitedExtensibleEnumArrayProperty. The - NewlineDelimitedExtensibleEnumArrayProperty is compatible with MutableMapping - :rtype: ~encode.array.models.NewlineDelimitedExtensibleEnumArrayProperty - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.NewlineDelimitedExtensibleEnumArrayProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_extensible_enum_newline_delimited_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models2.NewlineDelimitedExtensibleEnumArrayProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-array/generated_tests/test_array_property_operations.py b/packages/typespec-python/test/azure/generated/encode-array/generated_tests/test_array_property_operations.py index 2b2d38ef7c..8ecfb80e30 100644 --- a/packages/typespec-python/test/azure/generated/encode-array/generated_tests/test_array_property_operations.py +++ b/packages/typespec-python/test/azure/generated/encode-array/generated_tests/test_array_property_operations.py @@ -55,91 +55,3 @@ def test_property_newline_delimited(self, array_endpoint): # please add some check logic here by yourself # ... - - @ArrayPreparer() - @recorded_by_proxy - def test_property_enum_comma_delimited(self, array_endpoint): - client = self.create_client(endpoint=array_endpoint) - response = client.property.enum_comma_delimited( - body={"value": ["str"]}, - ) - - # please add some check logic here by yourself - # ... - - @ArrayPreparer() - @recorded_by_proxy - def test_property_enum_space_delimited(self, array_endpoint): - client = self.create_client(endpoint=array_endpoint) - response = client.property.enum_space_delimited( - body={"value": ["str"]}, - ) - - # please add some check logic here by yourself - # ... - - @ArrayPreparer() - @recorded_by_proxy - def test_property_enum_pipe_delimited(self, array_endpoint): - client = self.create_client(endpoint=array_endpoint) - response = client.property.enum_pipe_delimited( - body={"value": ["str"]}, - ) - - # please add some check logic here by yourself - # ... - - @ArrayPreparer() - @recorded_by_proxy - def test_property_enum_newline_delimited(self, array_endpoint): - client = self.create_client(endpoint=array_endpoint) - response = client.property.enum_newline_delimited( - body={"value": ["str"]}, - ) - - # please add some check logic here by yourself - # ... - - @ArrayPreparer() - @recorded_by_proxy - def test_property_extensible_enum_comma_delimited(self, array_endpoint): - client = self.create_client(endpoint=array_endpoint) - response = client.property.extensible_enum_comma_delimited( - body={"value": ["str"]}, - ) - - # please add some check logic here by yourself - # ... - - @ArrayPreparer() - @recorded_by_proxy - def test_property_extensible_enum_space_delimited(self, array_endpoint): - client = self.create_client(endpoint=array_endpoint) - response = client.property.extensible_enum_space_delimited( - body={"value": ["str"]}, - ) - - # please add some check logic here by yourself - # ... - - @ArrayPreparer() - @recorded_by_proxy - def test_property_extensible_enum_pipe_delimited(self, array_endpoint): - client = self.create_client(endpoint=array_endpoint) - response = client.property.extensible_enum_pipe_delimited( - body={"value": ["str"]}, - ) - - # please add some check logic here by yourself - # ... - - @ArrayPreparer() - @recorded_by_proxy - def test_property_extensible_enum_newline_delimited(self, array_endpoint): - client = self.create_client(endpoint=array_endpoint) - response = client.property.extensible_enum_newline_delimited( - body={"value": ["str"]}, - ) - - # please add some check logic here by yourself - # ... diff --git a/packages/typespec-python/test/azure/generated/encode-array/generated_tests/test_array_property_operations_async.py b/packages/typespec-python/test/azure/generated/encode-array/generated_tests/test_array_property_operations_async.py index 65b88703fb..1403a61d90 100644 --- a/packages/typespec-python/test/azure/generated/encode-array/generated_tests/test_array_property_operations_async.py +++ b/packages/typespec-python/test/azure/generated/encode-array/generated_tests/test_array_property_operations_async.py @@ -56,91 +56,3 @@ async def test_property_newline_delimited(self, array_endpoint): # please add some check logic here by yourself # ... - - @ArrayPreparer() - @recorded_by_proxy_async - async def test_property_enum_comma_delimited(self, array_endpoint): - client = self.create_async_client(endpoint=array_endpoint) - response = await client.property.enum_comma_delimited( - body={"value": ["str"]}, - ) - - # please add some check logic here by yourself - # ... - - @ArrayPreparer() - @recorded_by_proxy_async - async def test_property_enum_space_delimited(self, array_endpoint): - client = self.create_async_client(endpoint=array_endpoint) - response = await client.property.enum_space_delimited( - body={"value": ["str"]}, - ) - - # please add some check logic here by yourself - # ... - - @ArrayPreparer() - @recorded_by_proxy_async - async def test_property_enum_pipe_delimited(self, array_endpoint): - client = self.create_async_client(endpoint=array_endpoint) - response = await client.property.enum_pipe_delimited( - body={"value": ["str"]}, - ) - - # please add some check logic here by yourself - # ... - - @ArrayPreparer() - @recorded_by_proxy_async - async def test_property_enum_newline_delimited(self, array_endpoint): - client = self.create_async_client(endpoint=array_endpoint) - response = await client.property.enum_newline_delimited( - body={"value": ["str"]}, - ) - - # please add some check logic here by yourself - # ... - - @ArrayPreparer() - @recorded_by_proxy_async - async def test_property_extensible_enum_comma_delimited(self, array_endpoint): - client = self.create_async_client(endpoint=array_endpoint) - response = await client.property.extensible_enum_comma_delimited( - body={"value": ["str"]}, - ) - - # please add some check logic here by yourself - # ... - - @ArrayPreparer() - @recorded_by_proxy_async - async def test_property_extensible_enum_space_delimited(self, array_endpoint): - client = self.create_async_client(endpoint=array_endpoint) - response = await client.property.extensible_enum_space_delimited( - body={"value": ["str"]}, - ) - - # please add some check logic here by yourself - # ... - - @ArrayPreparer() - @recorded_by_proxy_async - async def test_property_extensible_enum_pipe_delimited(self, array_endpoint): - client = self.create_async_client(endpoint=array_endpoint) - response = await client.property.extensible_enum_pipe_delimited( - body={"value": ["str"]}, - ) - - # please add some check logic here by yourself - # ... - - @ArrayPreparer() - @recorded_by_proxy_async - async def test_property_extensible_enum_newline_delimited(self, array_endpoint): - client = self.create_async_client(endpoint=array_endpoint) - response = await client.property.extensible_enum_newline_delimited( - body={"value": ["str"]}, - ) - - # please add some check logic here by yourself - # ... diff --git a/packages/typespec-python/test/unbranded/generated/encode-array/encode/array/models/__init__.py b/packages/typespec-python/test/unbranded/generated/encode-array/encode/array/models/__init__.py index d7b6e952c1..7860cbbc04 100644 --- a/packages/typespec-python/test/unbranded/generated/encode-array/encode/array/models/__init__.py +++ b/packages/typespec-python/test/unbranded/generated/encode-array/encode/array/models/__init__.py @@ -9,22 +9,9 @@ from ._models import ( # type: ignore CommaDelimitedArrayProperty, - CommaDelimitedEnumArrayProperty, - CommaDelimitedExtensibleEnumArrayProperty, NewlineDelimitedArrayProperty, - NewlineDelimitedEnumArrayProperty, - NewlineDelimitedExtensibleEnumArrayProperty, PipeDelimitedArrayProperty, - PipeDelimitedEnumArrayProperty, - PipeDelimitedExtensibleEnumArrayProperty, SpaceDelimitedArrayProperty, - SpaceDelimitedEnumArrayProperty, - SpaceDelimitedExtensibleEnumArrayProperty, -) - -from ._enums import ( # type: ignore - Colors, - ColorsExtensibleEnum, ) from ._patch import __all__ as _patch_all from ._patch import * @@ -32,19 +19,9 @@ __all__ = [ "CommaDelimitedArrayProperty", - "CommaDelimitedEnumArrayProperty", - "CommaDelimitedExtensibleEnumArrayProperty", "NewlineDelimitedArrayProperty", - "NewlineDelimitedEnumArrayProperty", - "NewlineDelimitedExtensibleEnumArrayProperty", "PipeDelimitedArrayProperty", - "PipeDelimitedEnumArrayProperty", - "PipeDelimitedExtensibleEnumArrayProperty", "SpaceDelimitedArrayProperty", - "SpaceDelimitedEnumArrayProperty", - "SpaceDelimitedExtensibleEnumArrayProperty", - "Colors", - "ColorsExtensibleEnum", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/packages/typespec-python/test/unbranded/generated/encode-array/encode/array/models/_models.py b/packages/typespec-python/test/unbranded/generated/encode-array/encode/array/models/_models.py index 4d81add6e7..b0e0120452 100644 --- a/packages/typespec-python/test/unbranded/generated/encode-array/encode/array/models/_models.py +++ b/packages/typespec-python/test/unbranded/generated/encode-array/encode/array/models/_models.py @@ -1,13 +1,10 @@ # coding=utf-8 # pylint: disable=useless-super-delegation -from typing import Any, Mapping, TYPE_CHECKING, Union, overload +from typing import Any, Mapping, overload from .._utils.model_base import Model as _Model, rest_field -if TYPE_CHECKING: - from .. import models as _models - class CommaDelimitedArrayProperty(_Model): """CommaDelimitedArrayProperty. @@ -37,66 +34,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CommaDelimitedEnumArrayProperty(_Model): - """CommaDelimitedEnumArrayProperty. - - :ivar value: Required. - :vartype value: list[str or ~encode.array.models.Colors] - """ - - value: list[Union[str, "_models.Colors"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="commaDelimited" - ) - """Required.""" - - @overload - def __init__( - self, - *, - value: list[Union[str, "_models.Colors"]], - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class CommaDelimitedExtensibleEnumArrayProperty(_Model): # pylint: disable=name-too-long - """CommaDelimitedExtensibleEnumArrayProperty. - - :ivar value: Required. - :vartype value: list[str or ~encode.array.models.ColorsExtensibleEnum] - """ - - value: list[Union[str, "_models.ColorsExtensibleEnum"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="commaDelimited" - ) - """Required.""" - - @overload - def __init__( - self, - *, - value: list[Union[str, "_models.ColorsExtensibleEnum"]], - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - class NewlineDelimitedArrayProperty(_Model): """NewlineDelimitedArrayProperty. @@ -125,66 +62,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class NewlineDelimitedEnumArrayProperty(_Model): - """NewlineDelimitedEnumArrayProperty. - - :ivar value: Required. - :vartype value: list[str or ~encode.array.models.Colors] - """ - - value: list[Union[str, "_models.Colors"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="newlineDelimited" - ) - """Required.""" - - @overload - def __init__( - self, - *, - value: list[Union[str, "_models.Colors"]], - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class NewlineDelimitedExtensibleEnumArrayProperty(_Model): # pylint: disable=name-too-long - """NewlineDelimitedExtensibleEnumArrayProperty. - - :ivar value: Required. - :vartype value: list[str or ~encode.array.models.ColorsExtensibleEnum] - """ - - value: list[Union[str, "_models.ColorsExtensibleEnum"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="newlineDelimited" - ) - """Required.""" - - @overload - def __init__( - self, - *, - value: list[Union[str, "_models.ColorsExtensibleEnum"]], - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - class PipeDelimitedArrayProperty(_Model): """PipeDelimitedArrayProperty. @@ -213,66 +90,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PipeDelimitedEnumArrayProperty(_Model): - """PipeDelimitedEnumArrayProperty. - - :ivar value: Required. - :vartype value: list[str or ~encode.array.models.Colors] - """ - - value: list[Union[str, "_models.Colors"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="pipeDelimited" - ) - """Required.""" - - @overload - def __init__( - self, - *, - value: list[Union[str, "_models.Colors"]], - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class PipeDelimitedExtensibleEnumArrayProperty(_Model): - """PipeDelimitedExtensibleEnumArrayProperty. - - :ivar value: Required. - :vartype value: list[str or ~encode.array.models.ColorsExtensibleEnum] - """ - - value: list[Union[str, "_models.ColorsExtensibleEnum"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="pipeDelimited" - ) - """Required.""" - - @overload - def __init__( - self, - *, - value: list[Union[str, "_models.ColorsExtensibleEnum"]], - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - class SpaceDelimitedArrayProperty(_Model): """SpaceDelimitedArrayProperty. @@ -299,63 +116,3 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - - -class SpaceDelimitedEnumArrayProperty(_Model): - """SpaceDelimitedEnumArrayProperty. - - :ivar value: Required. - :vartype value: list[str or ~encode.array.models.Colors] - """ - - value: list[Union[str, "_models.Colors"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="spaceDelimited" - ) - """Required.""" - - @overload - def __init__( - self, - *, - value: list[Union[str, "_models.Colors"]], - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class SpaceDelimitedExtensibleEnumArrayProperty(_Model): # pylint: disable=name-too-long - """SpaceDelimitedExtensibleEnumArrayProperty. - - :ivar value: Required. - :vartype value: list[str or ~encode.array.models.ColorsExtensibleEnum] - """ - - value: list[Union[str, "_models.ColorsExtensibleEnum"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="spaceDelimited" - ) - """Required.""" - - @overload - def __init__( - self, - *, - value: list[Union[str, "_models.ColorsExtensibleEnum"]], - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) diff --git a/packages/typespec-python/test/unbranded/generated/encode-array/encode/array/property/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/encode-array/encode/array/property/aio/operations/_operations.py index b6f6641874..68ed187b8c 100644 --- a/packages/typespec-python/test/unbranded/generated/encode-array/encode/array/property/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/encode-array/encode/array/property/aio/operations/_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines # coding=utf-8 from collections.abc import MutableMapping from io import IOBase @@ -26,14 +25,6 @@ from ....aio._configuration import ArrayClientConfiguration from ...operations._operations import ( build_property_comma_delimited_request, - build_property_enum_comma_delimited_request, - build_property_enum_newline_delimited_request, - build_property_enum_pipe_delimited_request, - build_property_enum_space_delimited_request, - build_property_extensible_enum_comma_delimited_request, - build_property_extensible_enum_newline_delimited_request, - build_property_extensible_enum_pipe_delimited_request, - build_property_extensible_enum_space_delimited_request, build_property_newline_delimited_request, build_property_pipe_delimited_request, build_property_space_delimited_request, @@ -540,980 +531,3 @@ async def newline_delimited( return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - - @overload - async def enum_comma_delimited( - self, body: _models3.CommaDelimitedEnumArrayProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.CommaDelimitedEnumArrayProperty: - """enum_comma_delimited. - - :param body: Required. - :type body: ~encode.array.models.CommaDelimitedEnumArrayProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: CommaDelimitedEnumArrayProperty. The CommaDelimitedEnumArrayProperty is compatible - with MutableMapping - :rtype: ~encode.array.models.CommaDelimitedEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - - @overload - async def enum_comma_delimited( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.CommaDelimitedEnumArrayProperty: - """enum_comma_delimited. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: CommaDelimitedEnumArrayProperty. The CommaDelimitedEnumArrayProperty is compatible - with MutableMapping - :rtype: ~encode.array.models.CommaDelimitedEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - - @overload - async def enum_comma_delimited( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.CommaDelimitedEnumArrayProperty: - """enum_comma_delimited. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: CommaDelimitedEnumArrayProperty. The CommaDelimitedEnumArrayProperty is compatible - with MutableMapping - :rtype: ~encode.array.models.CommaDelimitedEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - - async def enum_comma_delimited( - self, body: Union[_models3.CommaDelimitedEnumArrayProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models3.CommaDelimitedEnumArrayProperty: - """enum_comma_delimited. - - :param body: Is one of the following types: CommaDelimitedEnumArrayProperty, JSON, IO[bytes] - Required. - :type body: ~encode.array.models.CommaDelimitedEnumArrayProperty or JSON or IO[bytes] - :return: CommaDelimitedEnumArrayProperty. The CommaDelimitedEnumArrayProperty is compatible - with MutableMapping - :rtype: ~encode.array.models.CommaDelimitedEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models3.CommaDelimitedEnumArrayProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_enum_comma_delimited_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client.pipeline.run(_request, stream=_stream, **kwargs) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models3.CommaDelimitedEnumArrayProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def enum_space_delimited( - self, body: _models3.SpaceDelimitedEnumArrayProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.SpaceDelimitedEnumArrayProperty: - """enum_space_delimited. - - :param body: Required. - :type body: ~encode.array.models.SpaceDelimitedEnumArrayProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: SpaceDelimitedEnumArrayProperty. The SpaceDelimitedEnumArrayProperty is compatible - with MutableMapping - :rtype: ~encode.array.models.SpaceDelimitedEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - - @overload - async def enum_space_delimited( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.SpaceDelimitedEnumArrayProperty: - """enum_space_delimited. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: SpaceDelimitedEnumArrayProperty. The SpaceDelimitedEnumArrayProperty is compatible - with MutableMapping - :rtype: ~encode.array.models.SpaceDelimitedEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - - @overload - async def enum_space_delimited( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.SpaceDelimitedEnumArrayProperty: - """enum_space_delimited. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: SpaceDelimitedEnumArrayProperty. The SpaceDelimitedEnumArrayProperty is compatible - with MutableMapping - :rtype: ~encode.array.models.SpaceDelimitedEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - - async def enum_space_delimited( - self, body: Union[_models3.SpaceDelimitedEnumArrayProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models3.SpaceDelimitedEnumArrayProperty: - """enum_space_delimited. - - :param body: Is one of the following types: SpaceDelimitedEnumArrayProperty, JSON, IO[bytes] - Required. - :type body: ~encode.array.models.SpaceDelimitedEnumArrayProperty or JSON or IO[bytes] - :return: SpaceDelimitedEnumArrayProperty. The SpaceDelimitedEnumArrayProperty is compatible - with MutableMapping - :rtype: ~encode.array.models.SpaceDelimitedEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models3.SpaceDelimitedEnumArrayProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_enum_space_delimited_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client.pipeline.run(_request, stream=_stream, **kwargs) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models3.SpaceDelimitedEnumArrayProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def enum_pipe_delimited( - self, body: _models3.PipeDelimitedEnumArrayProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.PipeDelimitedEnumArrayProperty: - """enum_pipe_delimited. - - :param body: Required. - :type body: ~encode.array.models.PipeDelimitedEnumArrayProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PipeDelimitedEnumArrayProperty. The PipeDelimitedEnumArrayProperty is compatible with - MutableMapping - :rtype: ~encode.array.models.PipeDelimitedEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - - @overload - async def enum_pipe_delimited( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.PipeDelimitedEnumArrayProperty: - """enum_pipe_delimited. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PipeDelimitedEnumArrayProperty. The PipeDelimitedEnumArrayProperty is compatible with - MutableMapping - :rtype: ~encode.array.models.PipeDelimitedEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - - @overload - async def enum_pipe_delimited( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.PipeDelimitedEnumArrayProperty: - """enum_pipe_delimited. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: PipeDelimitedEnumArrayProperty. The PipeDelimitedEnumArrayProperty is compatible with - MutableMapping - :rtype: ~encode.array.models.PipeDelimitedEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - - async def enum_pipe_delimited( - self, body: Union[_models3.PipeDelimitedEnumArrayProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models3.PipeDelimitedEnumArrayProperty: - """enum_pipe_delimited. - - :param body: Is one of the following types: PipeDelimitedEnumArrayProperty, JSON, IO[bytes] - Required. - :type body: ~encode.array.models.PipeDelimitedEnumArrayProperty or JSON or IO[bytes] - :return: PipeDelimitedEnumArrayProperty. The PipeDelimitedEnumArrayProperty is compatible with - MutableMapping - :rtype: ~encode.array.models.PipeDelimitedEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models3.PipeDelimitedEnumArrayProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_enum_pipe_delimited_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client.pipeline.run(_request, stream=_stream, **kwargs) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models3.PipeDelimitedEnumArrayProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def enum_newline_delimited( - self, body: _models3.NewlineDelimitedEnumArrayProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.NewlineDelimitedEnumArrayProperty: - """enum_newline_delimited. - - :param body: Required. - :type body: ~encode.array.models.NewlineDelimitedEnumArrayProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: NewlineDelimitedEnumArrayProperty. The NewlineDelimitedEnumArrayProperty is compatible - with MutableMapping - :rtype: ~encode.array.models.NewlineDelimitedEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - - @overload - async def enum_newline_delimited( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.NewlineDelimitedEnumArrayProperty: - """enum_newline_delimited. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: NewlineDelimitedEnumArrayProperty. The NewlineDelimitedEnumArrayProperty is compatible - with MutableMapping - :rtype: ~encode.array.models.NewlineDelimitedEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - - @overload - async def enum_newline_delimited( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.NewlineDelimitedEnumArrayProperty: - """enum_newline_delimited. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: NewlineDelimitedEnumArrayProperty. The NewlineDelimitedEnumArrayProperty is compatible - with MutableMapping - :rtype: ~encode.array.models.NewlineDelimitedEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - - async def enum_newline_delimited( - self, body: Union[_models3.NewlineDelimitedEnumArrayProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models3.NewlineDelimitedEnumArrayProperty: - """enum_newline_delimited. - - :param body: Is one of the following types: NewlineDelimitedEnumArrayProperty, JSON, IO[bytes] - Required. - :type body: ~encode.array.models.NewlineDelimitedEnumArrayProperty or JSON or IO[bytes] - :return: NewlineDelimitedEnumArrayProperty. The NewlineDelimitedEnumArrayProperty is compatible - with MutableMapping - :rtype: ~encode.array.models.NewlineDelimitedEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models3.NewlineDelimitedEnumArrayProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_enum_newline_delimited_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client.pipeline.run(_request, stream=_stream, **kwargs) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models3.NewlineDelimitedEnumArrayProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def extensible_enum_comma_delimited( - self, - body: _models3.CommaDelimitedExtensibleEnumArrayProperty, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models3.CommaDelimitedExtensibleEnumArrayProperty: - """extensible_enum_comma_delimited. - - :param body: Required. - :type body: ~encode.array.models.CommaDelimitedExtensibleEnumArrayProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: CommaDelimitedExtensibleEnumArrayProperty. The - CommaDelimitedExtensibleEnumArrayProperty is compatible with MutableMapping - :rtype: ~encode.array.models.CommaDelimitedExtensibleEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - - @overload - async def extensible_enum_comma_delimited( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.CommaDelimitedExtensibleEnumArrayProperty: - """extensible_enum_comma_delimited. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: CommaDelimitedExtensibleEnumArrayProperty. The - CommaDelimitedExtensibleEnumArrayProperty is compatible with MutableMapping - :rtype: ~encode.array.models.CommaDelimitedExtensibleEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - - @overload - async def extensible_enum_comma_delimited( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.CommaDelimitedExtensibleEnumArrayProperty: - """extensible_enum_comma_delimited. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: CommaDelimitedExtensibleEnumArrayProperty. The - CommaDelimitedExtensibleEnumArrayProperty is compatible with MutableMapping - :rtype: ~encode.array.models.CommaDelimitedExtensibleEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - - async def extensible_enum_comma_delimited( - self, body: Union[_models3.CommaDelimitedExtensibleEnumArrayProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models3.CommaDelimitedExtensibleEnumArrayProperty: - """extensible_enum_comma_delimited. - - :param body: Is one of the following types: CommaDelimitedExtensibleEnumArrayProperty, JSON, - IO[bytes] Required. - :type body: ~encode.array.models.CommaDelimitedExtensibleEnumArrayProperty or JSON or IO[bytes] - :return: CommaDelimitedExtensibleEnumArrayProperty. The - CommaDelimitedExtensibleEnumArrayProperty is compatible with MutableMapping - :rtype: ~encode.array.models.CommaDelimitedExtensibleEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models3.CommaDelimitedExtensibleEnumArrayProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_extensible_enum_comma_delimited_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client.pipeline.run(_request, stream=_stream, **kwargs) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models3.CommaDelimitedExtensibleEnumArrayProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def extensible_enum_space_delimited( - self, - body: _models3.SpaceDelimitedExtensibleEnumArrayProperty, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models3.SpaceDelimitedExtensibleEnumArrayProperty: - """extensible_enum_space_delimited. - - :param body: Required. - :type body: ~encode.array.models.SpaceDelimitedExtensibleEnumArrayProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: SpaceDelimitedExtensibleEnumArrayProperty. The - SpaceDelimitedExtensibleEnumArrayProperty is compatible with MutableMapping - :rtype: ~encode.array.models.SpaceDelimitedExtensibleEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - - @overload - async def extensible_enum_space_delimited( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.SpaceDelimitedExtensibleEnumArrayProperty: - """extensible_enum_space_delimited. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: SpaceDelimitedExtensibleEnumArrayProperty. The - SpaceDelimitedExtensibleEnumArrayProperty is compatible with MutableMapping - :rtype: ~encode.array.models.SpaceDelimitedExtensibleEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - - @overload - async def extensible_enum_space_delimited( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.SpaceDelimitedExtensibleEnumArrayProperty: - """extensible_enum_space_delimited. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: SpaceDelimitedExtensibleEnumArrayProperty. The - SpaceDelimitedExtensibleEnumArrayProperty is compatible with MutableMapping - :rtype: ~encode.array.models.SpaceDelimitedExtensibleEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - - async def extensible_enum_space_delimited( - self, body: Union[_models3.SpaceDelimitedExtensibleEnumArrayProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models3.SpaceDelimitedExtensibleEnumArrayProperty: - """extensible_enum_space_delimited. - - :param body: Is one of the following types: SpaceDelimitedExtensibleEnumArrayProperty, JSON, - IO[bytes] Required. - :type body: ~encode.array.models.SpaceDelimitedExtensibleEnumArrayProperty or JSON or IO[bytes] - :return: SpaceDelimitedExtensibleEnumArrayProperty. The - SpaceDelimitedExtensibleEnumArrayProperty is compatible with MutableMapping - :rtype: ~encode.array.models.SpaceDelimitedExtensibleEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models3.SpaceDelimitedExtensibleEnumArrayProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_extensible_enum_space_delimited_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client.pipeline.run(_request, stream=_stream, **kwargs) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models3.SpaceDelimitedExtensibleEnumArrayProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def extensible_enum_pipe_delimited( - self, - body: _models3.PipeDelimitedExtensibleEnumArrayProperty, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models3.PipeDelimitedExtensibleEnumArrayProperty: - """extensible_enum_pipe_delimited. - - :param body: Required. - :type body: ~encode.array.models.PipeDelimitedExtensibleEnumArrayProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PipeDelimitedExtensibleEnumArrayProperty. The PipeDelimitedExtensibleEnumArrayProperty - is compatible with MutableMapping - :rtype: ~encode.array.models.PipeDelimitedExtensibleEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - - @overload - async def extensible_enum_pipe_delimited( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.PipeDelimitedExtensibleEnumArrayProperty: - """extensible_enum_pipe_delimited. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PipeDelimitedExtensibleEnumArrayProperty. The PipeDelimitedExtensibleEnumArrayProperty - is compatible with MutableMapping - :rtype: ~encode.array.models.PipeDelimitedExtensibleEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - - @overload - async def extensible_enum_pipe_delimited( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.PipeDelimitedExtensibleEnumArrayProperty: - """extensible_enum_pipe_delimited. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: PipeDelimitedExtensibleEnumArrayProperty. The PipeDelimitedExtensibleEnumArrayProperty - is compatible with MutableMapping - :rtype: ~encode.array.models.PipeDelimitedExtensibleEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - - async def extensible_enum_pipe_delimited( - self, body: Union[_models3.PipeDelimitedExtensibleEnumArrayProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models3.PipeDelimitedExtensibleEnumArrayProperty: - """extensible_enum_pipe_delimited. - - :param body: Is one of the following types: PipeDelimitedExtensibleEnumArrayProperty, JSON, - IO[bytes] Required. - :type body: ~encode.array.models.PipeDelimitedExtensibleEnumArrayProperty or JSON or IO[bytes] - :return: PipeDelimitedExtensibleEnumArrayProperty. The PipeDelimitedExtensibleEnumArrayProperty - is compatible with MutableMapping - :rtype: ~encode.array.models.PipeDelimitedExtensibleEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models3.PipeDelimitedExtensibleEnumArrayProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_extensible_enum_pipe_delimited_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client.pipeline.run(_request, stream=_stream, **kwargs) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models3.PipeDelimitedExtensibleEnumArrayProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def extensible_enum_newline_delimited( - self, - body: _models3.NewlineDelimitedExtensibleEnumArrayProperty, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models3.NewlineDelimitedExtensibleEnumArrayProperty: - """extensible_enum_newline_delimited. - - :param body: Required. - :type body: ~encode.array.models.NewlineDelimitedExtensibleEnumArrayProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: NewlineDelimitedExtensibleEnumArrayProperty. The - NewlineDelimitedExtensibleEnumArrayProperty is compatible with MutableMapping - :rtype: ~encode.array.models.NewlineDelimitedExtensibleEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - - @overload - async def extensible_enum_newline_delimited( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.NewlineDelimitedExtensibleEnumArrayProperty: - """extensible_enum_newline_delimited. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: NewlineDelimitedExtensibleEnumArrayProperty. The - NewlineDelimitedExtensibleEnumArrayProperty is compatible with MutableMapping - :rtype: ~encode.array.models.NewlineDelimitedExtensibleEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - - @overload - async def extensible_enum_newline_delimited( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models3.NewlineDelimitedExtensibleEnumArrayProperty: - """extensible_enum_newline_delimited. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: NewlineDelimitedExtensibleEnumArrayProperty. The - NewlineDelimitedExtensibleEnumArrayProperty is compatible with MutableMapping - :rtype: ~encode.array.models.NewlineDelimitedExtensibleEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - - async def extensible_enum_newline_delimited( - self, body: Union[_models3.NewlineDelimitedExtensibleEnumArrayProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models3.NewlineDelimitedExtensibleEnumArrayProperty: - """extensible_enum_newline_delimited. - - :param body: Is one of the following types: NewlineDelimitedExtensibleEnumArrayProperty, JSON, - IO[bytes] Required. - :type body: ~encode.array.models.NewlineDelimitedExtensibleEnumArrayProperty or JSON or - IO[bytes] - :return: NewlineDelimitedExtensibleEnumArrayProperty. The - NewlineDelimitedExtensibleEnumArrayProperty is compatible with MutableMapping - :rtype: ~encode.array.models.NewlineDelimitedExtensibleEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models3.NewlineDelimitedExtensibleEnumArrayProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_extensible_enum_newline_delimited_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client.pipeline.run(_request, stream=_stream, **kwargs) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models3.NewlineDelimitedExtensibleEnumArrayProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/packages/typespec-python/test/unbranded/generated/encode-array/encode/array/property/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/encode-array/encode/array/property/operations/_operations.py index 94dbb00d60..f59f6cbee1 100644 --- a/packages/typespec-python/test/unbranded/generated/encode-array/encode/array/property/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/encode-array/encode/array/property/operations/_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines # coding=utf-8 from collections.abc import MutableMapping from io import IOBase @@ -101,150 +100,6 @@ def build_property_newline_delimited_request(**kwargs: Any) -> HttpRequest: return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) -def build_property_enum_comma_delimited_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/encode/array/property/enum/comma-delimited" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_property_enum_space_delimited_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/encode/array/property/enum/space-delimited" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_property_enum_pipe_delimited_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/encode/array/property/enum/pipe-delimited" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_property_enum_newline_delimited_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/encode/array/property/enum/newline-delimited" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_property_extensible_enum_comma_delimited_request( # pylint: disable=name-too-long - **kwargs: Any, -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/encode/array/property/extensible-enum/comma-delimited" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_property_extensible_enum_space_delimited_request( # pylint: disable=name-too-long - **kwargs: Any, -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/encode/array/property/extensible-enum/space-delimited" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_property_extensible_enum_pipe_delimited_request( # pylint: disable=name-too-long - **kwargs: Any, -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/encode/array/property/extensible-enum/pipe-delimited" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_property_extensible_enum_newline_delimited_request( # pylint: disable=name-too-long - **kwargs: Any, -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/encode/array/property/extensible-enum/newline-delimited" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - class PropertyOperations: """ .. warning:: @@ -741,980 +596,3 @@ def newline_delimited( return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - - @overload - def enum_comma_delimited( - self, body: _models2.CommaDelimitedEnumArrayProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.CommaDelimitedEnumArrayProperty: - """enum_comma_delimited. - - :param body: Required. - :type body: ~encode.array.models.CommaDelimitedEnumArrayProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: CommaDelimitedEnumArrayProperty. The CommaDelimitedEnumArrayProperty is compatible - with MutableMapping - :rtype: ~encode.array.models.CommaDelimitedEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - - @overload - def enum_comma_delimited( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.CommaDelimitedEnumArrayProperty: - """enum_comma_delimited. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: CommaDelimitedEnumArrayProperty. The CommaDelimitedEnumArrayProperty is compatible - with MutableMapping - :rtype: ~encode.array.models.CommaDelimitedEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - - @overload - def enum_comma_delimited( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.CommaDelimitedEnumArrayProperty: - """enum_comma_delimited. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: CommaDelimitedEnumArrayProperty. The CommaDelimitedEnumArrayProperty is compatible - with MutableMapping - :rtype: ~encode.array.models.CommaDelimitedEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - - def enum_comma_delimited( - self, body: Union[_models2.CommaDelimitedEnumArrayProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models2.CommaDelimitedEnumArrayProperty: - """enum_comma_delimited. - - :param body: Is one of the following types: CommaDelimitedEnumArrayProperty, JSON, IO[bytes] - Required. - :type body: ~encode.array.models.CommaDelimitedEnumArrayProperty or JSON or IO[bytes] - :return: CommaDelimitedEnumArrayProperty. The CommaDelimitedEnumArrayProperty is compatible - with MutableMapping - :rtype: ~encode.array.models.CommaDelimitedEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.CommaDelimitedEnumArrayProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_enum_comma_delimited_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client.pipeline.run(_request, stream=_stream, **kwargs) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models2.CommaDelimitedEnumArrayProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def enum_space_delimited( - self, body: _models2.SpaceDelimitedEnumArrayProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.SpaceDelimitedEnumArrayProperty: - """enum_space_delimited. - - :param body: Required. - :type body: ~encode.array.models.SpaceDelimitedEnumArrayProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: SpaceDelimitedEnumArrayProperty. The SpaceDelimitedEnumArrayProperty is compatible - with MutableMapping - :rtype: ~encode.array.models.SpaceDelimitedEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - - @overload - def enum_space_delimited( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.SpaceDelimitedEnumArrayProperty: - """enum_space_delimited. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: SpaceDelimitedEnumArrayProperty. The SpaceDelimitedEnumArrayProperty is compatible - with MutableMapping - :rtype: ~encode.array.models.SpaceDelimitedEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - - @overload - def enum_space_delimited( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.SpaceDelimitedEnumArrayProperty: - """enum_space_delimited. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: SpaceDelimitedEnumArrayProperty. The SpaceDelimitedEnumArrayProperty is compatible - with MutableMapping - :rtype: ~encode.array.models.SpaceDelimitedEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - - def enum_space_delimited( - self, body: Union[_models2.SpaceDelimitedEnumArrayProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models2.SpaceDelimitedEnumArrayProperty: - """enum_space_delimited. - - :param body: Is one of the following types: SpaceDelimitedEnumArrayProperty, JSON, IO[bytes] - Required. - :type body: ~encode.array.models.SpaceDelimitedEnumArrayProperty or JSON or IO[bytes] - :return: SpaceDelimitedEnumArrayProperty. The SpaceDelimitedEnumArrayProperty is compatible - with MutableMapping - :rtype: ~encode.array.models.SpaceDelimitedEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.SpaceDelimitedEnumArrayProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_enum_space_delimited_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client.pipeline.run(_request, stream=_stream, **kwargs) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models2.SpaceDelimitedEnumArrayProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def enum_pipe_delimited( - self, body: _models2.PipeDelimitedEnumArrayProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.PipeDelimitedEnumArrayProperty: - """enum_pipe_delimited. - - :param body: Required. - :type body: ~encode.array.models.PipeDelimitedEnumArrayProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PipeDelimitedEnumArrayProperty. The PipeDelimitedEnumArrayProperty is compatible with - MutableMapping - :rtype: ~encode.array.models.PipeDelimitedEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - - @overload - def enum_pipe_delimited( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.PipeDelimitedEnumArrayProperty: - """enum_pipe_delimited. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PipeDelimitedEnumArrayProperty. The PipeDelimitedEnumArrayProperty is compatible with - MutableMapping - :rtype: ~encode.array.models.PipeDelimitedEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - - @overload - def enum_pipe_delimited( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.PipeDelimitedEnumArrayProperty: - """enum_pipe_delimited. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: PipeDelimitedEnumArrayProperty. The PipeDelimitedEnumArrayProperty is compatible with - MutableMapping - :rtype: ~encode.array.models.PipeDelimitedEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - - def enum_pipe_delimited( - self, body: Union[_models2.PipeDelimitedEnumArrayProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models2.PipeDelimitedEnumArrayProperty: - """enum_pipe_delimited. - - :param body: Is one of the following types: PipeDelimitedEnumArrayProperty, JSON, IO[bytes] - Required. - :type body: ~encode.array.models.PipeDelimitedEnumArrayProperty or JSON or IO[bytes] - :return: PipeDelimitedEnumArrayProperty. The PipeDelimitedEnumArrayProperty is compatible with - MutableMapping - :rtype: ~encode.array.models.PipeDelimitedEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.PipeDelimitedEnumArrayProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_enum_pipe_delimited_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client.pipeline.run(_request, stream=_stream, **kwargs) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models2.PipeDelimitedEnumArrayProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def enum_newline_delimited( - self, body: _models2.NewlineDelimitedEnumArrayProperty, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.NewlineDelimitedEnumArrayProperty: - """enum_newline_delimited. - - :param body: Required. - :type body: ~encode.array.models.NewlineDelimitedEnumArrayProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: NewlineDelimitedEnumArrayProperty. The NewlineDelimitedEnumArrayProperty is compatible - with MutableMapping - :rtype: ~encode.array.models.NewlineDelimitedEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - - @overload - def enum_newline_delimited( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.NewlineDelimitedEnumArrayProperty: - """enum_newline_delimited. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: NewlineDelimitedEnumArrayProperty. The NewlineDelimitedEnumArrayProperty is compatible - with MutableMapping - :rtype: ~encode.array.models.NewlineDelimitedEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - - @overload - def enum_newline_delimited( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.NewlineDelimitedEnumArrayProperty: - """enum_newline_delimited. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: NewlineDelimitedEnumArrayProperty. The NewlineDelimitedEnumArrayProperty is compatible - with MutableMapping - :rtype: ~encode.array.models.NewlineDelimitedEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - - def enum_newline_delimited( - self, body: Union[_models2.NewlineDelimitedEnumArrayProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models2.NewlineDelimitedEnumArrayProperty: - """enum_newline_delimited. - - :param body: Is one of the following types: NewlineDelimitedEnumArrayProperty, JSON, IO[bytes] - Required. - :type body: ~encode.array.models.NewlineDelimitedEnumArrayProperty or JSON or IO[bytes] - :return: NewlineDelimitedEnumArrayProperty. The NewlineDelimitedEnumArrayProperty is compatible - with MutableMapping - :rtype: ~encode.array.models.NewlineDelimitedEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.NewlineDelimitedEnumArrayProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_enum_newline_delimited_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client.pipeline.run(_request, stream=_stream, **kwargs) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models2.NewlineDelimitedEnumArrayProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def extensible_enum_comma_delimited( - self, - body: _models2.CommaDelimitedExtensibleEnumArrayProperty, - *, - content_type: str = "application/json", - **kwargs: Any, - ) -> _models2.CommaDelimitedExtensibleEnumArrayProperty: - """extensible_enum_comma_delimited. - - :param body: Required. - :type body: ~encode.array.models.CommaDelimitedExtensibleEnumArrayProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: CommaDelimitedExtensibleEnumArrayProperty. The - CommaDelimitedExtensibleEnumArrayProperty is compatible with MutableMapping - :rtype: ~encode.array.models.CommaDelimitedExtensibleEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - - @overload - def extensible_enum_comma_delimited( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.CommaDelimitedExtensibleEnumArrayProperty: - """extensible_enum_comma_delimited. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: CommaDelimitedExtensibleEnumArrayProperty. The - CommaDelimitedExtensibleEnumArrayProperty is compatible with MutableMapping - :rtype: ~encode.array.models.CommaDelimitedExtensibleEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - - @overload - def extensible_enum_comma_delimited( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.CommaDelimitedExtensibleEnumArrayProperty: - """extensible_enum_comma_delimited. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: CommaDelimitedExtensibleEnumArrayProperty. The - CommaDelimitedExtensibleEnumArrayProperty is compatible with MutableMapping - :rtype: ~encode.array.models.CommaDelimitedExtensibleEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - - def extensible_enum_comma_delimited( - self, body: Union[_models2.CommaDelimitedExtensibleEnumArrayProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models2.CommaDelimitedExtensibleEnumArrayProperty: - """extensible_enum_comma_delimited. - - :param body: Is one of the following types: CommaDelimitedExtensibleEnumArrayProperty, JSON, - IO[bytes] Required. - :type body: ~encode.array.models.CommaDelimitedExtensibleEnumArrayProperty or JSON or IO[bytes] - :return: CommaDelimitedExtensibleEnumArrayProperty. The - CommaDelimitedExtensibleEnumArrayProperty is compatible with MutableMapping - :rtype: ~encode.array.models.CommaDelimitedExtensibleEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.CommaDelimitedExtensibleEnumArrayProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_extensible_enum_comma_delimited_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client.pipeline.run(_request, stream=_stream, **kwargs) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models2.CommaDelimitedExtensibleEnumArrayProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def extensible_enum_space_delimited( - self, - body: _models2.SpaceDelimitedExtensibleEnumArrayProperty, - *, - content_type: str = "application/json", - **kwargs: Any, - ) -> _models2.SpaceDelimitedExtensibleEnumArrayProperty: - """extensible_enum_space_delimited. - - :param body: Required. - :type body: ~encode.array.models.SpaceDelimitedExtensibleEnumArrayProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: SpaceDelimitedExtensibleEnumArrayProperty. The - SpaceDelimitedExtensibleEnumArrayProperty is compatible with MutableMapping - :rtype: ~encode.array.models.SpaceDelimitedExtensibleEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - - @overload - def extensible_enum_space_delimited( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.SpaceDelimitedExtensibleEnumArrayProperty: - """extensible_enum_space_delimited. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: SpaceDelimitedExtensibleEnumArrayProperty. The - SpaceDelimitedExtensibleEnumArrayProperty is compatible with MutableMapping - :rtype: ~encode.array.models.SpaceDelimitedExtensibleEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - - @overload - def extensible_enum_space_delimited( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.SpaceDelimitedExtensibleEnumArrayProperty: - """extensible_enum_space_delimited. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: SpaceDelimitedExtensibleEnumArrayProperty. The - SpaceDelimitedExtensibleEnumArrayProperty is compatible with MutableMapping - :rtype: ~encode.array.models.SpaceDelimitedExtensibleEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - - def extensible_enum_space_delimited( - self, body: Union[_models2.SpaceDelimitedExtensibleEnumArrayProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models2.SpaceDelimitedExtensibleEnumArrayProperty: - """extensible_enum_space_delimited. - - :param body: Is one of the following types: SpaceDelimitedExtensibleEnumArrayProperty, JSON, - IO[bytes] Required. - :type body: ~encode.array.models.SpaceDelimitedExtensibleEnumArrayProperty or JSON or IO[bytes] - :return: SpaceDelimitedExtensibleEnumArrayProperty. The - SpaceDelimitedExtensibleEnumArrayProperty is compatible with MutableMapping - :rtype: ~encode.array.models.SpaceDelimitedExtensibleEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.SpaceDelimitedExtensibleEnumArrayProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_extensible_enum_space_delimited_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client.pipeline.run(_request, stream=_stream, **kwargs) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models2.SpaceDelimitedExtensibleEnumArrayProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def extensible_enum_pipe_delimited( - self, - body: _models2.PipeDelimitedExtensibleEnumArrayProperty, - *, - content_type: str = "application/json", - **kwargs: Any, - ) -> _models2.PipeDelimitedExtensibleEnumArrayProperty: - """extensible_enum_pipe_delimited. - - :param body: Required. - :type body: ~encode.array.models.PipeDelimitedExtensibleEnumArrayProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PipeDelimitedExtensibleEnumArrayProperty. The PipeDelimitedExtensibleEnumArrayProperty - is compatible with MutableMapping - :rtype: ~encode.array.models.PipeDelimitedExtensibleEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - - @overload - def extensible_enum_pipe_delimited( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.PipeDelimitedExtensibleEnumArrayProperty: - """extensible_enum_pipe_delimited. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PipeDelimitedExtensibleEnumArrayProperty. The PipeDelimitedExtensibleEnumArrayProperty - is compatible with MutableMapping - :rtype: ~encode.array.models.PipeDelimitedExtensibleEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - - @overload - def extensible_enum_pipe_delimited( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.PipeDelimitedExtensibleEnumArrayProperty: - """extensible_enum_pipe_delimited. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: PipeDelimitedExtensibleEnumArrayProperty. The PipeDelimitedExtensibleEnumArrayProperty - is compatible with MutableMapping - :rtype: ~encode.array.models.PipeDelimitedExtensibleEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - - def extensible_enum_pipe_delimited( - self, body: Union[_models2.PipeDelimitedExtensibleEnumArrayProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models2.PipeDelimitedExtensibleEnumArrayProperty: - """extensible_enum_pipe_delimited. - - :param body: Is one of the following types: PipeDelimitedExtensibleEnumArrayProperty, JSON, - IO[bytes] Required. - :type body: ~encode.array.models.PipeDelimitedExtensibleEnumArrayProperty or JSON or IO[bytes] - :return: PipeDelimitedExtensibleEnumArrayProperty. The PipeDelimitedExtensibleEnumArrayProperty - is compatible with MutableMapping - :rtype: ~encode.array.models.PipeDelimitedExtensibleEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.PipeDelimitedExtensibleEnumArrayProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_extensible_enum_pipe_delimited_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client.pipeline.run(_request, stream=_stream, **kwargs) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models2.PipeDelimitedExtensibleEnumArrayProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def extensible_enum_newline_delimited( - self, - body: _models2.NewlineDelimitedExtensibleEnumArrayProperty, - *, - content_type: str = "application/json", - **kwargs: Any, - ) -> _models2.NewlineDelimitedExtensibleEnumArrayProperty: - """extensible_enum_newline_delimited. - - :param body: Required. - :type body: ~encode.array.models.NewlineDelimitedExtensibleEnumArrayProperty - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: NewlineDelimitedExtensibleEnumArrayProperty. The - NewlineDelimitedExtensibleEnumArrayProperty is compatible with MutableMapping - :rtype: ~encode.array.models.NewlineDelimitedExtensibleEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - - @overload - def extensible_enum_newline_delimited( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.NewlineDelimitedExtensibleEnumArrayProperty: - """extensible_enum_newline_delimited. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: NewlineDelimitedExtensibleEnumArrayProperty. The - NewlineDelimitedExtensibleEnumArrayProperty is compatible with MutableMapping - :rtype: ~encode.array.models.NewlineDelimitedExtensibleEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - - @overload - def extensible_enum_newline_delimited( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.NewlineDelimitedExtensibleEnumArrayProperty: - """extensible_enum_newline_delimited. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: NewlineDelimitedExtensibleEnumArrayProperty. The - NewlineDelimitedExtensibleEnumArrayProperty is compatible with MutableMapping - :rtype: ~encode.array.models.NewlineDelimitedExtensibleEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - - def extensible_enum_newline_delimited( - self, body: Union[_models2.NewlineDelimitedExtensibleEnumArrayProperty, JSON, IO[bytes]], **kwargs: Any - ) -> _models2.NewlineDelimitedExtensibleEnumArrayProperty: - """extensible_enum_newline_delimited. - - :param body: Is one of the following types: NewlineDelimitedExtensibleEnumArrayProperty, JSON, - IO[bytes] Required. - :type body: ~encode.array.models.NewlineDelimitedExtensibleEnumArrayProperty or JSON or - IO[bytes] - :return: NewlineDelimitedExtensibleEnumArrayProperty. The - NewlineDelimitedExtensibleEnumArrayProperty is compatible with MutableMapping - :rtype: ~encode.array.models.NewlineDelimitedExtensibleEnumArrayProperty - :raises ~corehttp.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.NewlineDelimitedExtensibleEnumArrayProperty] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_property_extensible_enum_newline_delimited_request( - content_type=content_type, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client.pipeline.run(_request, stream=_stream, **kwargs) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models2.NewlineDelimitedExtensibleEnumArrayProperty, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore From 91ac8bf61be27d46ff3226a1f6dab3b031e1b4bd Mon Sep 17 00:00:00 2001 From: AutoPrFromHttpClientPython Date: Thu, 29 Jan 2026 05:26:56 +0000 Subject: [PATCH 4/4] Regenerate for autorest.python (2026-01-29 05:26:56) --- .../test_model_base_xml_serialization.py | 92 +++++++++++++------ 1 file changed, 62 insertions(+), 30 deletions(-) diff --git a/packages/typespec-python/test/generic_mock_api_tests/unittests/test_model_base_xml_serialization.py b/packages/typespec-python/test/generic_mock_api_tests/unittests/test_model_base_xml_serialization.py index 12011df99b..78912e305b 100644 --- a/packages/typespec-python/test/generic_mock_api_tests/unittests/test_model_base_xml_serialization.py +++ b/packages/typespec-python/test/generic_mock_api_tests/unittests/test_model_base_xml_serialization.py @@ -523,10 +523,12 @@ def __init__(self, *args, **kwargs): class TestXmlSerialization: def test_basic(self): """Test an ultra basic XML.""" - basic_xml = ET.fromstring(""" + basic_xml = ET.fromstring( + """ 37 - """) + """ + ) class XmlModel(Model): age: int = rest_field(xml={"name": "Age"}) @@ -542,8 +544,12 @@ def __init__(self, *args, **kwargs): def test_basic_unicode(self): """Test a XML with unicode.""" - basic_xml = ET.fromstring(""" - """.encode("utf-8")) + basic_xml = ET.fromstring( + """ + """.encode( + "utf-8" + ) + ) class XmlModel(Model): language: str = rest_field(xml={"name": "language", "attribute": True}) @@ -583,11 +589,13 @@ def __init__(self, *args, **kwargs): def test_type_basic(self): """Test basic types.""" - basic_xml = ET.fromstring(""" + basic_xml = ET.fromstring( + """ 37 true - """) + """ + ) class XmlModel(Model): age: int = rest_field(name="age", xml={"name": "Age"}) @@ -603,8 +611,10 @@ def __init__(self, *args, **kwargs): def test_basic_text(self): """Test a XML with unicode.""" - basic_xml = ET.fromstring(""" - I am text""") + basic_xml = ET.fromstring( + """ + I am text""" + ) class XmlModel(Model): language: str = rest_field(name="language", xml={"name": "language", "attribute": True}) @@ -620,13 +630,15 @@ def __init__(self, *args, **kwargs): def test_dict_type(self): """Test dict type.""" - basic_xml = ET.fromstring(""" + basic_xml = ET.fromstring( + """ value1 value2 - """) + """ + ) class XmlModel(Model): metadata: Dict[str, str] = rest_field(name="Metadata", xml={"name": "Metadata"}) @@ -646,7 +658,8 @@ def __init__(self, *args, **kwargs): def test_additional_properties(self): """Test additional properties.""" - basic_xml = ET.fromstring(""" + basic_xml = ET.fromstring( + """ test text @@ -659,7 +672,8 @@ def test_additional_properties(self): a b - """) + """ + ) class XmlModel(Model): name: str = rest_field(name="name", xml={"name": "Name"}) @@ -682,13 +696,15 @@ def __init__(self, *args, **kwargs): def test_list_wrapped_basic_types(self): """Test XML list and wrap, items is basic type and there is no itemsName.""" - basic_xml = ET.fromstring(""" + basic_xml = ET.fromstring( + """ granny fuji - """) + """ + ) class AppleBarrel(Model): good_apples: List[str] = rest_field(name="GoodApples", xml={"name": "GoodApples"}) @@ -704,11 +720,13 @@ def __init__(self, *args, **kwargs): def test_list_not_wrapped_basic_types(self): """Test XML list and no wrap, items is basic type and there is no itemsName.""" - basic_xml = ET.fromstring(""" + basic_xml = ET.fromstring( + """ granny fuji - """) + """ + ) class AppleBarrel(Model): good_apples: List[str] = rest_field(name="GoodApples", xml={"name": "GoodApples", "unwrapped": True}) @@ -724,13 +742,15 @@ def __init__(self, *args, **kwargs): def test_list_wrapped_basic_types_items_name(self): """Test XML list and wrap, items is basic type and itemsName.""" - basic_xml = ET.fromstring(""" + basic_xml = ET.fromstring( + """ granny fuji - """) + """ + ) class AppleBarrel(Model): good_apples: List[str] = rest_field(name="GoodApples", xml={"name": "GoodApples", "itemsName": "string"}) @@ -746,11 +766,13 @@ def __init__(self, *args, **kwargs): def test_list_not_wrapped_basic_types_items_name(self): """Test XML list and no wrap, items is basic type and itemsName.""" - basic_xml = ET.fromstring(""" + basic_xml = ET.fromstring( + """ granny fuji - """) + """ + ) class AppleBarrel(Model): good_apples: List[str] = rest_field( @@ -769,13 +791,15 @@ def __init__(self, *args, **kwargs): def test_list_wrapped_complex_types(self): """Test XML list and wrap, items is ref.""" - basic_xml = ET.fromstring(""" + basic_xml = ET.fromstring( + """ - """) + """ + ) class Apple(Model): name: str = rest_field(name="name", xml={"name": "name", "attribute": True}) @@ -800,11 +824,13 @@ def __init__(self, *args, **kwargs): def test_list_not_wrapped_complex_types(self): """Test XML list and wrap, items is ref.""" - basic_xml = ET.fromstring(""" + basic_xml = ET.fromstring( + """ - """) + """ + ) class Apple(Model): name: str = rest_field(name="name", xml={"name": "name", "attribute": True}) @@ -826,11 +852,13 @@ def __init__(self, *args, **kwargs): def test_two_complex_same_type(self): """Two different attribute are same type""" - basic_xml = ET.fromstring(""" + basic_xml = ET.fromstring( + """ - """) + """ + ) class Apple(Model): name: str = rest_field(name="name", xml={"name": "name", "attribute": True}) @@ -855,10 +883,12 @@ def __init__(self, *args, **kwargs): def test_basic_namespace(self): """Test an ultra basic XML.""" - basic_xml = ET.fromstring(""" + basic_xml = ET.fromstring( + """ 37 - """) + """ + ) class XmlModel(Model): age: int = rest_field( @@ -882,7 +912,8 @@ def __init__(self, *args, **kwargs): def test_complex_namespace(self): """Test recursive namespace.""" - basic_xml = ET.fromstring(""" + basic_xml = ET.fromstring( + """ lmazuel @@ -895,7 +926,8 @@ def test_complex_namespace(self): 12 - """) + """ + ) class QueueDescriptionResponseAuthor(Model): name: str = rest_field(name="name", xml={"ns": "http://www.w3.org/2005/Atom"})